My goal is :
Turn on power on external USB disk (using aqara zigbee)
Run a backup script
Turn off power on external USB disk
My issue: Disk power works, then the script is running for 10 sec (not finished) and the power go down.
I don’t know why the automation is not waiting the end of the script before the power down.
The automation doesn’t recognize the script is still running. If you know how long the backup takes you could add a delay so it waits before turning off. there is another way the script could tell HA it has run by say writing to a sensor or using MQTT but probably just as easy to use a delay.
it can be but a simple delay will suffice. I certainly wouldn’t be adding node-red just for this. The backup script can notify HA if you want to go to that trouble but a delay will do what he wants
It does not by itself. HA will wait up to 10 sec for the command to complete, then fail in timeout.
Obviously the command itself can (and must in this case) “fork” by using, e.g., nohup.
Thanks for replies.
The backup times is not fix so I can’t put a delay value.
I never test nodered so I don’t know how to do that.
Maybe a sensor but how ?
Yep, heard something about a 10 sec timeout and obviously this makes sense to ensure that the process is not blocking but the problem is obviously that there’s no tracking of the child