Skip to content

Instantly share code, notes, and snippets.

@carnei-ro
Created June 21, 2023 13:39
Show Gist options
  • Save carnei-ro/02fe747f32b809a188b7ba97e2e783de to your computer and use it in GitHub Desktop.
Save carnei-ro/02fe747f32b809a188b7ba97e2e783de to your computer and use it in GitHub Desktop.
Sonoff re5v1c Tasmota Door Sensor
TelePeriod 30
SwitchTopic "My_Door_Sensor"
SetOption114 ON
SwitchMode2 1
Rule1
On system#boot DO publish2 homeassistant/binary_sensor/%topic%/config {"unique_id":"%topic%","expire_after":"1800","device_class":"door","name":"My Door Sensor","state_topic":"tele/%topic%/SENSOR","value_template":"{{value_json.Switch2}}"} ENDON
Rule1 1
Rule2
On Switch2#state=1 DO publish tele/%topic%/SENSOR {"Time":"%timestamp%","Switch":"ON"} ENDON
On Switch2#state=0 DO publish tele/%topic%/SENSOR {"Time":"%timestamp%","Switch":"OFF"} ENDON
Rule2 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment