I’m wondering if someone can help me with a simple Automation based off a button press (both physical and one on the home screen).
I have a Aqara Hub with button. I have a working script to turn everything on and a second working script to turn everything off. I’d like to press the button and if everything is off, turn it on. If everything is on, turn it off. How can I combine both of my scripts to accomplish this?
Here’s the Off script, the On is the same formatting.
alias: Office All Off
sequence:
- type: turn_off
device_id: afb0318bf05da14778a86d604b7cd3a9
entity_id: switch.console_speakers
domain: switch
- type: turn_off
device_id: 3360bdb8f1fb83e8c0a34946904d0ad2
entity_id: switch.office_strip_lights
domain: switch
- type: turn_off
device_id: 8b83580613ce478a7e3c321a54598e00
entity_id: switch.office_console_screen_1
domain: switch
- type: turn_off
device_id: b97f066c33a66a42140f81a8976b687c
entity_id: switch.office_console_monitor_desk
domain: switch
- type: turn_off
device_id: dde4c7f861de6b17bc1e61f0146ccf54
entity_id: switch.radar_plug
domain: switch
mode: single
Thank you very much.