Syntax dates in scripts
Posted: Monday 10 February 2025 21:29
Hello,
I hope someone can and will help me.
I have a script I use to calculate my energy costs. That works. But.....
Energy costs change annually, so to compare costs per year, I actually need to add a date line to that.
I see in that script: if (domoticz.time == ‘Between 23:00 and 07:00’), but does that work the same way with a date?
So something like: if (domoticz.date == ‘Between 01-01-2023 and 01-01-2024’) etc....
Is that the right syntax, or does that work differently. It is not yet clear to me from the wiki how to do that.
Ultimately, I want to adjust the rates annually so that I can do clean comparisons over years.
Thanks in advance for answers.
Regards, Henny
I hope someone can and will help me.
I have a script I use to calculate my energy costs. That works. But.....
Energy costs change annually, so to compare costs per year, I actually need to add a date line to that.
I see in that script: if (domoticz.time == ‘Between 23:00 and 07:00’), but does that work the same way with a date?
So something like: if (domoticz.date == ‘Between 01-01-2023 and 01-01-2024’) etc....
Is that the right syntax, or does that work differently. It is not yet clear to me from the wiki how to do that.
Ultimately, I want to adjust the rates annually so that I can do clean comparisons over years.
Thanks in advance for answers.
Regards, Henny