How to turn off PIR triggered automation with a button press

I have a button in my bedroom to turn everything off at night. Now I tired in several ways to turn of an PIR sensor as well, so when somebody uses the bathroom or the cats takes a stroll, not all the light goes on again.

The YAML of the PIR sensor looks like this:

type: motion
platform: device
device_id: bad0b5656645f4638acf2f7613973298
entity_id: binary_sensor.bewegungsmelder_esszimmer_occupancy
domain: binary_sensor

and the one of the light like this:

type: turn_on
device_id: ce40a20c574903729d5373e30c310284
entity_id: switch.licht_esszimmer
domain: switch

so what would be the best practice to turn off the automation “Licht Esszimmer ON” and reset it in the morning?

Thanks for help, and sorry I’m still pretty new in the HA ecosystem.

There isn’t necessarily a best practice, it just depends on what you want.

You could add a condition to the existing automation. The condition could specify certain times the automation should or shouldn’t work or could watch an input_boolean that you set with the button.

You could also literally turn the automation off with a service call when the button is pressed, and back on at a set time in the morning.

What would be the procedure to turn off the automation?

As I said, with a service call. Go to Developer ToolsServices and type “automation” to see what you can do.

Thanks a lot!!! I thought I went this path, but I must have made an mistake. Now it seams to work:-)

1 Like