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

Resolve issues waking some cars from sleep #512

Open
KipK opened this issue Jan 9, 2023 · 31 comments
Open

Resolve issues waking some cars from sleep #512

KipK opened this issue Jan 9, 2023 · 31 comments
Assignees

Comments

@KipK
Copy link
Collaborator

KipK commented Jan 9, 2023

Some Zoe users needs to setup a special procedure to prevent the Zoe going in sleep state .
The /config set Sleep/Disable state for pause has been introduced for that.
But it doesn't seems to solve the issue on all Zoe.
They have a start procedure on their smart home device to handle this:

  • stop the car
  • before it goes to sleep mode, plug the car and start a 30sec charge.
  • set the EVSE to sleep ( 254 via $FS command)
    This first procedure prevent the Zoe to go in sleep mode and not waking up later
  • when cheap rates hours comes, put the EVSE to Disable ( 255 via $FD command)
  • wait few sec,
  • Start charge ( $FE )

And then it seems to works.
The problem here is they still use RAPI commands for that, could be usefull to set an interface over the API to let them control that disabled state.

The /config one needs ESP32 to be restarted to let the disable state change effectively.

@jeremypoulter
Copy link
Collaborator

I believe setting to disabled is essentiallythe same as disconnecting the cable so not sure what the Zoe is doing... That being said what is the request here? Just an API to allow Zoe used to continue with the same process just not depending on RAPI?

@KipK
Copy link
Collaborator Author

KipK commented Jan 9, 2023

Yep have a way to dynamically set over the api the disable state from 254 to 255 or vis versa without having to reboot EVSE & write to the flash nor using RAPI commands.

@KipK KipK mentioned this issue May 14, 2023
2 tasks
@mathieucarbou
Copy link
Contributor

FYI I have a Zoe ZE50 E-Tech R110, and this vehicle is subject to the sleep issue.

Ref: OpenEVSE/ESP8266_WiFi_v2.x#223
Ref: #643

So I added an automation in HA which is sending through mqtt a sequence of $FD $FE when vehicle connects. I don't need to start a charge.

automation:
  # 
  - alias: "OpenEVSE: Zoé Bugfix"
    trigger:
      - platform: state
        entity_id:
          - binary_sensor.openevse_vehicle_connected
        from: "off"
        to: "on"
    condition: []
    action:
      - service: mqtt.publish
        data:
          topic: "openevse/rapi/in/$FD"
      - delay:
          hours: 0
          minutes: 0
          seconds: 2
          milliseconds: 0
      - service: mqtt.publish
        data:
          topic: "openevse/rapi/in/$FE"

So far, and like reported in the issue in reference, this is pretty reliable.

I've seen this option in OpenEVSE:

image

But I don't want to use it because of this warning:

image

I am using EVSE with an HA integration. I need and rely on the EVSE to be able to detect when a car is plugged., which is translated in mqtt with vehicle = 0 or 1.

image

Considering RAPI through mqtt will be removed, I think we definitely need some mqtt topics to enable/disable EVSE.

I recently introduced /restart to restart the gateway.

Could we introduce something like /evse_enabled and /evse_enabled/set set to 0 or 1 to be able to control that through mqtt ?

Thanks!

@jeremypoulter
Copy link
Collaborator

That option does the same as what you are doing, IE sends a $FD to the vehicle

@KipK
Copy link
Collaborator Author

KipK commented May 15, 2023

It does but once saved in the config, and rebooted the evse. not really usable for scripting some anti-sleep pattern yet.
Perhaps a new parameter on the claim engine to set the disable mode when disabling evse state?

@jeremypoulter
Copy link
Collaborator

No, I don't think the higher levels should be making those kinds of decisions, they should just start/stop and the OpenEVSE should deal with the interactions with the vehicle.

We need to define more sleep modes and config around how the charge is paused and resumed. The thing that is not clear to me is the sequence of events that will put a particular vehicle to sleep or wake it up

@KipK
Copy link
Collaborator Author

KipK commented May 15, 2023

depending of Zoe BMS software version, they don't have the same procedure or bugs so this will be quiet complicate to find something universal.

@jeremypoulter
Copy link
Collaborator

Doesn't have to be universal as such, but needs to have the flexibility to configure different patterns. I think we might need a mode to sleep, wait for n seconds then disable. Then also a module that forces a (min power?) charge for n seconds after the vehicle is plugged in. I think that should cover most of the cases I remember seeing. But I would like to see a list of vehicles and the associated hacks

@KipK
Copy link
Collaborator Author

KipK commented May 15, 2023

@mathieucarbou , don't you need the first procedure step describe at top of the thread on your Zoe? ( Trigger a charge few seconds before set the Zoe in sleep mode )

@KristianDebrenti
Copy link

KristianDebrenti commented May 15, 2023

Some Zoe users needs to setup a special procedure to prevent the Zoe going in sleep state . The /config set Sleep/Disable state for pause has been introduced for that. But it doesn't seems to solve the issue on all Zoe. They have a start procedure on their smart home device to handle this:

  • stop the car
  • before it goes to sleep mode, plug the car and start a 30sec charge.
  • set the EVSE to sleep ( 254 via $FD command)
    This first procedure prevent the Zoe to go in sleep mode and not waking up later
  • when cheap rates hours comes, put the EVSE to Disable ( 255 via $FD command)
  • wait 30sec,
  • Start charge

And then it seems to works. The problem here is they still use RAPI commands for that, could be usefull to set an interface over the API to let them control that disabled state.

The /config one needs ESP32 to be restarted to let the disable state change effectively.

I can confirm it's the same behaviour for Dacia Spring EVs.
It would be really nice to be able to configure this kind of operation within the UI, but of course, it doesn't make sense if it's only afecting an isolated group of users, but then having the ability to tackle this through MQTT would be a great option.
Right now, if I connect the charger in the evening (divert enabled), in the morning when I have solar surplus, I need to go outside and wake up the car in order to accept the charging...

@KipK
Copy link
Collaborator Author

KipK commented May 15, 2023

On UI side we could have 2 selector menus for pause mode and activating charge:

Pause / Disable / 30s charge then Pause

Charge Activation:
Activate ( default ) , Disable then Activate

But I'm not fan of this solution as it's a hack for buggy or non standard vehicles, keeping them at the same level deserve main clarity.

Also I'm not even sure the actual Pause / Disable switch is used by somebody and solve any issue. There's no report on the related Issue supposed to be solved by this commit so perhaps there's no pro at all to always keep the evse in disabled state when paused. This would be interesting to have some feedback.

If this Pause / Disable it not enough and those reported this got the same Zoe / Dacia problem, then we only need to match the top procedure and would simplify the setup:

Zoe / Dacia sleep & wake-up hack:
Enable / Disable ( + description in help icon )

@mathieucarbou
Copy link
Contributor

@mathieucarbou , don't you need the first procedure step describe at top of the thread on your Zoe? ( Trigger a charge few seconds before set the Zoe in sleep mode )

No! 100% sure. I didn't know about these steps, the only thing I need to do is disable then enable evse once the vehicle connects.

I am always using Solar divert. So I usually plug when there is not enough sun, so no charge, and the vehicle wakes up at one point and charges when asked to.

@KipK
Copy link
Collaborator Author

KipK commented May 15, 2023

@mathieucarbou on what they told me, the vehicle can't wake up only after few hours. Guys using this procedure mostly plug their vehicle when going back from work, and startautomatically the charge in late night hours later.
Perhaps on your test there was not enough waiting time to see this behavior ?

but I've also heard that some up to date BMS on zoe don't suffer from this.

@mathieucarbou
Copy link
Contributor

@mathieucarbou on what they told me, the vehicle can't wake up only after few hours. Guys using this procedure mostly plug their vehicle when going back from work, and startautomatically the charge in late night hours later. Perhaps on your test there was not enough waiting time to see this behavior ?

but I've also heard that some up to date BMS on zoe don't suffer from this.

Oh!!! Yes that is possible... So to test that, I will have to keep the plug connected in the evening through the night and keep it connected in the morning until the sun rises. So it will be a test for this week-end :-)

@KipK
Copy link
Collaborator Author

KipK commented May 15, 2023

I've also contacted one of those guy to see if they can test your procedure and get same result.

@mathieucarbou
Copy link
Contributor

Basically, the Zoé stops the charge if the signal Zappi is sending to the Zoé is lower than these values. This means that the minimum charge rate is higher.
Zappi checks for "reactive current", as mentioned in EV Ready and adjust the PWM (the signal) according to the values in the Compatibilty Mode.
This ensures that a charge can happen regardless of the EV being plugged in.

FYI, it does not apply to the new Zoe ZE50 (52kWh) E-Tech R110 because I am charging with solar divert during the day at a pilot of 6A - 10A depending. And I was able to confirm that with an OBD device and CanZe. The vehicle charges at a lowest current of 5.6A (pilot set to 6A) up to 19A when the pilot is set to 20A.

Also, at a lower current, the PF is about 0.8. But at higher current, the PFC triggers and the PF is higher than 0.95, most of the time 0.98 (measures with a shelly em dedicated for the EVSE box).

@glynhudson
Copy link
Collaborator

glynhudson commented May 16, 2023

I can also confirm the ZE40 'R' model can handle 6A charging. I think the 7.2A minimum limit that's mentioned in the links posted only applies to 'Q' model Zoes that can take 43kW AC. Manufacture of the 'Q' model Zoes stopped in Jan 2017.

The Renault EV ready document has some info about the wakeup procedure, I'm guessing that 'non-compliant' modes is referring to older Zoes, or Zoes without the BMS update?

Screenshot from 2023-05-16 11-59-44
Screenshot from 2023-05-16 11-59-07

@KipK
Copy link
Collaborator Author

KipK commented May 17, 2023

The other way would be to use Renault API to send a start_charge when openevse switch to active. This will wake up the vehicle:

https://renault-api.readthedocs.io/en/latest/index.html

@mathieucarbou
Copy link
Contributor

The other way would be to use Renault API to send a start_charge when openevse switch to active. This will wake up the vehicle:

https://renault-api.readthedocs.io/en/latest/index.html

No... Not an option. That's the API I was using before, and that is the reason I bought the OpenEVSE box.

  • The Renault API is not stable and reverse-engineered
  • Not supported by Renault
  • Their servers are often down, causing the API to fail
  • There is a rate limit preventing doing too much requests within 7 min
  • They are changing their API keys sometimes, and tthe devs have to spy on the request / response from the updated mobile apps to their server to grab the new api key.

So no, please no... 😆

@mathieucarbou
Copy link
Contributor

OK so yesterday I've remove any automation I got. So no more $FD-$FE, or $FR.
Also, I don't use the disable sleep option.
Zoe ZE50 (52kWh) E-tech R110.

And today the solar divert started the charge normally when possible.

image
image

So I'm baffled....
Because I am 100% sure I ran into a sort of sleep issue one time, and I had to wake up the car to be able to start the charge.

So 2 explanations:

  1. my spouse woke up the car unexpectedly by walking next to it (which unlocks it) 😁
  2. or the Zoe I have is not subject the issue, and the problem I saw was caused by something else

So I will keep testing, all automations disabled, sleep mode active.

image

@jeremypoulter jeremypoulter changed the title Add a way to set mode 254 or 255 from the API Resolve issues waking some cars from sleep May 20, 2023
@jeremypoulter jeremypoulter self-assigned this May 21, 2023
@jeremypoulter jeremypoulter moved this from Todo to In Progress in OpenEVSE v5.0 release May 21, 2023
@jeremypoulter
Copy link
Collaborator

I may be able to get access to a Zoe to test this issue, can someone confirm the time it takes for a Zoe to go to sleep after the EVSE goes to sleep (just to reduce the testing time)?

@jeremypoulter
Copy link
Collaborator

On actually 'fixing' this issue. I will add a simple module that adds a high priority claim to vehicle connection and an option to disable before waking up, with 4 config options

  • charge_vehicle_connection, enable/disable the charge after vehicle connect, default false
  • charge_vehicle_connection_duration, the duration of the charge, default 30 seconds
  • charge_vehicle_connection_current, the current, default 8A (I assume this needs to be low to avoid exsessive import at a possibly high rate)
  • disable_before_active: disable the EVSE module before waking when switching to active mode

@mathieucarbou
Copy link
Contributor

I may be able to get access to a Zoe to test this issue, can someone confirm the time it takes for a Zoe to go to sleep after the EVSE goes to sleep (just to reduce the testing time)?

FYI I left the vehicle connected the night of sat-sun and the vehicle started charging sunday morning with solar divert (export mode) without any issue. Nobody woke up the car.

So I just think I ran into a random issue which had the same symptoms of a car sleep (because I had to woke up the car to start charging).

But from my testing during these 2 days, the Zoe ZE50 E-Tech R110 is not subject to the sleep issue... I will continue to monitor: I usually leave the car plugged during the night.

@mathieucarbou
Copy link
Contributor

  • charge_vehicle_connection_current, the current, default 8A (I assume this needs to be low to avoid exsessive import at a possibly high rate)

Why is the default not equal to the min_current ?

@jeremypoulter
Copy link
Collaborator

  • charge_vehicle_connection_current, the current, default 8A (I assume this needs to be low to avoid exsessive import at a possibly high rate)

Why is the default not equal to the min_current ?

It is my understanding that some Zoes need a min of 7.2 amps to start a charge, so thought it made sense to be cautious

@jeremypoulter
Copy link
Collaborator

Can we try and colate information on which vehicles suffer from this issue? and if there are just (Zoe) firmware updates that are needed to be applied.

@mathieucarbou
Copy link
Contributor

Can we try and colate information on which vehicles suffer from this issue? and if there are just (Zoe) firmware updates that are needed to be applied.

Hello, FYI I have disabled the automation since our previous discussion, and I didn't activate the special mode in OVSE. So I don't restart the box anytime and I have pause status set to sleep (defaults).

image

And everything works fine! We are charging and using the VE every day and on week-end or mornings it starts with divert when it has to.

Zoe E-Tech R110 52kWh.

@bubupol
Copy link

bubupol commented Jan 15, 2024

Hello I have a Zoe R90 Z.E.40 from May-2018.
I have the same issues. It has been working well for few months with the setting to sleep, and since last week the car doesn't wake up.
I am baffled too.
I tried both setting of the Pause Status : disable or Sleep. no success.

I can wake up the car with the remote by pressing the "lock doors" button and the charge starts.

Have some people managed to do some firmware updates on the car itself to solve the issue ?

.

@MilorES
Copy link

MilorES commented Mar 6, 2024

OpenEVSE | 8.2.0.EU
OpenEVSE Wifi | v5.1.0_modified

I have a Dacia Spring from September 2022.
I usually plug it in before entering the house.
In Spain sometimes the economic time starts at 00:00 and we can also have the highest power at a low cost.
For the charging to start, I must go to the application or restart the ARDUINO, I seem to remember that restarting the ESP32 does not solve the problem.

When you restart the ARDUINO it returns to AUTO mode even if it is ON. Is this behavior normal?

Now that RAPI is not working, what commands are sent to restart or force it to start (it was not clear to me).

Note: I hope you can understand because I am using a translator since my native language is Spanish.

P.S. Having to wait until 00:00 instead of being able to rest before 23:00 makes me sad.

@NEVdataDyne
Copy link

NEVdataDyne commented Dec 3, 2024

Dacia Spring 2024

This is my best solution so far to allow home assistant to control the charge through openevse without:

  • Letting the car ever going to deep sleep
  • Setting the pause status to disable in openevse (which doesn't work well on this car anyway)
  • Using MQTT
  • Using extra hardware
  • Using Renault/Dacia cloud service

Solution (everything done in HA)

  1. Detect that the car is plugged in
  2. Perform an override on openevse with status active (action : OpenEVSE: Set override; If charge is not needed, I put 6A, minimum current)
  3. Wait 10 seconds minimum (maybe even less works; openevse status changes to connect for about 6-7 seconds and then to charging for at least a couple seconds). In practice my automation waits for an event to occur : Charging status "charging" for 2 seconds with a maximum wait of 15 seconds after which I send a notification to signal the problem.
  4. Then either continue to charge or perform an override on openevse with status disabled (sleep)

There is no need to charge the car at regular intervals. I tested up to 8h10min of continuous sleep and the car would charge without a problem.

Important note

Any action performed on the car such as opening a door or pushing on a button on the key, "resets" the sleeping routine. That means that if such an action is performed and the charger doesn't charge the car for a couple of second quickly, the car will go to a deep sleep and the solution described above stops working until the plug is disconnected and reconnected again.
If the Zoe has a similar way of working, it is a problem because the wireless key might interract with the car without the user noticing (the Spring has an old school key, one needs to push buttons)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants