Home Energy Management in 2021.8

If the time of initialization is unknown and the meter will never reset, set to UNIX epoch 0: homeassistant.util.dt.utc_from_timestamp(0)

{{ 0 | timestamp_utc }} is 1970-01-01 00:00:00, this should work too.

I stand corrected: as @balloob said, customize comes after internal conversion to ISO8601 has already been made, so this works: {{ as_datetime(0|timestamp_utc).isoformat() }}1970-01-01T00:00:00

UPDATE: the above works for the scope of last_reset, but in order to be offset-aware, timezone has to be included, so in case you need it:

{{ as_datetime(as_datetime(0|timestamp_utc)|string+‘Z’).isoformat() }}
Output: 1970-01-01T00:00:00+00:00

1 Like