Home Energy Management in 2021.8

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.

image

How do you get that energy tab to show ?

You need to configure it first, in previous betas it was already there:

1 Like

Thanks, found it.

1 Like

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 :wink: 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. :slight_smile:

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. :slight_smile:

Maybe this is needed too…

image

Another note from @balloob: if you use the new energy integration, don’t restart HA in the first 12m of the hour. :slight_smile:

Source

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 ?

1 Like

Thanks @francisp, what a noob misstake from my side…sorry for that!

Either add default_config: to config.yaml, or, if you don’t want to use default values, add energy:

1 Like

ofc you can use this template in the mqtt sensor: MQTT Sensor - Home Assistant

This is not indicated here:

But thank you for sharing.

I see it there:

image

I don’t see it either there, but if I click on edit (to add it) , it appears. Must be a caching issue.

probably, I see it correctly.

So now you found a perfect use case for

{{ as_datetime(0|timestamp_utc).isoformat() }}

:slight_smile:

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).