ZmWebRelay - TCP configuration

Hi everybody,

A few years ago, I was working with Jeedom/Domoticz and I purchased some cheap chinese relays.
There where really well integrated in both systems.

Now I switched to HA since 2 mounths and I did not success configuring them in HA.
We can find them as “ZmWebRelay” on google.

We can have theses details :
IP : 192.168.0.100 (factory : 192.168.1.166)

  • Port : 1234
  • PortWeb : 80
  • Login : admin
  • Password : 12345678

I found this link https://www.vincenzocaputo.com/langolo_dei_lettori/come-utilizzare-una-scheda-relandegrave-lan-con-home-assistant-188
I adjusted the IP but it do not work.

The “manual” refer to this :slight_smile:

Can you help me sending the goods things to the relays ?

Thanks a lot,

Spacecodes

Hi,

I found the solution :

switch:
 - platform: command_line
   scan_interval: 5
   switches:
    relais1:
      command_on: echo -e "L1/r/n" | nc 192.168.0.100 1234
      command_off: echo -e "D1/r/n" | nc 192.168.0.100 1234
      command_state: echo -e "R1/r/n" | nc 192.168.0.100 1234
      value_template: "{{ value == 'Relayon 1' }}"
      friendly_name: Relai 1
    relais2:
      command_on: echo -e "L2/r/n" | nc 192.168.0.100 1234
      command_off: echo -e "D2/r/n" | nc 192.168.0.100 1234
      command_state: echo -e "R2/r/n" | nc 192.168.0.100 1234
      value_template: "{{ value == 'Relayon 2' }}"
      friendly_name: Relai 2
    relais3:
      command_on: echo -e "L3/r/n" | nc 192.168.0.100 1234
      command_off: echo -e "D3/r/n" | nc 192.168.0.100 1234
      command_state: echo -e "R3/r/n" | nc 192.168.0.100 1234
      value_template: "{{ value == 'Relayon 3' }}"
      friendly_name: Relai 3
    relais4:
      command_on: echo -e "L4/r/n" | nc 192.168.0.100 1234
      command_off: echo -e "D4/r/n" | nc 192.168.0.100 1234
      command_state: echo -e "R4/r/n" | nc 192.168.0.100 1234
      value_template: "{{ value == 'Relayon 4' }}"
      friendly_name: Relai 4
    relais5:
      command_on: echo -e "L5/r/n" | nc 192.168.0.100 1234
      command_off: echo -e "D5/r/n" | nc 192.168.0.100 1234
      command_state: echo -e "R5/r/n" | nc 192.168.0.100 1234
      value_template: "{{ value == 'Relayon 5' }}"
      friendly_name: Relai 5
    relais6:
      command_on: echo -e "L6/r/n" | nc 192.168.0.100 1234
      command_off: echo -e "D6/r/n" | nc 192.168.0.100 1234
      command_state: echo -e "R6/r/n" | nc 192.168.0.100 1234
      value_template: "{{ value == 'Relayon 6' }}"
      friendly_name: Relai 6
    relais7:
      command_on: echo -e "L7/r/n" | nc 192.168.0.100 1234
      command_off: echo -e "D7/r/n" | nc 192.168.0.100 1234
      command_state: echo -e "R7/r/n" | nc 192.168.0.100 1234
      value_template: "{{ value == 'Relayon 7' }}"
      friendly_name: Relai 7
    relais8:
      command_on: echo -e "L8/r/n" | nc 192.168.0.100 1234
      command_off: echo -e "D8/r/n" | nc 192.168.0.100 1234
      command_state: echo -e "R8/r/n" | nc 192.168.0.100 1234
      value_template: "{{ value == 'Relayon 8' }}"
      friendly_name: Relai 8

2 Likes

Hi Christophe,

In your code, is it not useful to pass the user and password (admin and 12345678)?
Thanks.