I have a zwave wall switch and a door switch connected to a MQTT sensor. I want to trigger a “turn off all lights and music” event when I leave the home, but to ensure that the kids dont press this button all the time killing the lights.
Option 1: When the door is open and the button is pressed the script will run
Option 2: When the door is opened and the button is pressed between 2 and 5 seconds after, the script will run
The MQTT sensor is named “sensor.dr_entre” and can be one of two states “Open” and “Closed”.
The wall switch is named is controlled with the following:
- alias: ENTRE - NODE 4
trigger:
platform: state
entity_id: switch.logic_soft_zhc5010_wall_switch_switch_2_0_5
action:
service: shell_command.wallswitch_entre_4
Any ideas?
Best regards,
Tonkin