Take an action only once if a certain threshold has been reached
Posted: Saturday 30 May 2020 18:57
As a newbie I cannot figure this one out so any tips/ideas are more than welcome…
I am monitoring my Solar panel production and I would like to be notified for every step of 10 kWh my solar production increases.
Since I am planning to be informed with a Telegram message this should only happen once with every “block of 10” increase.
I am checking my Solar production (among other things) every 10 minutes with a DzVents script.
I suppose I need to keep variables with their "current" value in between multiple runs of the dzVents script, i.e. var10, var20, var30,… are initialised at 0 at the start of a new day, and when the production reaches 10 kWh var10 = 1 and a message “10 kWh reached” will be send and will, that day, not be send again. Once production reaches 20 kWh var20 = 1, a message “20 kWh reached” will be send and will, that day, not be send again, etc…. I guess you all get the idea…
I guess only 1 variable could suffice as well, where the variable value evolves from 1 to 10, to 20, etc and the variable value is the message to be send.
Any suggestions, ideas on how to tackle this?
Thanks!
I am monitoring my Solar panel production and I would like to be notified for every step of 10 kWh my solar production increases.
Since I am planning to be informed with a Telegram message this should only happen once with every “block of 10” increase.
I am checking my Solar production (among other things) every 10 minutes with a DzVents script.
I suppose I need to keep variables with their "current" value in between multiple runs of the dzVents script, i.e. var10, var20, var30,… are initialised at 0 at the start of a new day, and when the production reaches 10 kWh var10 = 1 and a message “10 kWh reached” will be send and will, that day, not be send again. Once production reaches 20 kWh var20 = 1, a message “20 kWh reached” will be send and will, that day, not be send again, etc…. I guess you all get the idea…
I guess only 1 variable could suffice as well, where the variable value evolves from 1 to 10, to 20, etc and the variable value is the message to be send.
Any suggestions, ideas on how to tackle this?
Thanks!