Dear community,
I was following this discussion Sonoff POW R2 - how to know how I consumed in a day or month and then realized, that as of Version core-2022.4.6, this can be done much more easy and within the UI.
I have a fridge in the basement [1] and a machine to dry the air [2]. Each is powered via a Sonoff Pow2.
So, in HomeAssistant, I added two “Helpers”. One is converting the “Power” to kWh, the other is the Metering Utility, which I wanted to add to the Energy Dashboard.
For the fridge (“Gefrierschrank”) it works as expected, for the drying machine, there are values available, but I am not able to add the sensor to the Energy Dashboard. How do I trouble shoot this?
Any help is very much appreciated.
there is something I have learned with HA… if u have your devices working, and HA releases a new update promising an easier way to integrate your devices, ignore it! keep your devices working the way you know … (unless they became deprecated)…
Mine is working … and I will keep it that way
1 Like
I think you might need to wait for an hour or two before long-term statistics are generated for your entity, thus making it usable with the energy dashboard.
Yes, I know, but the sensor is still not available. How can I verify, if the sensor was set up correctly?
Check it’s state attributes in developer tools.
It should probably have device_class: energy
and state_class: total_increasing
or state_class: total
.
Hi @ondras12345,
thank you for your input. Here are my 4 sensors.
This two sensors are working as expected and both can be added to the Energy Dashboard.
state_class: total
source: sensor.sonoff_100142aa45_power
unit_of_measurement: Wh
device_class: energy
icon: mdi:chart-histogram
friendly_name: Sonoff Gefrierschrank Energy
state_class: total_increasing
source: sensor.sonoff_gefrierschrank_energy
status: collecting
last_period: ‘0’
meter_period: monthly
cron pattern: 0 0 2 * *
last_reset: ‘2022-04-23T20:59:40.673306+00:00’
unit_of_measurement: Wh
device_class: energy
icon: mdi:counter
friendly_name: Sonoff Gefrierschrank Energy2
This Sensor can be added to the Energy Dashboard.
state_class: total
source: sensor.sonoff_100142a7d7_power
unit_of_measurement: kWh
device_class: energy
icon: mdi:chart-histogram
friendly_name: Sonoff Bautrockner Energy
This sensor can not be added to the Energy Dashboard. Why? All 4 sensors have been created using the helper functionality.
state_class: total_increasing
source: sensor.sonoff_bautrockner_energy
status: collecting
last_period: ‘0’
meter_period: monthly
cron pattern: 0 0 1 * *
last_reset: ‘2022-04-24T08:58:40.097935+00:00’
unit_of_measurement: kWh
device_class: energy
icon: mdi:counter
friendly_name: Sonoff Bautrockner Energy2
What does this UI show?
I’d also recommend that you refresh the webpage with ctrl+F5 to rule out the possibility that your issue is caused by caching.
@ondras12345 Thank you very much for your hint to that statistics-page! (I never used that so far.)
There was a message about a wrong unit. I then realised that I took the wrong sensor as an input. (current instead of power…)
I now fixed it - et voilà - I was able to add the utility meter to the energy dashboard.
Your help is very much appreciated!