18.09.2020, 06:54
(17.09.2020, 18:17)buuuudzik Wrote: You must have:Hi
- 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
- 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