Closed tim-b2 closed 2 weeks ago
I've enabled debug logging (logs when the update interval changes) and am doing an Intelligent Octopus charge tonight - will see if I can reproduce this. Might be worth enabling this yourself on your next charge to give us some more data (would be helpful to disable any automation you have that trigger the update when you do this).
The number of polls config option is something I can add, I'll look into it.
Dan
So it looks like the way I'm changing the update interval doesn't work immediately, as it seems to have already scheduled the next run.
2024-10-23 04:58:39.668 DEBUG (MainThread) [custom_components.nissan_connect.coordinator] Changing next update interval to 15 minutes
2024-10-23 05:48:36.839 DEBUG (MainThread) [custom_components.nissan_connect.coordinator] Finished fetching Poll Coordinator data in 0.659 seconds (success: True)
2024-10-23 06:03:36.516 DEBUG (MainThread) [custom_components.nissan_connect.coordinator] Finished fetching Poll Coordinator data in 0.334 seconds (success: True)
I've written a fix, will test it out again tonight.
Looks like you've already found it but my logs show similar -(sorry don't know how to copy neatly) 2024-10-23 02:32:14.059 DEBUG (MainThread) [custom_components.nissan_connect.coordinator] Changing next update interval to 10 minutes
2024-10-23 03:27:12.027 DEBUG (MainThread) [custom_components.nissan_connect.coordinator] Finished fetching Poll Coordinator data in 0.246 seconds (success: True)
2024-10-23 03:37:12.039 DEBUG (MainThread) [custom_components.nissan_connect.coordinator] Finished fetching Poll Coordinator data in 0.258 seconds (success: True)
Images show when updates occurred and charger was on ('off' is the charger is actually charging due to the way it switches off the schedule to enter manual charging ) It started a 2nd block of charging at 3:30 then the update came through and it realised it had already reached its target charge % so stopped.
Happy to help with testing when I next charge (probably will be on the weekend)
Yeah looks like you're seeing the same behaviour. I did a partial charge last night in anticipation so will report back tomorrow with if the fix works.
(For pasting logs, select them and click the code <> icon at the top and it'll format them nicely)
This seems to be fixed now under v0.5.7. Please try it out and feel free to re-open this issue if you still have problems with it.
Thanks for reporting this issue and for your involvement in this community, its always appreciated.
Dan
What happened? When first plugged in I see 15 minute updates, which then increase to hourly after 4 rounds of plugged in but not charging, as expected. However once charging starts it does not switch back to the 15 min intervals, even after one of the hourly polls detects charging is occurring
To Reproduce Plug in but don't start charging for several hours (such as when arriving home early evening, but having a charging schedule set for an overnight/early morning cheap rate)
Expected behavior Once charging is detected to revert to 15 minute updates, until car returns to plugged in, not charging (then back to hourly updates)
Log Output Any relevant logs from Home Assistant.
Home Assistant Version 2024.10.3 HAOS
Integration Version V0.5.6
Additional context I'm on a time of use tariff (agile octopus) and using the Predbat add on to select the cheapest 30 minute slots to charge (which may or may not be contiguous), predbat needs the updated battery percentage to plan how many more slots are needed (with the low update frequency it tends to schedule more slots than needed as it thinks the battery is still at the level of the last poll, not seeing potentially 55minutes/6kW of charging. Im using an automation to force a poll just after charging is started, but would prefer it to continue automatically every 15 minutes once it confirms the leaf is charging.
Also is it possible to manually change the number of polls of plugged in not charging before it reduces update frequency?
Appreciate all the work you've put into this integration. Thanks