BottlecapDave / HomeAssistant-OctopusEnergy

Unofficial Home Assistant integration for interacting with Octopus Energy
https://bottlecapdave.github.io/HomeAssistant-OctopusEnergy/
MIT License
622 stars 62 forks source link

Octopus Intelligent planned dispatches not updating #1088

Open chris-y opened 4 days ago

chris-y commented 4 days ago

Describe the bug

The Planned Dispatches is not showing spots that get added later. I had a planned charge between 0400-0500 which for some reason extended up to 0830. This is showing in Completed Dispatches, but did not appear in Planned Dispatches (at all as far as I can tell - at least the integration never picked it up as I have a notification set for when it changes). The binary sensor also didn't show that there was a dispatch in progress throughout this time.

Completed dispatches:

Screenshot_20241120-175137

When binary sensor was active: Screenshot_20241120-191712

Reproduction steps

Not sure! I use the Renault IOG integration, it could be a bug with that (it is beta), or it could be that this integration didn't pick the new times up.

Expected behaviour

I'd expect the binary sensor to switch on, even if these are last minute additions to the schedule.

Tariff Code

E-1R-INTELLI-VAR-22-10-14-A

Integration Version

13.1.3

Home Assistant Version

2024.11.2

Fresh Install?

Not specified

Home Assistant Logs

I've started debug logging in hope that it happens again tonight.

Confirmation

chris-y commented 2 days ago

Related: I plugged the car in and it started smart charging and allocated some slots. I then disabled smart charging in the Mobilize app - this doesn't appear to link to the smart charging option in the Octopus API. It also left my slots in the upcoming dispatches.

I hope this will be sorted out by Octopus, even if it's a one way connection. I don't think there's anything this integration can do to work around it at the moment.

BottlecapDave commented 19 hours ago

Hello and sorry you saw this issue. Did you have any errors in your logs? There are sometimes instances where OE doesn't update the planned dispatches, which is what the integration uses to power the dispatching sensor, which might be what happened in your scenario.

For your second situation, if there is no link between mobilize and Octopus then this integration won't know either. It just recreates what's available in the app.

BottlecapDave commented 19 hours ago

If you're comfortable with running SQL queries, you can run the following via the SQL add-on to see what the attributes were at the time of the dispatching sensor turning on/off

SELECT  "states_meta".entity_id, "states".state,  "state_attributes".shared_attrs, DATETIME("states".last_updated_ts, 'unixepoch') AS last_updated
FROM "states_meta"
JOIN "states" ON "states".metadata_id = "states_meta".metadata_id
JOIN "state_attributes" ON "state_attributes".attributes_id = "states".attributes_id 
WHERE "states_meta".entity_id LIKE '%intelligent_dispatching%'
AND DATETIME("states".last_updated_ts, 'unixepoch') >= '2024-11-20 00:00:00Z'
AND DATETIME("states".last_updated_ts, 'unixepoch') <= '2024-11-20 10:00:00Z'

It would also be good to upvote https://community.home-assistant.io/t/simple-way-to-view-the-history-of-sensor-attributes/553324 to make this process easier

chris-y commented 15 hours ago

Screenshot_20241124-111127-091.png

chris-y commented 15 hours ago

Yeah, I'm suspecting that the planned dispatches never got updated. They were showing as completed after they had passed.