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
#1
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

Attached Files
.pdf   SOMFY RS485 Protocol_User's guide.pdf (Size: 583.5 KB / Downloads: 171)
.pdf   rs485-rts-transmitter_manual.pdf (Size: 5.09 MB / Downloads: 122)
.pdf   rs485-rts-transmitter_profile1.pdf (Size: 549.91 KB / Downloads: 115)
Reply
#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
#3
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
Reply
#4
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.
Reply
#5
Dear buuuudzik,

I started workout on programming it.

Can you help me about messages ? I'm so new about that Smile
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
Reply
#6
To prepare commands you can use a special tool from Somfy: SOMFY_rs485_frame_builder.

I've attached the manual for this app.

Attached Files
.pdf   rs485_frame_builder_quick_guide_0.04.11.pdf (Size: 450.35 KB / Downloads: 129)
Reply
#7
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
Reply
#8
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
Done is better than perfect
Reply
#9
(17.09.2020, 18:17)buuuudzik Wrote: 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
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
Reply
#10
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.
Done is better than perfect
Reply
#11
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.
Reply
#12
(17.09.2020, 18:17)buuuudzik Wrote: 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

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

Attached Files Thumbnail(s)
   
Reply


Forum Jump: