hacs-hubitat icon indicating copy to clipboard operation
hacs-hubitat copied to clipboard

Energy Entities Don't Work With HA Energy Dashboard

Open fboundy opened this issue 2 years ago • 14 comments

Energy entities are not appearing as Individual Devices on the HA Energy Dashboard. I think this is because the state_class for them is not seto to total as described here

fboundy avatar Oct 10 '22 20:10 fboundy

I am having the same issue. I have a z-wave outlet along with a couple other devices that are reporting a total power usage but can not add it to the energy dash board.

nmatt25 avatar Nov 04 '22 12:11 nmatt25

My workaround is to use Integration on the Power sensor. On 4 Nov 2022 at 12:44 +0000, nmatt25 @.***>, wrote:

I am having the same issue. I have a z-wave outlet along with a couple other devices that are reporting a total power usage but can not add it to the energy dash board. — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

fboundy avatar Nov 05 '22 09:11 fboundy

I can see the power sensor in HA but it will not allow me to use it in the energy dash board due to the state_class not being set correctly

nmatt25 avatar Nov 08 '22 02:11 nmatt25

Hmm… I haven’t looked into the energy dashboard before, but from the docs it sounds like a Hubitat Energy Meter device would use the ‘total’ state class, while a Power Meter would use ‘measurement’. It shouldn’t be too hard to implement.

jason0x43 avatar Nov 08 '22 03:11 jason0x43

Yes, that’s exactly it. Need to be total or total_increasing state_class whereas instantaneous sensors such as Power should have a measurement state_class On 8 Nov 2022 at 03:42 +0000, Jason Cheatham @.***>, wrote:

Hmm… I haven’t looked into the energy dashboard before, but from the docs it sounds like a Hubitat Energy Meter device would use the ‘total’ state class, while a Power Meter would use ‘measurement’. It shouldn’t be too hard to implement. — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

fboundy avatar Nov 08 '22 08:11 fboundy

I added state class attributes to the sensor entities in v0.8.5b1. Let me know if that works.

jason0x43 avatar Jan 17 '23 03:01 jason0x43

Hi - I'm having this problem as well. I checked the version of the hubitat integration in HACS and it's 0.8.4, which seems to be the newest available. Do I need to manually update it somehow?

hokfujow avatar Jan 30 '23 22:01 hokfujow

@hokfujow You’ll need to enable beta versions for the integration in HACS. Open Hubitat’s HACS card, choose “Redownload” from the three-dot menu in the upper right, then enable “Show beta versions”.

jason0x43 avatar Jan 30 '23 23:01 jason0x43

Ah, yes, I did figure this out - thanks! So I did that, and I was able to download the new version. Restarted HA. Reloaded the hubitat integration. Made sure the relevant energy entities (including energy time and last update time) were enabled. Reloaded integration again. Still not seeing the devices available to add in the Energy dashboard individual devices section. Do I need to wait a couple hours for these to register as new entities?

hokfujow avatar Jan 30 '23 23:01 hokfujow

I’m not sure what typical behavior looks like — I haven’t used the energy dashboard myself (no devices reporting energy). It’s possible that data collection will take a bit, or there may be an implementation issue. I’ll look more into it.

Do you see any errors or warnings in the home assistant log?

jason0x43 avatar Jan 30 '23 23:01 jason0x43

Hi Jason - after several hours, no change. I don't see any errors in the log that appear to relate to the hubitat integration. However these devices (energy sensors from hubitat devices) don't seem to appear at all in the logbook or in the Statistics tab of developer tools ,though they do appear on regular dashboards as I mentioned.

Michael

On Mon, Jan 30, 2023 at 6:30 PM Jason Cheatham @.***> wrote:

I’m not sure what typical behavior looks like — I haven’t used the energy dashboard myself (no devices reporting energy). It’s possible that data collection will take a bit, or there may be an implementation issue. I’ll look more into it.

Do you see any errors or warnings in the home assistant log?

— Reply to this email directly, view it on GitHub https://github.com/jason0x43/hacs-hubitat/issues/183#issuecomment-1409518891, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABUXSWOHFAU5ZIJUU2ZRLTWVBFJNANCNFSM6AAAAAARBVHVUU . You are receiving this because you were mentioned.Message ID: @.***>

hokfujow avatar Jan 31 '23 02:01 hokfujow

Just to update you. The hubitat energy entries still don't appear on the Energy Dashboard options. The workaround I've been using is to take the Power sensors passed through by your integration and then integrate them using the Riemann integral helper. So basically creating a new energy sensor by integrating power over time rather than using the device's internal energy accumulator. Presumably this is less accurate, since power is updated at discrete intervals. Those calculated energy sensors do appear in the options for the energy dashboard, so something is missing in the entities coming through from Hubitat.
It's odd because the energy values from hubitat DO appear on regular dashboards as energy sensors - but the energy dashboard apparently requires something specific that isn't there.

hokfujow avatar Feb 01 '23 01:02 hokfujow

I've spent a bit more time working with the Energy Dashboard, so at least I have a vague idea of how it works. 😄

What units are the devices that aren't showing up using? I believe they need to be reporting in kWh to show up in the dashboard.

jason0x43 avatar Apr 08 '23 19:04 jason0x43

Yes - and they need to have state class of total or total_increasing… On 8 Apr 2023 at 20:46 +0100, Jason Cheatham @.***>, wrote:

I've spent a bit more time working with the Energy Dashboard, so at least I have a vague idea of how it works. 😄 What units are the devices that aren't showing up using? I believe they need to be reporting in kWh to show up in the dashboard. — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

fboundy avatar Apr 09 '23 09:04 fboundy