nordicopen / easee_hass

Custom component for Easee EV charger integration with Home Assistant
209 stars 34 forks source link

Possible to enable/disable schedule charging? #217

Open mdeakin99 opened 1 year ago

mdeakin99 commented 1 year ago

Question

I am on Intelligent Octopus tariff in the UK and I am looking to enable/disable EASEE schedule charging via an automation in home assistant.

I have read through the readme and looked at all the switches in the integration but can’t find one for Schedule.

have I missed it? Is it possible to enable/disable schedule via this integration?

thanks

mark

What version of the integration are you using?

0.9.45

Anything in the logs that might be useful for us?

No response

Additional information

No response

olalid commented 1 year ago

You can use the service easee.set_circuit_dynamic_limit to 5 A or lower. That will stop charing from happening. And then change it to whatever max current you want when you want to allow charging. But no, there is no function to change or disable schedule. Disabling schedule would mean to allow charing all the time actually, I guess that is kind of the opposite of what you want?

mdeakin99 commented 1 year ago

Thanks for the reply. Basically I need to switch it from ‘charge at anytime’ to ‘only charge between 00:30 and 05:30’ depending on which car is plugged in (and therefore if ‘Intelligent Octopus charging’ is required). I guess I could do something that says if Intelligent Octopus Charging isn’t being used then depending on the time, set the circuit dynamic limit. Bit faffy though :)

olalid commented 1 year ago

It would be tricky to implement this with schedules since the API has no "memory" about what schedule was previously used. So you can not just "enable" something that was previously used, you have to set specficially what you want to have. In theory we could add a service to create and delete schedules, but it would not be a simple enable/disable in any shape or form. Using the circuit dynamic limit is the normal way of doing this in any case I would say.

mdeakin99 commented 1 year ago

Thanks for confirming it. In the app there is a on/off slider so was hoping that was available via the API.

olalid commented 1 year ago

Yes, the app probably remembers what you set the last time.

olalid commented 1 year ago

There is actually another way you could do this. There is already a service call easee.override_schedule. If you call that service charging will start independent of the schedule. Maybe not exactly what you wanted though, but I thought I should mention it.

skela commented 1 year ago

Yeah override_schedule is a good bet, its just a way to start charging now, schedule will in effect be ignored until you disconnect the cable.

there are APIs to download the current weekplan, and send it back up to disable it (because in the payload there's an isEnabled flag that you can use to disable it), so the API does remember the schedule. but its easier to use override_schedule for this sort of thing, then you dont have to remember to enable it again later.

olalid commented 1 year ago

@skela Are you sure? I seem to remember that just get a 404 error back when no schedule is set and we call the API to fetch it...?

skela commented 1 year ago

Yes its possible. There's a difference between a schedule being set on the charger and it being enabled on one. users disable and enable schedules in the easee apps often, without them having to create the schedule every time. You'll get a 404 if absolutely no schedule exists for the charger for sure. But you will get a 200, with the schedule from the 2 scheduling API we have, which includes a boolean inside the json payload saying if the schedule is enabled or not.

If its disabled, there would be no need to do much, charger behaves the same as if there were no schedule. If enabled, then there's a schedule on the charger that will take effect, and Override Schedule is the command u can use to temporarily override the schedule to start charging immediately. You cannot un-override a schedule though, once the charger has been told that the schedule should be ignored, it will not take effect again until the next time u connect the cable to the car.

olalid commented 1 year ago

Ok, so I should look at this again some time.