I have a SR-201 Ethernet Relay. Has anyone tried integrating this to Home Assistant?
In theory it should be possible but haven’t got it working yet. I tried with a telnet switch as I was able to send on and off commands through telnet. But putting the code in the configuration yaml I only get the jogging to work. The relay will turn on for 1/2 and then turn itself off. When I change the command to stay on indefinitely then nothing happens.
Hi,
I use that and it works fine, just one problem, the first switch i set it to open the door, so i just need 1s on (11*), it’s ok.
The second switch i press botton it was on, 6min later it put off again, any suggestion?
I have try only put 12 but not working.
I ended up following this post after all. It uses command line instead of telnet and it seems to be working so far just fine. I’m not sure why the telnet option isn’t working for me though.
I’m having a similar problem too. And then it ends up not letting me turn off relay 2. I think for me it’s because of deleting -q 1 which allowed for a delay to read the response
switch 3:
platform: command_line
switches:
portao:
command_on: echo -n 11 | nc 192.168.11.100 6722
command_off: echo -n 21 | nc 192.168.11.100 6722
command_state: echo -n '00:0^' | nc 192.168.11.100 6722
value_template: '{{ value == "10000000" or value == "11000000" or value == "11100000" or value == "11110000" or value == "11111000" or value == "11111100" or value == "11111110" or value == "11111111" }}'
friendly_name: Portão Garagem
switch 4:
platform: command_line
switches:
luz_portao:
command_on: echo -n 12 | nc 192.168.11.100 6722
command_off: echo -n 22 | nc 192.168.11.100 6722
command_state: echo -n '00:0^' | nc 192.168.11.100 6722
value_template: '{{ value == "01000000" or value == "11000000" or value == "11100000" or value == "11110000" or value == "11111000" or value == "11111100" or value == "11111110" or value == "11111111" }}'
friendly_name: Luz Portão Garagem
I put it working see my configuration behind.
Thanks drthanwho, by your suggestion to use command line.
Hi. I am a big fan of these little boards and have all of them extended to 8 relays with additional 6 relay circuits.
To be able to manage the value template, I added a sed command to directly get the digit matching the channel.
Note that all extended relays are inversed, hence the “2” to switch on the relay 8 in the following example:
A simpler way to do the first value_template is: '{{ value[0:1] == "1" }}'
With me the second template failed at first but I got it fixed:
'{{ value[1:2] == "1" }}'
I think the statement means: read two bits from the byte en ignore the first. If you were to use 4 or 8 relays your notation would become quite cumbersome.
For the sixth relay the value_template would be: '{{ value[5:6] == "1" }}'#Get six bits and ignore the first five.