BottlecapDave / HomeAssistant-OctopusEnergy

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

No best period being found #89

Closed usbrit closed 1 year ago

usbrit commented 1 year ago

Can anyone help with this please?

No best period being found. Created a 3 hour intermittent timer, but after 24 hours it never turned on.

image

Home Assistant Version

2022.10.3

Integration Version

4.6.4

Fresh Install?

Fresh Install

corvus2606 commented 1 year ago

I'm seeing the same. i've had a few targets working for months, but as of yesterday they are not finding a best time

corvus2606 commented 1 year ago

I'm seeing this in the debug logs for the integration: 2022-11-12 21:11:25.002 DEBUG (MainThread) [custom_components.octopus_energy.binary_sensor] None rate periods found for meter ****************

I've tested the API using CURL, and it's taking about 2 seconds to come back with a full list of rates. so there's something happening with the processing of the data from a quick look

usbrit commented 1 year ago

Finally got round to checking the logs:

[custom_components.octopus_energy.binary_sensor] Updating OctopusEnergyTargetRate best_2_hours 2022-11-23 10:40:45.211 DEBUG (MainThread) [custom_components.octopus_energy.binary_sensor] 0 rate periods found for meter 101xxxxxxxxx 2022-11-23 10:40:45.212 DEBUG (MainThread) [custom_components.octopus_energy.target_sensor_utils] Finding rates between 2022-11-23 00:00:00+00:00 and 2022-11-24 00:00:00+00:00 2022-11-23 10:40:45.212 DEBUG (MainThread) [custom_components.octopus_energy.target_sensor_utils] 0 applicable rates found 2022-11-23 10:40:45.213 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: entity_id=binary_sensor.octopus_energy_target_best_2_hours, old_state=None, new_state=<state binary_sensor.octopus_energy_target_best_2_hours=off; Name=best_2_hours, Hours=2.0, Type=Continuous, MPAN=101xxxxxxxxx, rolling_target=False, target_times=[], next_time=None, icon=mdi:camera-timer, friendly_name=Octopus Energy Target best_2_hours @ 2022-11-23T10:40:45.213268+00:00>> 2022-11-23 10:40:45.215 DEBUG (MainThread)

@BottlecapDave Can you have a look and see what the problem is? I have checked MPAN and it's correct

BottlecapDave commented 1 year ago

I believe I've found the culprit to this issue and think its related to https://github.com/BottlecapDave/HomeAssistant-OctopusEnergy/issues/76. I've released a beta of the fix https://github.com/BottlecapDave/HomeAssistant-OctopusEnergy/releases/tag/v4.6.5-beta1, but a new release should be available soon. I'll post here once it's available.

corvus2606 commented 1 year ago

I've just installed the new beta version and on restart I have target times again 😊

BottlecapDave commented 1 year ago

This should now be included in the latest release https://github.com/BottlecapDave/HomeAssistant-OctopusEnergy/releases/tag/v4.7.0