SR-201 Ethernet Relay

Hi All,

New day, new interesting domotica.

So I purchased a SR-201ethernet relay. I’m currently using a Fibaro Z-wave switch but sometimes takes like 5 -10 seconds to receive a signal (which is long if you’re waiting at your gate). So time to switch to an ethernet based relay.

So unpacked, configured and this thing works… with the provided software. I am stuck at the point where I need Homey to be able to send the command 11* via TCP over port 6722 to open or close the relay. Anyone able to help me out? I have a Python script that works, but understand that a Python script does not work in Homey (or I figure it must be way easier for someone experience with Homey to point me in the right direction to where I can “fire” the command over TCP (Raw I believe) + port to an IP of my choice).

Help would be appreciated.

DuMees

You’ll need an app, Homey has no ability to create TCP socket connections from flows or scripts.

Thanks Robert, let me start by saying I appreciate what you’re doing for the Homey community. You’ve been a lifesaver more than once for me. Anyway how I can buy you a beer (link to Paypal or something) or show my appreciation?

Do you know a way to create an app to setup the TCP socket? I’m a bit rusty on developing but can built something if I receive a bit of guidance on the basics on Homey script (or whatever it is called).

Not searching for an extensive tutorial as I already built some scripts, but don’t know where to start to be honest.

Thanks

I think the best way to create an app is to follow the “Getting Started” guide: Getting Started | Homey Apps SDK

There’s an SR-201 module available for Node.js that you might be able to use: GitHub - dresende/node-sr201: NodeJS SR-201 Network Relay control

1 Like

Hi, Did you ever sort out how to get Homey Pro to control this SR-201 Relay? I have been trying the Net Connect App but 11* etc does not work. It seems to turn the relay OFF if it has been previously turned ON via the Windows executable, which is the exact opposite of what it should do as the nominated ‘turn on’ command??

Yes I did, not the most beautifull solution but it works. I’ve asked ChatGPT for a couple of scenario’s including the code. My preference was to built an app directly on Homey, but weirdly ChatGPT was unable to pull the right structure for Homey though. The quickest work around was to use MQTT (I have an MQTT server up and running).

You can also just use MQTT Client and MQTT hub on Homey. Set those up (ask ChatGPT a step by step instruction).

For the relay, just ask ChatGPT to write a script for you for the SR-201 relay with all the parameters you want to pass through MQTT protocol. Via the above mentioned Homey apps (MQTT Client and hub) you can than do all you want in a flow. Works like a charm, don’t notice any delay.

Happy to help if you get stuck. Feel free to DM me.

Also happy to share the ChatGPT generated code for the SR-201 relay

I took your inspiration and spent 2 weeks with CoPilot writing a Homey App to control the SR201, it works but won’t repeat the experience in a short while - for a non-tekkie it was not an experience I want to repeat in the short term!