I have a template sensor create which calculates the age of a device in days (which is used in another sensor). Since summer time the value is wrong from midnight to 1:00 o’clock.
How would I get correct values for summer time and for normal time? - Just changing the +01:00
to +02:00
would work, but needs to be adjusted again when normal time starts.
That’s what I tried:
# age: >-
# {{ (now() - as_datetime('2022-12-06 00:00:00+01:00')).days }}
age: >-
{{ (now() - (as_datetime('2022-12-06 00:00:00') | as_local)).days }}