Skip to content

Instantly share code, notes, and snippets.

@jlblancoc
Last active December 23, 2023 12:35
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jlblancoc/61b5a00c94c437bb8ae207871d029e6e to your computer and use it in GitHub Desktop.
Save jlblancoc/61b5a00c94c437bb8ae207871d029e6e to your computer and use it in GitHub Desktop.
Tasmota Rules for LC Technology WiFi Relay

Introduction

These commands are shown in the YouTube tutorial: xxx

Based on the official docs with the addition of the automatic sending of ready\r\n on boot, as required by the firmware of my boards (these ones).

Rules for all boards:

  • Open Module Configuration -> Set module to Generic (18). Click save.

  • Now, depending on the number of relays on your board, do the next 1, 2 or 4 changes:

    1. Set D3 GPIO0 as Relay1
    2. Set GPIO2 as Relay2 (or Relay_i then select 2)
    3. Set GPIO4 as Relay3 (or Relay_i then select 3)
    4. Set GPIO5 as Relay4 (or Relay_i then select 4)
  • Click Save

  • Open the Tasmota console.

  • Disable SerialLog (type seriallog 0 and press enter)

Remain in the Tasmota console for the next step.

Rules for LC WiFi Relay 1x board (1 relay)

  • Add the following rules typing in the console:
Rule1
 on System#Boot do Backlog Baudrate 115200; SerialSend5 72656164790a0d endon
 on Power1#State=1 do SerialSend5 A00101A2 endon
 on Power1#State=0 do SerialSend5 A00100A1 endon
  • Enable the rule (type rule1 1 in the Tasmota console)

Rules for LC WiFi Relay 2x board (2 relays)

  • Add the following rules typing in the console:
Rule1
 on System#Boot do Backlog Baudrate 115200; SerialSend5 72656164790a0d endon
 on Power1#State=1 do SerialSend5 A00101A2 endon
 on Power1#State=0 do SerialSend5 A00100A1 endon
 on Power2#State=1 do SerialSend5 A00201A3 endon
 on Power2#State=0 do SerialSend5 A00200A2 endon
  • Enable the rule (type rule1 1 in the Tasmota console)

Rules for LC WiFi Relay 4x board (4 relays)

  • Add the following rules typing in the console:
Rule1
 on System#Boot do Backlog Baudrate 115200; SerialSend5 72656164790a0d endon
 on Power1#State=1 do SerialSend5 A00101A2 endon
 on Power1#State=0 do SerialSend5 A00100A1 endon
 on Power2#State=1 do SerialSend5 A00201A3 endon
 on Power2#State=0 do SerialSend5 A00200A2 endon
 on Power3#State=1 do SerialSend5 A00301A4 endon
 on Power3#State=0 do SerialSend5 A00300A3 endon
 on Power4#State=1 do SerialSend5 A00401A5 endon
 on Power4#State=0 do SerialSend5 A00400A4 endon
  • Enable the rule (type rule1 1 in the Tasmota console)

Set a static IP for Tasmota device

Say your network address is 192.168.18.0/24 and you picked 201 as the desired static address. Then, execute this in the Tasmota console:

Backlog IPAddress1 192.168.18.201; IPAddress2 192.168.18.1; IPAddress3 255.255.255.0; IPAddress4 192.168.18.1
restart 1

Note: Backlog is used to chain several commands in one line.

Actions from another script

http://192.168.18.178/cm?cmnd=Power2%20On
http://192.168.18.178/cm?cmnd=Power2%20Off
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment