Skip to content

Instantly share code, notes, and snippets.

@jlblancoc
Last active February 21, 2025 05:19
Show Gist options
  • 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
@coachadvising42
Copy link

It's my pleasure to visit your site. It is very unique and helpful. I would say that the process can be overwhelming for many students. write-my-term-paper not just about completing an assignment but showcasing understanding and research skills. there are services available that help ease the stress by offering professional assistance. For more info visit here https://academized.com/write-my-term-paper These platforms connect students with experienced writers who craft well-researched, high-quality papers. It’s a great way to ensure you meet deadlines, achieve good grades, and still have time to focus on other important aspects of your education.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment