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

Using [CLI] - Error: Unable to convert 3 to PlugState - Dacia spring #1262

Open
rickbaud opened this issue Jul 16, 2024 · 15 comments · Fixed by #1304
Open

Using [CLI] - Error: Unable to convert 3 to PlugState - Dacia spring #1262

rickbaud opened this issue Jul 16, 2024 · 15 comments · Fixed by #1304

Comments

@rickbaud
Copy link

Hello,

New to guthub. I hope my question is formaly right.

I am using the renault-api CLI commands and get this error which preclude me from getting any status.

www-data@doma:~/.local/bin$ ./renault-api status
Error: Unable to convert 3 to PlugState.

Context:

  • Debian GNU/Linux 10 (buster)
  • Python 3.12.4
  • renault-api, version 0.2.4

Thanks a lot,

Regards,

@mk-maddin
Copy link

I can confirm - same issue here when dacia spring is unplugged.

@epenet
Copy link
Collaborator

epenet commented Jul 18, 2024

You can look at this file, where PlugState is defined.
https://github.com/hacf-fr/renault-api/blob/main/src/renault_api/kamereon/enums.py

You can open a PR

@epenet
Copy link
Collaborator

epenet commented Jul 18, 2024

I also suggest that you use --debug argument to get the full json

@rickbaud
Copy link
Author

Well, since a few days, it looks like the problem solved by itself, (e.g. was solved by Renault).

plugStatus is set to "0" again when the car is unpluged.


Battery level 58 %
Last updated 2024-07-20 12:09:23
Range estimate 132 km
Plug state PlugState.UNPLUGGED
Charging state ChargeState.NOT_IN_CHARGE
Time remaining 5 min
Total mileage 30040.0 km
GPS Latitude xxx
GPS Longitude xxx
GPS last updated 2024-07-20 10:47:40
HVAC status off


I voluntarily replaced above the GPS coordinates. They were right.

I will wait a few more days and close this issue.

:-)

@rickbaud
Copy link
Author

Too bad, lpugStatus is back to "3" today.

@TheRealOne78
Copy link

TheRealOne78 commented Jul 25, 2024

This has been for a while for me. Maybe around 2 months already. I assumed this is mainly a problem from Renault/Dacia, mainly because I get this status randomly, not just when unplugged, but also plugged.

This also affects the official MyDacia app, where instead of "Unplugged/Plugged" it prints "--"

signal-2024-08-02-15-35-51-406

@Mindavi
Copy link

Mindavi commented Aug 9, 2024

Also running into this, maybe plugstate 3 should be defined as unknown too. Not completely sure.

@tmenguy
Copy link
Contributor

tmenguy commented Aug 27, 2024

yes same here, I confirm (and sorry for the duplicate bug)
it seems that State 3 is indeed a "plugged" state do you confirm on your side? (my car is effectively plugged when it happens ).. .even if I have the issue in my app too that sees it has unplugged. The HA plug binary sensor is erroneously as unplugged too in HA, the only one correct is the "charging state" stating waiting for charge
I can fo a quick PR on this, but I'm not sure of this state really is.

What you you see from your car when you have this state? to me it seems correlated with "waiting for charge state" ? anyone can confirm?

@tmenguy
Copy link
Contributor

tmenguy commented Aug 27, 2024

Just made some experiments here : I do confirm : this new plug state 3 seems to be a "plugged and waiting for charge" one .. probably not supported yet by the renault app

@tmenguy
Copy link
Contributor

tmenguy commented Aug 27, 2024

I'm forking, but the HA part will need a fix too unfortunately to set the correct plug (in or not)

@epenet
Copy link
Collaborator

epenet commented Aug 28, 2024

v0.2.6 has been released: https://github.com/hacf-fr/renault-api/releases/tag/v0.2.6

@shiner66
Copy link

shiner66 commented Oct 8, 2024

In my Dacia spring it seems that plug state 3 becomes set at every start of the car, resulting in a “Plugged in” state on ha even when the car is not

@epenet
Copy link
Collaborator

epenet commented Oct 8, 2024

I'm happy to take PRs to revert this to some kind of "unknown" state - neither plugged in nor unplugged

@shiner66
Copy link

shiner66 commented Oct 8, 2024

I'm happy to take PRs to revert this to some kind of "unknown" state - neither plugged in nor unplugged

I’m not sure how we would classify that as we already have unknown defined, unknown2?

@epenet
Copy link
Collaborator

epenet commented Oct 9, 2024

I think that maybe 3 should be removed from the enum, and "get_plug_status" should be amended to return None if plugStatus is 3.

        try:
            if self.plugStatus is None:
                return None
            return enums.PlugState(self.plugStatus)
        except ValueError as err:
            log_exception(...)
            return None

@epenet epenet reopened this Oct 9, 2024
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

Successfully merging a pull request may close this issue.

7 participants