This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Somfy RS-485 Protocol
#2
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 = {
ch01 = {
 up = string.char(0x7F,0xF2,0xFA,0xB8,0x43,0xFA,0x00,0x00,0x00,0xFF,0xFE,0x06,0x5D),}}

- communication function
Code:
-- 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


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...ight=somfy
Reply


Messages In This Thread
Somfy RS-485 Protocol - by ceyhanc - 16.01.2017, 11:34
RE: Somfy RS-485 Protocol - by buuuudzik - 16.01.2017, 15:48
RE: Somfy RS-485 Protocol - by ceyhanc - 18.01.2017, 07:50
RE: Somfy RS-485 Protocol - by buuuudzik - 18.01.2017, 08:43
RE: Somfy RS-485 Protocol - by ceyhanc - 18.01.2017, 12:53
RE: Somfy RS-485 Protocol - by buuuudzik - 18.01.2017, 20:03
RE: Somfy RS-485 Protocol - by Ravi Kiran S - 17.09.2020, 16:21
RE: Somfy RS-485 Protocol - by buuuudzik - 17.09.2020, 18:17
RE: Somfy RS-485 Protocol - by Ravi Kiran S - 18.09.2020, 06:54
RE: Somfy RS-485 Protocol - by BrentW - 17.07.2022, 07:53
RE: Somfy RS-485 Protocol - by buuuudzik - 18.09.2020, 08:18
RE: Somfy RS-485 Protocol - by myg - 23.09.2020, 16:19
RE: Somfy RS-485 Protocol - by Joep - 14.09.2023, 13:41
RE: Somfy RS-485 Protocol - by Bitver - 14.09.2023, 20:37
RE: Somfy RS-485 Protocol - by Joep - 15.09.2023, 12:04
RE: Somfy RS-485 Protocol - by Bitver - 15.09.2023, 19:47
RE: Somfy RS-485 Protocol - by Joep - 18.09.2023, 11:01

Forum Jump: