Somfy RS-485 Protocol - Printable Version +- Logic Machine Forum (https://forum.logicmachine.net) +-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1) +--- Forum: Gateway (https://forum.logicmachine.net/forumdisplay.php?fid=10) +--- Thread: Somfy RS-485 Protocol (/showthread.php?tid=562) |
Somfy RS-485 Protocol - ceyhanc - 16.01.2017 Dear All, We have a project that we will integrate with Somfy blinds and shutter. We will communicate and control with some extra transmitter/gateway device which is converting RS485 commands to RF signals. All blinds and shutters get RF commands from this transmitter/gateway device. It has a special for RS485 protocol and commands for communication & control. We need to implement this protocol commands to LM. I attached RS485 protocol guide & transmitter/gateway device documentation below. What we need ? We need to communicate with transmitter/gateway to send basic blinds & shutter commands. such as open/close,up/down etc. Can you help us ? BR Ceyhan RE: Somfy RS-485 Protocol - buuuudzik - 16.01.2017 You can do this in such way: 1. prepare a user.somfy library with: - a table with every commands for every channel (up, down, +, -, program, set) e.g. Code: Somfy = { - communication function Code: -- Send to Somfy transmitter 2. Use it in event-based script. Code: somfy_send(Somfy.ch01.up) 3. You can also improve this with a function of buffering based on UDP because somfy transmitter is very slow. E.g. for sending step command 0,4s; up/down 0,6s; program 6s. So when you will send some command too fast(too soon after last command), it will not work. Please check: http://forum.logicmachine.net/showthread.php?tid=399&highlight=somfy RE: Somfy RS-485 Protocol - ceyhanc - 18.01.2017 Thank you for your support. buuuudzik it will help me so much. If i will find good solution i will share from there. BR Ceyhan RE: Somfy RS-485 Protocol - buuuudzik - 18.01.2017 You're welcome. The best would be if there will some command generator, because when you change device to new one you must update all commands. RE: Somfy RS-485 Protocol - ceyhanc - 18.01.2017 Dear buuuudzik, I started workout on programming it. Can you help me about messages ? I'm so new about that For example can you share with me your correct example messages (up/down +/- ) or write basic (up) message for me like your example ? ( RTS transmitter node ID : 05B8E1, channel : 2 , MSG 80h, function : 01h <up>) Somfy = { ch01 = { up = string.char(0x7F,0xF2,0xFA,0xB8,0x43,0xFA,0x00,0x00,0x00,0xFF,0xFE,0x06,0x5D),}} note: I did UDP Buffer script. BR Ceyhan RE: Somfy RS-485 Protocol - buuuudzik - 18.01.2017 To prepare commands you can use a special tool from Somfy: SOMFY_rs485_frame_builder. I've attached the manual for this app. RE: Somfy RS-485 Protocol - Ravi Kiran S - 17.09.2020 Hi i have created this in user.somfey in liberary Somfy = { ch01 = { up = string.char(0x7F,0xF2,0xFA,0xB8,0x43,0xFA,0x00,0x00,0x00,0xFF,0xFE,0x06,0x5D),}} and in event communication function also i have done this code also - Send to Somfy transmitter somfy_send(cmd) port = require('serial').open('/dev/RS485', { baudrate = 4800, parity = 'odd', duplex = 'half', databits = 8, stopbits = 1 }) port:write(cmd) end but the last end i given the error so i have removed end also In event base script i have done the omfy_send(cmd) port = require('serial').open('/dev/RS485', { baudrate = 4800, parity = 'odd', duplex = 'half', databits = 8, stopbits = 1 }) string.char(0x7F,0xF2,0xFA,0xB8,0x43,0xFA,0x00,0x00,0x00,0xFF,0xFE,0x06,0x5D),}} this with the hexacode given by somfy vendor but the contoller is not working so please tell the procedure todo because i am doing it first time Thanks RE: Somfy RS-485 Protocol - buuuudzik - 17.09.2020 You must have: - id of your Somfy RS-485 transmitter, - path to your RS-485 port from Logic Machine (often LM has more than one), - use frame builder to prepare apropriate command e.g. up or down - you can log the response from serial RE: Somfy RS-485 Protocol - Ravi Kiran S - 18.09.2020 (17.09.2020, 18:17)buuuudzik Wrote: You must have:Hi - yes i have id of the transmitter but where i have to write - i have connected to the RS485-3 means port 3 - using the frame builder only i have all hexa codes so this is the code i have write in event based script but it is not working -- for curtain up if not port then require('serial') port = serial.open('/dev/RS485-3', { baudrate = 4800, parity = 'odd', databits = 8, stopbits = 1, duplex = 'half' }) port:flush() end if port then ch01=up char = string.char(0x7F, 0xF2, 0xFA, 0x01, 0x00, 0x00, 0xB5, 0x2B, 0xFA, 0xFF, 0xFE, 0x06, 0x43) -- wait for 1.5 seconds os.sleep(0.1) char = string.char(0x7F, 0xF2, 0xFA, 0x01, 0x00, 0x00, 0xB5, 0x2B, 0xFA, 0xFF, 0xFE, 0x06, 0x43) alert(char) port:write(char) end -- For curtain down if not port then require('serial') port = serial.open('/dev/RS485-3', { baudrate = 4800, parity = 'odd', databits = 8, stopbits = 1, duplex = 'half' }) port:flush() end if port then char = string.char(0x7F, 0xF2, 0xFA, 0x01, 0x00, 0x00, 0xB5, 0x2B, 0xFA, 0xFF, 0xFE, 0x06, 0x42) -- wait for 1.5 seconds os.sleep(0.1) char = string.char(0x7F, 0xF2, 0xFA, 0x01, 0x00, 0x00, 0xB5, 0x2B, 0xFA, 0xFF, 0xFE, 0x06, 0x42) alert(char) port:write(char) end pls do needfull todo work RE: Somfy RS-485 Protocol - buuuudzik - 18.09.2020 Another thing is that this is wireless so sometimes length is too much, the best is testing when transmitter see the blind. Today unfortunately I dont have enough time to do such tutorial maybe someone else. RE: Somfy RS-485 Protocol - myg - 23.09.2020 FWIW, I have shutters/blinds RF integration based on Sonoff RF bridge flashed with custom firmware, it connects to MQTT that's running on LM, but it also needs WiFi to run. It's super cheap and easy to program, and you can issue simple MQTT commands to operate. RE: Somfy RS-485 Protocol - BrentW - 17.07.2022 (17.09.2020, 18:17)buuuudzik Wrote: You must have: Hi Buuuudzik, Have you had experience with reading the response from the nodes? I.e. if you use the broadcast message 'get node address'?? The returned message from the node appears as symbols when logged? BW RE: Somfy RS-485 Protocol - Joep - 14.09.2023 With the script below i now can control one motor. But that motor was already programmed by a remote control. Now my question is if someone can tell me if and how it's possible to program a new motor from scratch on please as i totaly don't understand the protocol and all of its functions. There is no manuel explaining the RTS protocol so i'm really confused.. value = event.getvalue() require('serial') port = serial.open('/dev/RS485', { baudrate = 4800, databits = 8, stopbits = 1, parity = 'odd', duplex = 'half' }) if value == false then res, err = port:write(string.char(0x7F,0xF2,0xFA,0xC9,0x7B,0xFA,0x00,0x00,0x00,0xFE,0xFE,0x06,0xA5)) else res, err = port:write(string.char(0x7F,0xF2,0xFA,0xC9,0x7B,0xFA,0x00,0x00,0x00,0xFE,0xFD,0x06,0xA4)) end log(res, err) RE: Somfy RS-485 Protocol - Bitver - 14.09.2023 (14.09.2023, 13:41)Joep Wrote: With the script below i now can control one motor. But that motor was already programmed by a remote control. Now my question is if someone can tell me if and how it's possible to program a new motor from scratch on please as i totaly don't understand the protocol and all of its functions. There is no manuel explaining the RTS protocol so i'm really confused.. You should know address of motors and implement your sendRS485 function with your connection parameters. Check code below it would be great if it works you, but I can't be responsible for it. It work with my motors. Code: -- 1/0 up/down RE: Somfy RS-485 Protocol - Joep - 15.09.2023 (14.09.2023, 20:37)Bitver Wrote:(14.09.2023, 13:41)Joep Wrote: With the script below i now can control one motor. But that motor was already programmed by a remote control. Now my question is if someone can tell me if and how it's possible to program a new motor from scratch on please as i totaly don't understand the protocol and all of its functions. There is no manuel explaining the RTS protocol so i'm really confused.. Thanks for your answer and sharing your code. My biggest issue is how to set the correct channel? How is this done? First with a Somfy remote and once paired you can also control it by the script or how does it work? RE: Somfy RS-485 Protocol - Bitver - 15.09.2023 (15.09.2023, 12:04)Joep Wrote: Thanks for your answer and sharing your code. My biggest issue is how to set the correct channel? How is this done? First with a Somfy remote and once paired you can also control it by the script or how does it work?Only address is needed for control by script. If you need RTS channels check rs485windowSetChannel function or remote controller. Also I think you should check your motors documentation first for proper initial installation. RE: Somfy RS-485 Protocol - Joep - 18.09.2023 (15.09.2023, 19:47)Bitver Wrote:(15.09.2023, 12:04)Joep Wrote: Thanks for your answer and sharing your code. My biggest issue is how to set the correct channel? How is this done? First with a Somfy remote and once paired you can also control it by the script or how does it work?Only address is needed for control by script. If you need RTS channels check rs485windowSetChannel function or remote controller. Thanks Bitver. That helped me. |