Though I am a longtime user of HA and Hue I only now run into the option of flash: short and flash: long… sorry for that.
I’ve found this looking for a way to have my lights flash until acknowledged. The flash: long does flash the lights 15 time, but this obviously isn’t long enough.
I started writing a few scripts and was hoping to find some sort of attributes or state ‘flashing’ on the lights, but unfortunatly the lights show a state: off …?
so, how could one have the lights flashing until another event takes place? Other than timing the 15 flashes and have 2 scripts call each other in a sequence of just about that time, and then check for that script being ‘on’?
That isn’t too hard. Create a binary sensor or input binary that holds a true or false Boolean value. Than create an automation that toggles a light on or off every few seconds. Use the ‘toggle’ service and not ‘on’ or ‘off’.
Yeah, like metbril says, just insert a condition (in either or both scripts) to check for your acknowledgement bit (set at same time first script called) and required to be on for scripts to run
Hmmm ! I see what you did there.
Trading the input boolean for another automation.
It doesn’t require a restart to implement (yes, I have voted for Taras’s avoiding restart feature request )
Though if the boolean turning on was the trigger to call the first script and it being on is the condition that keeps them running then you could use this whereever and also in testing.
The overall number of ‘items/entities’ stays the same - so I suppose it’s down to whatever the user prefers, still, your solution is very neat
yes, thanks.
but, (there’s always a but…) my other challenge how is how to pass in a variable to the small subscript from an external trigger.
If I don’t want to hardcode the entity_id, and I don’t, I need a way to pass the variable on the lights_flash sub-script, in a way the lights_flash_on script can use that (remember I use that as main script for the on/off template later on).
But like your recent post about “minutes” cant you pass the entity id (from the trigger, as a parameter) to the script and use that in a service template, and then again in the call to the second script ?
Not used them myself but …
not sure, hence my But… Don’t think I’ve ever seen scripts inherit variables, so would probably have to redefine them in the first script… have to rethink this …
If a problem, just write it to an input text and just keep calling it from there.
I’m sure Petro, Taras or Phil will come up with a more elegant solution though.