I tried to add the data to the new dashboard but the entities did not show up. I clicked the helpfully provided “Why is my entity not in this list”-link and indeed, I didn’t set the required attributes in my configuration. But now I have and they still don’t show up, this is my configuration for the energy sensors:
[last_reset] is an invalid option for [sensor.mqtt]
If I use (no string):
last_reset_topic: 1970-01-01T00:00:00+00:00
I get this error:
Invalid config for [sensor.mqtt]: Single-level wildcard must occupy an entire level of the filter for dictionary value @ data['last_reset_topic']. Got datetime.datetime(1970, 1, 1, 0, 0, tzinfo=datetime.timezone.utc). (See /config/configuration.yaml, line 32). Please check the docs at https://www.home-assistant.io/integrations/mqtt
What does this mean? How does this answer my question? Should I put this snippet somewhere in my config? I’m not using legacy configuration right? I followed all instruction except for the fact that I can’t add a last_used_topic set to unix epoch 0 because I get errors. Is that really needed?
It updates all your sensors with _energy in the entity_id to have those three listed attributes. Which are required for an energy sensor to be used in the new Energy Management system.
You were shown exactly how to get working energy sensors.
You should put it exactly where shown in your config. Under homeassistant: in your configuration.yaml file.
Ok, thank you. At first I didn’t realize that the light gray part was someting from another topic from someone with a similar problem so I thought you just reposted a question here.
The snippet you posted seemed to suggest I was using legacy mode? I don’t want to use legacy modes, so if you could point me to the modern way of doing this… . Moreover, I want to also use the “current energy consumption” value and it says here: https://developers.home-assistant.io/docs/core/entity/sensor/#properties that I then have to use device_class: power (and for the cumulative value device_class: energy, so, I could do what you suggest, but I’d really like to understand why my solution does not work, since I followed all the instructions.
I’ll test your solution now and report back.
Edit: I don’t have the line homeassistant: in my configuration, so do I add it under default_config:? Two spaces indented? When I do that, I still don’t have the sensor show up sadly.
I’m pretty sure by now it is related to the last_reset value, my TP_link hs110 shows up in the list. It probably has this value set somewhere (although it does not show up in the attributes available in developers tools).
Perhaps it is good to mention that my mqtt sensors do not have a “unique_id”, could that have anything to do with it?
Related, is state_class: measurement settable for rest sensors yet?
Seeing this error:
Invalid config for [sensor.rest]: [state_class] is an invalid option for [sensor.rest]. Check: sensor.rest->state_class. (See /config/configuration.yaml, line 582). Please check the docs at https://www.home-assistant.io/integrations/rest
I have a myenergi harvi to monitor the Grid CT and had hoped to use it for the new Energy dashboard
Ok, sorry for being such a noob but the first part of my config now looks like this:
# Configure a default setup of Home Assistant (frontend, api, etc)
default_config:
customize_glob:
sensor.*_energy:
last_reset: '1970-01-01T00:00:00+00:00'
device_class: energy
state_class: measurement
And I get the error:
Setup failed for customize_glob: Integration not found.
Edti: Ah, so maybe in the future it will work when they add support for “last_reset”
YEEESSS IT WORKS. Thank you. Indeed I already figured the last part out and changed the sensor name to end in “energy”. And indeed, I needed to add that homeassistant:
Indeed, I can add my gas usage when I alter the unit from m3 to kWh… I hope they start supporting m3 gas as well at some point! Actually gas is more relevant to me, I don’t see myself really using less electricity but gas I can see way to be smarter about it and adding isolation etc… Perhaps compute how much my house leaks energy by looking at gas usage as a function of outside temperature…
Some nice plot from peak usage etc (unit kW) would also be cool. But what we got is already really cool and there is a lot of potential, I’m really looking forward to new features in the future!
Note that even though the commented templates in my anchor are perfectly fine templates, they dont work in the mqtt config. No errors, simply no attribute is set for last_reset.