Tasmota - johnosbb/Automation GitHub Wiki
It appears that everytime you configure the module it reverts to a default behaviour overwriting your rules.
192.168.
SwitchMode 15
Decouple Switch from its power output and it will instead send MQTT messages in the following format:
- MQT: tele/tasmota/SENSOR = {"Time":"2021-01-01T00:00:00","Switch1":"OFF"}
- MQT: tele/tasmota/SENSOR = {"Time":"2021-01-01T00:00:01","Switch1":"ON"}
If a switch input is used as a sensor input with the intention that a different device should respond then the SwitchTopic instruction should be used to set the topic to the device that should be changed. This disables the link from all the switches to their associated relays on the same device. So if switch1 on a device called sonoff should drive another device set with a name say loungelight. Then use cmnd/sonoff/SwitchTopic with payload loungelight. The Switch1 action will then publish cmnd/loungelight/POWER1ON or OFF.
- IPAddress1 192.168.1.185
- IPAddress2 192.168.1.254
- IPAddress3 255.255.255.0
- IPAddress4 8.8.8.8
- Toggle mode, the device sends a toggle on each change of state
stat/SENSORS_FRONT/SWITCH2T {"TRIG":"TOGGLE"}
- Set switch to follow mode (0 = OFF, 1 = ON) ** At the time when the circuit is closed, Tasmota will send ON and opening the circuit sends OFF. Configuring this and then triggering the switch results in three messages if power and switching are coupled
- stat/tasmota_532099/PIR1 OFF
- stat/tasmota_532099/POWER2 ON
- stat/tasmota_532099/RESULT {"POWER2":"ON"}
SetOption114 1
When SetOption114 1 all switches are detached from their respective relays and will send MQTT messages instead in the form of {"Switch":{"Action":""}}.
stat/SENSORS_FRONT/SWITCH2 {"STATE":"OFF"}
- Inverted follow
- SwitchTopic 0 controls the power state directly.
- SwitchTopic 1 sends an MQTT message to the device topic. This sets the state of the devices power accordingly.
- SwitchTopic sends an MQTT message command to the custom topic. This does not change the state of the devices power.
With switchtopic 1 we will see two additional commands
cmnd/tasmota_532099/POWER2 Off cmnd/tasmota_532099/POWER2 ON
With switchtopic lightcontrol, we will see two messages
cmnd/lighcontrol/POWER2 Off cmnd/lighcontrol/POWER2 On
But the associated relay or Led on the board will not light.
- status 0
- Backlog Rule1; Rule2; Rule3
For the Front Door
14:38:46.198 CMD: Backlog Rule1; Rule2; Rule3
14:38:46.277 MQT: stat/SENSORS_FRONT/RESULT = {"Rule1":{"State":"ON","Once":"OFF","StopOnError":"OFF","Length":128,"Free":383,"Rules":"on Switch3#state=1 do publish stat/%topic%/LANDING_PIR ON endon on Switch3#state=0 do Publish stat/%topic%/LANDING_PIR OFF endon"}}
14:38:46.507 MQT: stat/SENSORS_FRONT/RESULT = {"Rule2":{"State":"ON","Once":"OFF","StopOnError":"OFF","Length":132,"Free":379,"Rules":"on Switch2#state=1 do publish stat/%topic%/PIR_FRONTDOOR ON endon on Switch2#state=0 do Publish stat/%topic%/PIR_FRONTDOOR OFF endon"}}
14:38:46.757 MQT: stat/SENSORS_FRONT/RESULT = {"Rule3":{"State":"ON","Once":"OFF","StopOnError":"OFF","Length":122,"Free":389,"Rules":"on Switch1#state=1 do publish stat/%topic%/HALL_PIR ON endon on Switch1#state=0 do Publish stat/%topic%/HALL_PIR OFF endon"}}
Power1 1
To Turn it Off USe
Power1 0
We can also use this to turn it off or On directly from the Console
cmnd/wemos_532099/POWER1 Off
cmnd/wemos_532099/POWER1 On
The LED is connected to D4 GPIO2, Set this to relay 2
cmnd/wemos_532099/POWER2 On
cmnd/wemos_532099/POWER2 Off
- TelePeriod 0 --- disable telemetry messages, disables the periodic tele/TOPIC_NAME/STATE output which can often trigger PIRs and Dopler Radar detectors
- SwitchMode1 1
- SwitchTopic 0
- Rule1 on Switch1#state=1 do publish stat/%topic%/LANDING_PIR ON endon on Switch1#state=0 do Publish stat/%topic%/LANDING_PIR OFF endon
- Rule1 1
- Rule2 on Switch2#state=1 do publish stat/%topic%/PIR2 ON endon on Switch2#state=0 do Publish stat/%topic%/PIR2 OFF endon
- Rule2 1
- Rule3 on Switch3#state=1 do publish stat/%topic%/HALL_PIR ON endon on Switch3#state=0 do Publish stat/%topic%/HALL_PIR OFF endon
- Rule3 1
This will result in a message "stat/SENSORS_FRONT/LANDING_PIR OFF" being sent
- Rule1 on Switch1#state=1 do publish stat/%topic%/FRONT_GATE_PIR ON endon on Switch1#state=0 do Publish stat/%topic%/FRONT_GATE_PIR OFF endon
- Rule1 1
- Send an MQTT message: cmnd/SENSORS_PATIO/POWER1 On