jason0x43 / hacs-hubitat

A Hubitat integration for Home Assistant
MIT License
191 stars 46 forks source link

Energy Entities Don't Work With HA Energy Dashboard #183

Open fboundy opened 1 year ago

fboundy commented 1 year ago

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

nmatt25 commented 1 year ago

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.

fboundy commented 1 year ago

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: @.***>

nmatt25 commented 1 year ago

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

jason0x43 commented 1 year ago

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.

fboundy commented 1 year ago

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: @.***>

jason0x43 commented 1 year ago

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

hokfujow commented 1 year ago

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?

jason0x43 commented 1 year ago

@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”.

hokfujow commented 1 year ago

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?

jason0x43 commented 1 year ago

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?

hokfujow commented 1 year ago

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 commented 1 year ago

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.

jason0x43 commented 1 year ago

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.

fboundy commented 1 year ago

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: @.***>