I’m in the UK and have an Economy 7 meter which gives me cheaper electricity for 7 hours a night, split into two segments. The meter is on an internal time clock so it has no concept of British Summer Time. I have looked at clamp sensors to detect current coming out of the economy 7 power line, but for what I want to achieve the costs are quite steep.
I reverted to doing a time based automation to set an input.boolean to true or false depending on the UTC/GMT clock, but I’m having problems determining the value_template to use. My reading has confused me as it seems that some UTC sensors were depreciated.
This is further complicated by the time comparison being aware of time crossing midnight, (however, I believe that would follow time zone and alter to BST rather than being purely UTC) but I’m not sure whether a value_template would be aware of this. - (I’m also reading conflicting things as to whether all time comparisons in HA for automations are in UTC or follow “summer time” adjustments, so I’m not really sure of what’s going on.)
My timezone information is…
{{ utcnow().tzinfo }} - UTC
{{ now().tzinfo }} - Europe/London
{{ now().astimezone().tzinfo }} - GMT
Let’s say I wanted to set up a value template to detect if the time is between 22:30 and 2:30 in GMT … what would I write please.
Edit - I believe that all internal calculations are in UTC, but for the purpose of automation, HA converts to the time zone, (GMT) and then applies daylight saving time (DST) which in my case is BST… so if my understanding is correct and I used the time comparison then it would follow BST … so I need to somehow hook into UTC/GMT but that still leaves the question of crossing midnight using a value template