I’ve done all customisations with my energy sensors - i have 3 sensors for each tariff zone.
All of them (t1, t2, t3) have similar attributes and states different data in kWh
unit_of_measurement: kWh
friendly_name: T1
last_reset: '1970-01-01T00:00:00+00:00'
device_class: energy
state_class: measurement
I’ve added all of them to Energy section, but still have no data on graph.
What’s wrong ?
Upd. In few hours it started to show some data. But it’s unclear how it works, and also is there any way to calibrate this data - to put my starting values.
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.
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
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).