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

Renault integration: wrong plug_state #124682

Closed
tmenguy opened this issue Aug 27, 2024 · 8 comments · Fixed by #125421
Closed

Renault integration: wrong plug_state #124682

tmenguy opened this issue Aug 27, 2024 · 8 comments · Fixed by #125421
Assignees

Comments

@tmenguy
Copy link
Contributor

tmenguy commented Aug 27, 2024

The problem

Hi,

Lately I have some inconsistency between the plus sensor and the plug state one (vehicle : Twingo eTech), and the integration having issues (like no refresh of the sensor).
Seems there was some changes on the Renault side.

See some logs below but in a nutshell:
File "/usr/local/lib/python3.12/site-packages/renault_api/kamereon/models.py", line 384, in get_plug_status
raise exceptions.KamereonException(
renault_api.kamereon.exceptions.KamereonException: Unable to convert 3 to PlugState.

seems to be in the renault API library.
Hope this help

BR
Thomas

What version of Home Assistant Core has the issue?

core-2024.8.3

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Renault

Link to integration documentation on our website

https://www.home-assistant.io/integrations/renault/

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 258, in _handle_refresh_interval
    await self._async_refresh(log_failures=True, scheduled=True)
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 453, in _async_refresh
    self.async_update_listeners()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 168, in async_update_listeners
    update_callback()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 533, in _handle_coordinator_update
    self.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1005, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1130, in _async_write_ha_state
    self.__async_calculate_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1067, in __async_calculate_state
    state = self._stringify_state(available)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1011, in _stringify_state
    if (state := self.state) is None:
                 ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 542, in state
    value = self.native_value
            ^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/renault/sensor.py", line 91, in native_value
    return self.entity_description.value_lambda(self)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/renault/sensor.py", line 109, in _get_plug_state_formatted
    plug_status = data.get_plug_status() if data else None
                  ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/renault_api/kamereon/models.py", line 384, in get_plug_status
    raise exceptions.KamereonException(
renault_api.kamereon.exceptions.KamereonException: Unable to convert `3` to PlugState.

Additional information

No response

@home-assistant
Copy link

Hey there @epenet, mind taking a look at this issue as it has been labeled with an integration (renault) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of renault can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Renames the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign renault Removes the current integration label and assignees on the issue, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


renault documentation
renault source
(message by IssueLinks)

@epenet
Copy link
Contributor

epenet commented Aug 27, 2024

See hacf-fr/renault-api#1262

@epenet epenet added the waiting-for-upstream We're waiting for a change upstream label Aug 27, 2024
@epenet
Copy link
Contributor

epenet commented Aug 29, 2024

@tmenguy you can open a PR to bump the dependency to v0.2.6 and adjust the sensor accordingly.

@epenet epenet removed the waiting-for-upstream We're waiting for a change upstream label Aug 29, 2024
@tmenguy
Copy link
Contributor Author

tmenguy commented Aug 29, 2024

yes I know, never did a PR on homeassitant core directly ... seems a bit daunting :)

@epenet
Copy link
Contributor

epenet commented Sep 2, 2024

The PR to bump the dependency has been merged.
Now all is left is to add the new values to the options and to the string.
It should be straightforward... give it a go!

@tmenguy
Copy link
Contributor Author

tmenguy commented Sep 6, 2024

Ok I'll try then :) I have an Hass setup ...any special stuff I have to do to send the pull request?

@epenet
Copy link
Contributor

epenet commented Sep 6, 2024

You can look at epenet@a2372c0 for a sample

@tmenguy
Copy link
Contributor Author

tmenguy commented Sep 6, 2024

@epenet I completely missed your example ... would have been quicker :) I do hope what I have done is comparable :)

epenet pushed a commit that referenced this issue Sep 7, 2024
* Added PlugState 3, that is coming with renault-api 0.2.7, it fixes #124682 HA ticket

* Added PlugState 3, that is coming with renault-api 0.2.7, it fixes #124682 HA ticket
frenck pushed a commit that referenced this issue Sep 16, 2024
* Added PlugState 3, that is coming with renault-api 0.2.7, it fixes #124682 HA ticket

* Added PlugState 3, that is coming with renault-api 0.2.7, it fixes #124682 HA ticket
bealex pushed a commit to DevPocket/homeassistant-core that referenced this issue Sep 16, 2024
* Added PlugState 3, that is coming with renault-api 0.2.7, it fixes home-assistant#124682 HA ticket

* Added PlugState 3, that is coming with renault-api 0.2.7, it fixes home-assistant#124682 HA ticket
JakeMartin-ICL pushed a commit to JakeMartin-ICL/home-assistant that referenced this issue Sep 21, 2024
* Added PlugState 3, that is coming with renault-api 0.2.7, it fixes home-assistant#124682 HA ticket

* Added PlugState 3, that is coming with renault-api 0.2.7, it fixes home-assistant#124682 HA ticket
@github-actions github-actions bot locked and limited conversation to collaborators Oct 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
2 participants