Open TrackGeeks opened 1 week ago
Hey there @hunterjm, mind taking a look at this feedback as it has been labeled with an integration (duke_energy
) you are listed as a code owner for? Thanks!
@hunterjm I think this error might stem from how aiodukeenergy is handling the json response from Duke during a "clock change day."
For November 3, Duke's response contains 25 entries in the TickSeries and Series1 arrays instead of the expected 24.
TickSeries: ["12 AM", "01 AM", "01 AM", "02 AM", "03 AM", "04 AM", "05 AM", "06 AM", "07 AM", "08 AM", "09 AM",…]
(Note the duplicated "01 AM")
During the 24 hour range loop, the code is expecting the TickSeries array to be a 1:1 match with the 24 hours of expected_series. If this entry in TickSeries doesn't match our next expected hour from expected_series, the code is marking this hour as missing and adding an hour to the offset. Thus once it encounters the duplicate ("01 AM" for me), everything that comes after is marked as missing.
A simple fix without getting into timezone conversion, etc might be to detect duplicates in the TickSeries array. If one is found, remove that position from TickSeries and Series1 (and 2 if you're using that). It's not a perfect solution as you are missing out on data from that "leap hour" but it should solve this issue without going down the time conversion rabbit hole.
Feedback
I'm having an issue with the data being offset by a day. This started with the change to standard time last weekend. Until the time change, the data was correct. Now there is a gap in the data and everything is off by a day. Will this correct itself or is there something I need to do on my end?
URL
https://www.home-assistant.io/integrations/duke_energy/
Version
2024.11.1
Additional information
No response