Skip to content
This repository has been archived by the owner on Jul 12, 2023. It is now read-only.

HA Energy Dashboard No Longer Displaying Duke Electric Usage #148

Closed
BrettEBowman opened this issue Nov 5, 2022 · 8 comments
Closed

HA Energy Dashboard No Longer Displaying Duke Electric Usage #148

BrettEBowman opened this issue Nov 5, 2022 · 8 comments

Comments

@BrettEBowman
Copy link

Version of the custom_component

When I look at a device, the about says it is v1.0.0, but HACS shows the version as 0.1.2.

Configuration

It is connected to my account and has been working fine for quite a while.

Describe the bug

I noticed a couple of days ago that my energy usage was no longer being reported in the HA tab.

I think that the timing may have correlated with my upgrade to HA 2022.11.0.

It appears to me from the debug logging (see below) that it is receiving data from the Duke service. So I'm wondering if something about the interface to HA was changed in 2022.11.0 which is causing this integration to not properly pass the data to HA.

Debug log

2022-11-05 15:36:45.097 DEBUG (MainThread) [pyduke_energy.realtime] Socket readable, calling loop_read()
2022-11-05 15:36:45.098 DEBUG (MainThread) [pyduke_energy.realtime] Received PUBLISH (d0, q0, r0, m0), 'DESH/P210400605/out/sm/1/live', ... (129 bytes)
2022-11-05 15:36:48.100 DEBUG (MainThread) [pyduke_energy.realtime] Socket readable, calling loop_read()
2022-11-05 15:36:48.102 DEBUG (MainThread) [pyduke_energy.realtime] Received PUBLISH (d0, q0, r0, m0), 'DESH/P210400605/out/sm/1/live', ... (129 bytes)
2022-11-05 15:36:51.096 DEBUG (MainThread) [pyduke_energy.realtime] Socket readable, calling loop_read()
2022-11-05 15:36:51.097 DEBUG (MainThread) [pyduke_energy.realtime] Received PUBLISH (d0, q0, r0, m0), 'DESH/P210400605/out/sm/1/live', ... (129 bytes)
2022-11-05 15:36:54.112 DEBUG (MainThread) [pyduke_energy.realtime] Socket readable, calling loop_read()
2022-11-05 15:36:54.113 DEBUG (MainThread) [pyduke_energy.realtime] Received PUBLISH (d0, q0, r0, m0), 'DESH/P210400605/out/sm/1/live', ... (129 bytes)
2022-11-05 15:36:56.084 DEBUG (MainThread) [pyduke_energy.realtime] Sending PINGREQ
2022-11-05 15:36:56.085 DEBUG (MainThread) [pyduke_energy.realtime] Watching socket for writability.
2022-11-05 15:36:56.086 DEBUG (MainThread) [pyduke_energy.realtime] Socket is writable, calling loop_write
2022-11-05 15:36:56.087 DEBUG (MainThread) [pyduke_energy.realtime] Stop watching socket for writability.
2022-11-05 15:36:56.116 DEBUG (MainThread) [pyduke_energy.realtime] Socket readable, calling loop_read()
2022-11-05 15:36:56.117 DEBUG (MainThread) [pyduke_energy.realtime] Received PINGRESP
2022-11-05 15:36:57.096 DEBUG (MainThread) [pyduke_energy.realtime] Socket readable, calling loop_read()
2022-11-05 15:36:57.098 DEBUG (MainThread) [pyduke_energy.realtime] Received PUBLISH (d0, q0, r0, m0), 'DESH/P210400605/out/sm/1/live', ... (129 bytes)
2022-11-05 15:37:00.168 DEBUG (MainThread) [pyduke_energy.realtime] Socket readable, calling loop_read()
2022-11-05 15:37:00.169 DEBUG (MainThread) [pyduke_energy.realtime] Received PUBLISH (d0, q0, r0, m0), 'DESH/P210400605/out/sm/1/live', ... (129 bytes)
2022-11-05 15:37:03.100 DEBUG (MainThread) [pyduke_energy.realtime] Socket readable, calling loop_read()
2022-11-05 15:37:03.101 DEBUG (MainThread) [pyduke_energy.realtime] Received PUBLISH (d0, q0, r0, m0), 'DESH/P210400605/out/sm/1/live', ... (129 bytes)
2022-11-05 15:37:06.096 DEBUG (MainThread) [pyduke_energy.realtime] Socket readable, calling loop_read()
2022-11-05 15:37:06.097 DEBUG (MainThread) [pyduke_energy.realtime] Received PUBLISH (d0, q0, r0, m0), 'DESH/P210400605/out/sm/1/live', ... (129 bytes)
2022-11-05 15:37:09.096 DEBUG (MainThread) [pyduke_energy.realtime] Socket readable, calling loop_read()
2022-11-05 15:37:09.097 DEBUG (MainThread) [pyduke_energy.realtime] Received PUBLISH (d0, q0, r0, m0), 'DESH/P210400605/out/sm/1/live', ... (129 bytes)
2022-11-05 15:37:12.098 DEBUG (MainThread) [pyduke_energy.realtime] Socket readable, calling loop_read()
2022-11-05 15:37:12.100 DEBUG (MainThread) [pyduke_energy.realtime] Received PUBLISH (d0, q0, r0, m0), 'DESH/P210400605/out/sm/1/live', ... (129 bytes)
2022-11-05 15:37:13.293 DEBUG (MainThread) [pyduke_energy.client] Requesting usage between 2022-11-05T04:00 UTC and 2022-11-06T04:00 UTC
2022-11-05 15:37:15.094 DEBUG (MainThread) [pyduke_energy.realtime] Socket readable, calling loop_read()
2022-11-05 15:37:15.095 DEBUG (MainThread) [pyduke_energy.realtime] Received PUBLISH (d0, q0, r0, m0), 'DESH/P210400605/out/sm/1/live', ... (129 bytes)
2022-11-05 15:37:18.097 DEBUG (MainThread) [pyduke_energy.realtime] Socket readable, calling loop_read()
2022-11-05 15:37:18.098 DEBUG (MainThread) [pyduke_energy.realtime] Received PUBLISH (d0, q0, r0, m0), 'DESH/P210400605/out/sm/1/live', ... (129 bytes)
@BrettEBowman
Copy link
Author

A little more info:

When I look at the 2 entities under the Duke Energy Gateway device, I can see that the "Duke Energy Current Usage [W]" entity has data, but the "Duke Energy Usage Today [kWh]" entity is always 0 now.

@mjmeli
Copy link
Owner

mjmeli commented Nov 7, 2022

I'm currently running Home Assistant 2022.11.1 and version 0.1.2 of the integration and I'm not seeing this issue.

There are 2 different API interaction methods in this integration. One is the realtime push which is the Current Usage entity, which definitely is getting updated as you can see that in the logs. The other is a polling call to the API which shows in the log as a request but for some reason isn't updating

Requesting usage between 2022-11-05T04:00 UTC and 2022-11-06T04:00 UTC

There's no error message so it seems like the API is returning 0 maybe.

I'm not sure if they have made some change to the API that is on some sort of A/B mode so I'm not able to see the same issue

@BrettEBowman
Copy link
Author

I think it is some problem with Duke's server(s). When I go into their app on my phone, it is showing the smart meter gateway is online. But when I try to display Energy Usage for the current day, I get an error saying "Sorry, but your data is unavailable at this times. Please select a different time frame or check back later." If I go and look at yesterday there, it is showing me data.

I guess I'll just wait a little while longer and see if it starts working again.

@mjmeli
Copy link
Owner

mjmeli commented Nov 7, 2022

Strange, I think people have had issues similar in the past and they've had to re-add their gateway.

If you want, you can try using this web app I made that calls the APIs directly and might provide more insight: https://pyduke-energy-test-app.up.railway.app/

However not sure if it will provide any good insight

@BrettEBowman
Copy link
Author

BrettEBowman commented Nov 7, 2022 via email

@mjmeli
Copy link
Owner

mjmeli commented Nov 7, 2022

Usage data through yesterday is the default data that comes from a regular meter without the gateway. It sounds like the realtime data isn't getting through (which is weird how the realtime stream is working).

Ultimately I just reverse engineered the API that the app is making, so if the app isn't working then the integration isn't going to work

For the re-adding, I mean they are re-adding it to their Duke account, so basically running the setup again

@BrettEBowman
Copy link
Author

BrettEBowman commented Nov 7, 2022 via email

@mjmeli
Copy link
Owner

mjmeli commented Nov 7, 2022

Good to hear! I'll have to remember that in case someone else has that issue

@mjmeli mjmeli closed this as completed Nov 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants