I have, in preparation to halloween, created a switch that runs a bash script on my magicmirror.
The script takes some time to complete.
How do I go about checking when it’s done?
The plan is
lights go out
script runs
lights turn on again.
For now I’ve just set in a delay, but it would be better to know when the script completes.
The command line doesn’t return until it’s done.
I just need to figure out how to get this done in node-red.
My problem is that I want to return the lights to their previous state, ie. if they were off, they remain off etc.
and if they were on, they should return to the brightness they were at.
I’ve done some subflows to handle this, but they work with the msg, and the event node doesn’t receive a message, it is a start node.
I can’t help with node red, but in homeassistant you can use the scene.create service to save the state of the lights, then apply the scene at the end to return them to the saved state.