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

Peblar integration cannot initialise #135885

Closed
PietSmits opened this issue Jan 17, 2025 · 5 comments · Fixed by #136329
Closed

Peblar integration cannot initialise #135885

PietSmits opened this issue Jan 17, 2025 · 5 comments · Fixed by #136329
Assignees

Comments

@PietSmits
Copy link

The problem

The Peblar integration has suddenly stopped working after switching the system to "scheduled charging". I wanted to charge the EV with cheap current overnight so I entered a schedule in the Peblar, plugged in the car and started the charger. The charger is now waiting to start at the set time and the integration now gives the error:
"Field "charge_current_limit_source" of type ChargeLimiter in PeblarEVInterface has invalid value 'Local scheduled charging"

It seems the charger is sending a value that is not expected. The value 'Local scheduled charging" is not mentioned in the documentation for this integration.

What version of Home Assistant Core has the issue?

2025.1.2

What was the last working version of Home Assistant Core?

2025.1.2

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Peblar

Link to integration documentation on our website

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

Diagnostics information

No response

Example YAML snippet

Anything in the logs that might be useful for us?

2025-01-17 22:34:08.377 ERROR (MainThread) [homeassistant.components.peblar] Unexpected error fetching Peblar Peblar meter data
Traceback (most recent call last):
  File "<string>", line 23, in __mashumaro_from_json__
  File "/usr/local/lib/python3.13/enum.py", line 726, in __call__
    return cls.__new__(cls, value)
           ~~~~~~~~~~~^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/enum.py", line 1199, in __new__
    raise ve_exc
ValueError: 'Local scheduled charging' is not a valid ChargeLimiter

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 379, in _async_refresh
    self.data = await self._async_update_data()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/peblar/coordinator.py", line 81, in handler
    return await func(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/peblar/coordinator.py", line 157, in _async_update_data
    ev=await self.api.ev_interface(),
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/peblar/peblar.py", line 347, in ev_interface
    return PeblarEVInterface.from_json(result)
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^
  File "<string>", line 25, in __mashumaro_from_json__
mashumaro.exceptions.InvalidFieldValue: Field "charge_current_limit_source" of type ChargeLimiter in PeblarEVInterface has invalid value 'Local scheduled charging'
2025-01-17 22:34:10.430 ERROR (influxdb) [homeassistant] Error doing job: Unclosed client session (None)
2025-01-17 22:34:10.432 ERROR (influxdb) [homeassistant] Error doing job: Unclosed connector (None)
2025-01-17 22:34:57.922 DEBUG (MainThread) [homeassistant.components.peblar] Finished fetching Peblar Peblar user configuration data in 0.090 seconds (success: True)
2025-01-17 22:34:57.925 ERROR (MainThread) [homeassistant.components.peblar] Unexpected error fetching Peblar Peblar meter data
Traceback (most recent call last):
  File "<string>", line 23, in __mashumaro_from_json__
  File "/usr/local/lib/python3.13/enum.py", line 726, in __call__
    return cls.__new__(cls, value)
           ~~~~~~~~~~~^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/enum.py", line 1199, in __new__
    raise ve_exc
ValueError: 'Local scheduled charging' is not a valid ChargeLimiter

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 379, in _async_refresh
    self.data = await self._async_update_data()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/peblar/coordinator.py", line 81, in handler
    return await func(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/peblar/coordinator.py", line 157, in _async_update_data
    ev=await self.api.ev_interface(),
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/peblar/peblar.py", line 347, in ev_interface
    return PeblarEVInterface.from_json(result)
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^
  File "<string>", line 25, in __mashumaro_from_json__
mashumaro.exceptions.InvalidFieldValue: Field "charge_current_limit_source" of type ChargeLimiter in PeblarEVInterface has invalid value 'Local scheduled charging'
2025-01-17 22:34:57.931 DEBUG (MainThread) [homeassistant.components.peblar] Finished fetching Peblar Peblar meter data in 0.101 seconds (success: False)
2025-01-17 22:34:58.460 DEBUG (MainThread) [homeassistant.components.peblar] Finished fetching Peblar Peblar version data in 0.628 seconds (success: True)

Additional information

I tried the diagnostic, but it only generated the same that is already in the logs.

@home-assistant
Copy link

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

Code owner commands

Code owners of peblar 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 peblar 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)


peblar documentation
peblar source
(message by IssueLinks)

@itavero
Copy link

itavero commented Jan 21, 2025

FYI: this of course only occurs when charging is currently not allowed according to the schedule.

I do see this particular value mentioned in the REST API documentation.

@itavero
Copy link

itavero commented Jan 22, 2025

Noticed that the Peblar Python library actually had an incorrect string constant for the Local Scheduled Charging current limiter source (it was missing the charging part). Opened up frenck/python-peblar#47 which updates the value to match the Peblar REST API documentation.

@frenck
Copy link
Member

frenck commented Jan 23, 2025

Thanks for the help there @itavero! I appreciate that a lot.

I have bumped the Home Assistant end as well now, including your fix, and will ship it in the Home Assistant 2025.1.4 patch release!

Sorry for this issue, as this one is totally my fault.

../Frenck

@itavero
Copy link

itavero commented Jan 23, 2025

Thanks for the help there @itavero! I appreciate that a lot.

Glad to help.

Sorry for this issue, as this one is totally my fault.

No worries. We're only human after all. I'm just glad you took the time to make this integration in the first place!

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

Successfully merging a pull request may close this issue.

3 participants