Thanks, found it.
yes, but you do know that you can not use templates in core Customize? you’d only be able to use this on an integration that supports attribute_templates
.
or use custom-ui of course which would require translating that to JS, and I havent managed to do that yet… asked for help on that subject in the Epic time conversion thread
btw this is what Python does: self._attr_last_reset = dt.utc_from_timestamp(0)
, check the PR Martin is working on to fix the ZwaveJS (which adds last_reset to all sensors now) and limits that to energy sensors for the time being
cut is short for now, if your entities/integrations dont set the necessary attributes, use
homeassistant:
customize_glob:
sensor.*_totaal: &energy
last_reset: '1970-01-01T00:00:00+00:00'
device_class: energy
state_class: measurement
sensor.*_actueel: &power
device_class: power
state_class: measurement
use the yaml anchors *energy and *power on individual entities
I didn’t know because I don’t use it, but I suspected it.
It was just an exercise, I was looking for a direct filter to convert to ISO 8601, found out there isn’t so I wasted 15 minutes to come out with that. It’s the way I’m learning HA, small challenges and a lot of reading of posts of experts like you and others.
This produces an ISO 8601 timestamp? Looks like a simple UTC datetime. But I’m not a python dev.
Maybe this is needed too…
Another note from @balloob: if you use the new energy integration, don’t restart HA in the first 12m of the hour.
Are there any plans to have a option for real-time watts
I use Shelly’s and use the power entities
Mainly to educate to kids on high power usage.
Here a pic or the real time card I use
Love the new energy tab
I cannot find that option on my Home Assistant (2021.8.0b10) Any idea what could be wrong, do I need to add something to the config.yaml?
I have tried to clear browser cache in Chome and also tried IE Edge. When I go to Link to Energy Configuration – My Home Assistant I see the following message:
I think you don’t have default_config: in your configuration.yaml ?
Either add default_config:
to config.yaml, or, if you don’t want to use default values, add energy:
This is not indicated here:
But thank you for sharing.
I see it there:
I don’t see it either there, but if I click on edit (to add it) , it appears. Must be a caching issue.
So now you found a perfect use case for
{{ as_datetime(0|timestamp_utc).isoformat() }}
Be advised that the result of this template lacks a timezone:
{{ as_datetime(0|timestamp_utc).isoformat() }}
1970-01-01T00:00:00
Given that it’s a ‘naive’ datetime, it isn’t suitable for some applications (such as in time calculations with ‘aware’ datetimes, or in a timestamp sensor).