I am trying to run a script from within a scene.
I have created a script that turns off all the lights in the house, now i want to run that from within a scene.
I want to run it from a scene because i want to use the home assistant complication on my apple watch, and it only seems to display the scenes i have created, not the scripts. Not that i would want to include my scripts in there because it would become a mess.
For the given example it’s not that useful, but i also want to create a scene where the following happens.
Let’s say, in case of a fire or a burglary i want to:
Turn on all the lights in the house at full white brightness
unlock every door to allow escape routes.
Open all the blinds, … that are covering possible escape routes
Disable all hardware/software buttons (in case of a detected burglary, they can’t turn off the lights).
Basically this toggles a switch or something so that every input is ignored.
Send out notifications
Turn off any power plugs that are potential fire hazards, like the one on my 3dprinter
Trigger my NAS to do an immediate shutdown. (not very wise but maybe my data can be saved by rescuing the hardware).
Trigger a siren so everybody wakes up.
do other stuff that i didn’t even consider yet.
And i want to be able to trigger that from my apple watch, because it is basically always on my person and super easy to trigger.
Or in case of a fire hazard, it needs to be triggered by a smoke detector
I think the scenarios are a bit different: firing from a smoke detector allows you to run a script however you want, while the other scenario is scene-centric because you need to fire it from a complication on your watch.
Regardless, one way you could have your cake and eat it too the way you want would be to use a template device as one of the devices in your scene and just set up that template device to do the things you want (or run a script or whatever). Since the scene is just recording what the current state of a device is then you just include the new template device in your group and should achieve whatever result you want.
So, scene “Panic” might just have a single device, the template device “switch.panic” that, when on, does your list of automations and, when off, reverses it.