Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Intelligent Dispatching does not turn on if planned dispatches span 11am #858

Open
2 tasks done
andynash opened this issue Apr 28, 2024 · 11 comments
Open
2 tasks done
Assignees
Labels
awaiting release confirmation Waiting confirmation on new release fixing the issue bug Something isn't working

Comments

@andynash
Copy link

andynash commented Apr 28, 2024

Describe the bug

I've realised that if planned dispatches span 11am, the Intelligent Dispatching binary sensor does not turn on, even though planned dispatches correctly records the updated dispatches from Octopus.

For example, let's say it's 8.15am (in case it is relevant, we use the car integration, not charger).

Let's also assume the current SOC is very low, that we have just been informed (not unusual in our case) we need to make a long journey at 7pm, and note that we use a 2.3kW 3-pin charger (this issue may not have been noticed by others, as I imagine most use 7.2kW chargers and/or start their journeys in the morning before 11am, and predictably).

If we request a charge to complete by 11am, we might be given some slots from (say) 8.15am to 11am, the Intelligent Dispatching sensor turns on, and all is fine.

However we are leaving at 7pm and require more charging than that.

We cannot request a time earlier than 4am, so that is what we select. Octopus then often provide planned dispatch slots between (say) 8.15am and 4am and these are correctly received by the integration. These often start before 11am and end after 11am.

In this case, the binary sensor does not turn on, even though we are currently within a planned dspatch.

I've not been able to work out whether it matters if for example there's a dispatch which completes before 11am and another that starts after 11am, or whether an individual dispatch starts before 11am and ends after 11am, as the dispatches we've received and I've observed have always included an individual dispatch that starts before 11am and finished after 11am.

If we wait until after 11am to select 4am amd receive planned dispatches (that therefore do not span 11am), the sensor then correctly turns on during the planned dispatches.

Reproduction steps

Request (and receive) planned dispatches that span 11am.

Expected behaviour

Intelligent Dispatching turns on as usual during the received planned dispatches.

Tariff Code

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

Integration Version

10.3.1

Home Assistant Version

2024.4.4

Fresh Install?

Not specified

Home Assistant Logs

Will try and obtain logs during the period the planned dispatches are received from Octopus

Confirmation

  • I confirm that I cannot find my solution within the documentation
  • I confirm that I cannot find my solution within the FAQ
@andynash andynash added the bug Something isn't working label Apr 28, 2024
@andynash
Copy link
Author

I've captured logs using the enable debug logging in the integration settings while new dispatches spanning 11am were received, but the resultant file is a .bin so I can't view the file or paste the contents here (as binary not sure they'd not be useful anyway?).

I can send if required though?

Incidentally, prior to changing the time to 4am, it had been 11am and a dispatch was in progress, therefore dispatching was turned on. As expected, when the new dispatches were received, including a dispatch from the current time (c. 9.30am) to beyond 11am, dispatching turned off even though it should have remained on.

@BottlecapDave
Copy link
Owner

BottlecapDave commented Apr 28, 2024

Hello sorry you're having issues with the sensor.

The dispatching sensor turns on whenever you're within a rate that is either off peak or has is_intelligent_adjusted set to true. The latter should occur when you're with a supported provider (e.g. not ohme) and you have pending or completed dispatch that starts/ends or covers a rate outside of an off peak rate. For example

  • 08:00 - 08:30
  • 08:30 - 09:00
  • 09:00 - 09:30
  • 09:30 - 10:00

these will all have is_intelligent_adjusted set to true and adjusted to an off peak rate if for example a pending or completed dispatch is say from 08:01 to 09:59.

There have been sporadic reports where a pending dispatch is removed before it's finished but not turned into a completed dispatch which would cause the sensor to turn off early.

It would be interesting to know what the rates state in the event entity during the problematic period both before, during and after the dispatch event as well as the pending and completed dispatches in the sensor.

@andynash
Copy link
Author

Thanks Dave!

I don't think we are looking at the scenario where pending dispatches are removed as they are definitely present as expected.

I'll have to wait until a morning when I can observe is_intelligent_adjusted and let you know 👍

@andynash
Copy link
Author

I didn't quite make it in time to check this properly today, though I can confirm that is_intelligent_adjusted is set appropriately when planned dispatches either finish before 11am and begin after 11am.

I've realised I have a sensor tracking is_intelligent_adjusted, and this was off yesterday during a period covered I believe by planned dispatches that did span 11am, however I'd like to be able to see all these sensors live during such a period to be 100% sure.

It may take a few days to have an opportunity to check this properly as the car is going away tonight for a night, maybe longer.

Out of curiosity, I'm not sure whether is_intelligent_adjusted comes directly from the Octopus API (even if renamed) or if it is derived by the integration from other data?

@BottlecapDave
Copy link
Owner

Out of curiosity, I'm not sure whether is_intelligent_adjusted comes directly from the Octopus API (even if renamed) or if it is derived by the integration from other data?

The is_intelligent_adjusted field is calculated by the integration. This is true if an available planned or completed dispatch spans (completely or partially) a given 30 minute rate period. This is because OE API only provides the core rates, not accounting for planned or completed dispatches.

No rush on the findings as I probably won't have much time to look at it within the next week.

@andynash
Copy link
Author

andynash commented May 6, 2024

I can confirm that when this is happening, is_intelligent_adjusted is true, while intelligent_dispatching is false.

It is now just after 6am, with the Intelligent ready time set to 4am. Planned dispatches have been provided by Octopus and are recorded in the dispatching sensor so dispatching should be turned on. The current planned dispatch has started and ends at 4am tomorrow morning (I wonder if the tomorrow part might be where the bug lies? But of course I can't test that as the ready time cannot be set after 11am and earlier than 4am).

When I change the ready time to 11am or earlier, dispatching turns on correctly (and of course ends at 11am).

@BottlecapDave
Copy link
Owner

The current planned dispatch has started and ends at 4am tomorrow morning (I wonder if the tomorrow part might be where the bug lies? But of course I can't test that as the ready time cannot be set after 11am and earlier than 4am).

This might be where it lies. Sorry to be a pain, but any chance you could post the full list of rates (today and tomorrow) if possible. It can be from the energy card if you use that if it indicates which rates are marked as intelligent dispatch.

@andynash
Copy link
Author

andynash commented May 7, 2024

No problem at all, I'll try and grab those tomorrow morning 👍

Sorry I've realised I was focused on the adjusted variable, but you did ask for the rates before 🤦

@andynash
Copy link
Author

andynash commented May 8, 2024

Hi Dave, I've attached screenshots of the data you asked for below - as far as I can see everything looks as it should except the Intelligent Dispatching binary sensor, but you may spot something I've missed!

As a reminder, it works fine if the planned dispatches end before or at 11am, and if they start after 11am, but if they start before 11am and end after 11am, that's where the problem occurs.

Thanks for your help with this 👍

Planned Dispatches

Screenshot_20240508_102837_Home Assistant

Current Rate Attributes

Screenshot_20240508_103446_Home Assistant

Current Rates

Screenshot_20240508_104745_Home Assistant

@andynash
Copy link
Author

andynash commented May 8, 2024

Ps. Nothing to do with this bug (at least I don't I think so), but I can't for the life of me work out why the rate changed to 7.5 between 8am and 9am. Overnight and beyond this time, the time was set to 4am and the charge to 100% (as that is what it had been set to the previous day), so the previous adjusted rate will have run up to 11.30pm yesterday, the standard Intelligent slot will then have run to 5.30am, and this seems to have happened as expected.

Normally in this scenario, I would expect the standard rate to take over from 5.30am, and continue at least until the next time the car is plugged in (or we update the 4am/100%). so 8am to 9am is not as expected - perhaps Octopus felt that the car had disconnected then reconnected, but if so, that doesn't explain why it would then stop at 9am.

Then at 10.13am I adjusted the 100% to 10% and back to 100% to trigger Octopus to send planned dispatches that would span 11am, so that I could create these screenshots, so from 10am onwards the rate is as expected (given the planned dispatch they provided).

@BottlecapDave
Copy link
Owner

I think I found an issue which might be causing this, but I'm having trouble replicated what you're seeing locally. Could you please try v11.0.0 to see if this fixes your issue?

Also is a full pending dispatch normal with your provider? Is this useful? Should this be following the ohme model and not be reported?

@BottlecapDave BottlecapDave added the awaiting release confirmation Waiting confirmation on new release fixing the issue label May 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting release confirmation Waiting confirmation on new release fixing the issue bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants