Let script pause for few minutes
Posted: Sunday 08 January 2023 16:01
Trying to build a script which calculates electricity costs based on variable pricing (per hour).
I have a script running which updates a domoticz device with the current price (updates every first minute of the hour). Because the price is updated at minute 0 of the hour, and the electricity usage is only available short after the hour I have a timing challenge.
My thoughts: Create as script which retreives the current price at minute 58 of the hour, pause for 5 minutes and then collect the usage of the past hour and calculate the costs.
In concept this looks ok to me, but how to have a dz-script waiting for 5 minutes? I could build this in bash, but would like to try putting it in Domoticz itself.
Thanks,
Jeroen
I have a script running which updates a domoticz device with the current price (updates every first minute of the hour). Because the price is updated at minute 0 of the hour, and the electricity usage is only available short after the hour I have a timing challenge.
My thoughts: Create as script which retreives the current price at minute 58 of the hour, pause for 5 minutes and then collect the usage of the past hour and calculate the costs.
In concept this looks ok to me, but how to have a dz-script waiting for 5 minutes? I could build this in bash, but would like to try putting it in Domoticz itself.
Thanks,
Jeroen