I am setting the behaviour for a magnetic sensor to check if a door is closed. GPIO04 is set as input.
This is my code:
Code: Select all
on System#Boot do
Monitor GPIO,4
endon
on GPIO#4 do
Publish,home/garage/maindoor,%eventvalue%
endon
on MQTT#Connected do
Publish,home/garage/maindoor,[GPIO#4]
endon
Regards,