Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Peblar - CoolBlue BlueBuilt #134022

Closed
cafferata opened this issue Dec 26, 2024 · 34 comments
Closed

Peblar - CoolBlue BlueBuilt #134022

cafferata opened this issue Dec 26, 2024 · 34 comments
Assignees
Milestone

Comments

@cafferata
Copy link

cafferata commented Dec 26, 2024

The problem

I noticed the Known Limitations section in the Peblar release notes:

Peblar is also sold as white-label products, like the CoolBlue BlueBuilt. This integration is tested with the Peblar branded products, and it is unknown if it works with white-label products.

Coincidentally, I have a CoolBlue BlueBuilt charging station and would be happy to assist with testing. While setting it up, I encountered an “Unexpected error,” and the log details weren’t very clear to me. See the traceback below.

If it’s helpful, I can run additional tests or share more details to support troubleshooting or development. Let me know how I can assist!

What version of Home Assistant Core has the issue?

2025.1.0b2

What was the last working version of Home Assistant Core?

NA, new integration added in this release

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Peblar

Link to integration documentation on our website

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

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/components/peblar/config_flow.py", line 47, in async_step_user
    info = await peblar.system_information()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/peblar/peblar.py", line 230, in system_information
    return PeblarSystemInformation.from_json(result)
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^
  File "<string>", line 231, in __mashumaro_from_json__
mashumaro.exceptions.MissingField: Field "hardware_uk_compliant" of type bool is missing in PeblarSystemInformation instance

Additional information

No response

@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)

@pieter-1978

This comment was marked as duplicate.

@mathiasmoons
Copy link

Same problem with white-label product

Logger: homeassistant.config_entries
Bron: config_entries.py:640
Eerst voorgekomen: 19:03:08 (2 gebeurtenissen)
Laatst gelogd: 19:03:44

Error setting up entry Peblar for peblar
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 640, in __async_setup_with_context
result = await component.async_setup_entry(hass, self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/peblar/init.py", line 50, in async_setup_entry
system_information = await peblar.system_information()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/peblar/peblar.py", line 230, in system_information
return PeblarSystemInformation.from_json(result)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^
File "", line 7, in mashumaro_from_json
mashumaro.exceptions.MissingField: Field "bop_calibration_current_gain_a" of type int is missing in PeblarSystemInformation instance

@frenck
Copy link
Member

frenck commented Jan 2, 2025

@mathiasmoons Which versions are installed on your Peblar unit?

@mathiasmoons
Copy link

@frenck
Schermafbeelding 2025-01-02 192631

@frenck
Copy link
Member

frenck commented Jan 2, 2025

@mathiasmoons Hmm that firmware version will indeed output something different (and isn't usable with this integration for sure) Is that the latest firmware version available to you?

@pieter-1978
Copy link

@frenck , I have same issue as @mathiasmoons but I have the normal Peblar Home with the latest firmware:
IMG_2921

@frenck
Copy link
Member

frenck commented Jan 2, 2025

@pieter-1978 on the bop_calibration_current_gain_a field as well? That seems odd if you have normal Peblar. Which Peblar do you have? Peblar Home... yeah I have that one too 🤷

Nevertheless, issues from @mathiasmoons are different in a way, that firmware 1.6 introduced the API this integration relies on; and he is on 1.5

@pieter-1978
Copy link

@frenck , you are right🙈 mine is a bit different indeed. I do have the Peblar Home.

Below the log;

homeassistant.components.peblar] Unexpected exception
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/peblar/config_flow.py", line 95, in async_step_reconfigure
info = await peblar.system_information()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/peblar/peblar.py", line 230, in system_information
return PeblarSystemInformation.from_json(result)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^
File "", line 231, in mashumaro_from_json
mashumaro.exceptions.MissingField: Field "hardware_uk_compliant" of type bool is missing in PeblarSystemInformation instance
mashumaro.exceptions.MissingField: Field "hardware_uk_compliant" of type bool is missing in PeblarSystemInformation instance

@mathiasmoons
Copy link

@frenck, I was able to update the firmware to 1.6.2
but I get the following error

Logger: homeassistant.config_entries
Bron: config_entries.py:640
Eerst voorgekomen: 20:15:31 (1 gebeurtenissen)
Laatst gelogd: 20:15:31

Error setting up entry Peblar for peblar
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 640, in __async_setup_with_context
result = await component.async_setup_entry(hass, self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/peblar/init.py", line 50, in async_setup_entry
system_information = await peblar.system_information()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/peblar/peblar.py", line 230, in system_information
return PeblarSystemInformation.from_json(result)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^
File "", line 231, in mashumaro_from_json
mashumaro.exceptions.MissingField: Field "hardware_uk_compliant" of type bool is missing in PeblarSystemInformation instance

@frenck frenck added this to the 2025.1.0 milestone Jan 2, 2025
@frenck frenck mentioned this issue Jan 2, 2025
19 tasks
@frenck
Copy link
Member

frenck commented Jan 2, 2025

I've opened a PR to mitigate the missing hardware_uk_compliant field in the response.

Pull request: #134486

I'm pretty sure this isn't the last thing we discover; once it is available in beta, I'll do a shout-out here as I could use some help with testing against more devices. 🙏

../Frenck

@frenck
Copy link
Member

frenck commented Jan 2, 2025

@cafferata @mathiasmoons @pieter-1978 Can you please try again with Home Assistant 2025.1.0b7?

../Frenck

@pieter-1978
Copy link

Hi @frenck , works now, looks great I must say!

I am currently using the Peblar by using the Rest API but will move to this integration later.

I quickly checked the functions and the only thing I see missing is a ON/OFF switch to start/stop the charging.

The slider you made for the “charge current limit” goes from 6A~16A. In order to stop the charging you must go below 6A.

It would be great if we can have a switch where “OFF” is 0A and “ON” the set value of the “charge current limit”.

@pieter-1978
Copy link

@frenck , forgot to mention; the value of “ChargeCurrentLimitActual” is missing as well. Not the end of the world but sometimes interesting to monitor👍

@frenck
Copy link
Member

frenck commented Jan 2, 2025

I quickly checked the functions and the only thing I see missing is a ON/OFF switch to start/stop the charging.

This is actually something I want to pick up with Peblar. It sounds odd to set it to 0A to turn off charging; especially if I make it a switch, I will not be able to restore it to the previous value once the switch is turned on again.

IMHO, this should be functionality in the API from Peblar directly.

@pieter-1978
Copy link

I quickly checked the functions and the only thing I see missing is a ON/OFF switch to start/stop the charging.

This is actually something I want to pick up with Peblar. It sounds odd to set it to 0A to turn off charging; especially if I make it a switch, I will not be able to restore it to the previous value once the switch is turned on again.

IMHO, this should be functionality in the API from Peblar directly.

Agree with you, it is indeed strange they did not implement this in the API.
But how can we stop the charge session for the time being?

@frenck
Copy link
Member

frenck commented Jan 2, 2025

But how can we stop the charge session for the time being?

You can't with this integration, just as one can't do it with their own web UI either.

Anyways, let's get back on topic, I want to know if the issue is resolved for the OP ;)

@pieter-1978
Copy link

But how can we stop the charge session for the time being?

You can't with this integration, just as one can't do it with their own web UI either.

Anyways, let's get back on topic, I want to know if the issue is resolved for the OP ;)

😉sorry for going off topic. For me the issue is resolved

@mrVoltrix
Copy link

Hi Frenck,

I also confirm that the integration is working fine here after the last update.

@cafferata
Copy link
Author

Thank you so much for the work you’ve done so far—it’s much appreciated! I’ve just tried Beta 7 and attempted to complete the Peblar installation. Unfortunately, I ran into an issue and received the following stack trace:

Logger: homeassistant.config_entries
Bron: config_entries.py:640

Error setting up entry Peblar for peblar
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 640, in __async_setup_with_context
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/peblar/__init__.py", line 51, in async_setup_entry
    api = await peblar.rest_api(enable=True, access_mode=AccessMode.READ_WRITE)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/peblar/peblar.py", line 124, in rest_api
    user = await self.user_configuration()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/peblar/peblar.py", line 235, in user_configuration
    return PeblarUserConfiguration.from_json(result)
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^
  File "<string>", line 4, in __mashumaro_from_json__
  File "/usr/local/lib/python3.13/site-packages/peblar/models.py", line 414, in __pre_deserialize__
    d["BopSourceParameters"] = orjson.loads(d.get("BopSourceParameters", "{}"))
                               ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
orjson.JSONDecodeError: Input is a zero-length, empty document: line 1 column 1 (char 0)

I’ve double-checked the API settings and everything appears to be configured correctly. Please find a screenshot attached for your reference. Let me know if you need any additional information to troubleshoot this.

Screenshot 2025-01-03 at 08 17 24

Thanks again for all your efforts! 👏🏻

PS. I should have time to debug the Python package this weekend. Let me know if there’s anything specific you’d like me to focus on.

@mathiasmoons
Copy link

@frenck I also upgraded to beta 7, but I get the following log.

Logger: homeassistant.components.peblar
Bron: helpers/update_coordinator.py:379
integratie: Peblar (documentatie, problemen)
Eerst voorgekomen: 08:42:17 (14 gebeurtenissen)
Laatst gelogd: 08:46:44

Unexpected error fetching Peblar Peblar version data
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 133, in _async_update_data
available=await self.peblar.available_versions(),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/peblar/peblar.py", line 190, in available_versions
return PeblarVersions.from_json(result)
~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^
File "", line 8, in mashumaro_from_json
mashumaro.exceptions.MissingField: Field "customization" of type str is missing in PeblarVersions instance

@frenck
Copy link
Member

frenck commented Jan 3, 2025

@mathiasmoons Interesting to see you apparently have no customizations? Could you maybe post a screenshot of your firmware version page from the chargers web UI?

@frenck
Copy link
Member

frenck commented Jan 3, 2025

Oh never mind, you already did earlier. Interesting. I will see if I can adopt to that. 👍

@frenck frenck mentioned this issue Jan 3, 2025
19 tasks
@frenck
Copy link
Member

frenck commented Jan 3, 2025

I've addressed both issue reported above in this PR bump:

#134524

I've marked it for beta, will let you guys know when it is available in beta for testing again.

../Frenck

@frenck
Copy link
Member

frenck commented Jan 3, 2025

Alright, @cafferata @mathiasmoons Home Assistant 2025.1.0b8 is available, which contains fixes for both reported issues. Giving that a shot would be greatly appreciated 🙏

../Frenck

@mathiasmoons
Copy link

I installed Beta 8, but I am receiving the following log.

Logger: homeassistant.components.peblar
Bron: helpers/update_coordinator.py:379
integratie: Peblar (documentatie, problemen)
Eerst voorgekomen: 11:53:36 (20 gebeurtenissen)
Laatst gelogd: 12:10:28

Unexpected error fetching Peblar Peblar version data
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 133, in _async_update_data
available=await self.peblar.available_versions(),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/peblar/peblar.py", line 190, in available_versions
return PeblarVersions.from_json(result)
~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^
File "", line 16, in mashumaro_from_json
mashumaro.exceptions.MissingField: Field "firmware" of type str is missing in PeblarVersions instance

For context, this charger is managed and provided by my employer through a lease. I contacted them about the latest software, and they informed me that I can update the firmware myself (which I did, upgrading to version 1.6.2). However, they also mentioned that the Customization firmware cannot be updated because it is non-standard.(?)

image

@frenck
Copy link
Member

frenck commented Jan 3, 2025

@mathiasmoons Aah check, thanks for that context. It thus doesn't have any upstream update capabilities 👍 That I can work with.

@cafferata
Copy link
Author

cafferata commented Jan 3, 2025

Logger: homeassistant.components.peblar
Bron: helpers/update_coordinator.py:379

Unexpected error fetching Peblar Peblar version data
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 133, in _async_update_data
    available=await self.peblar.available_versions(),
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/peblar/peblar.py", line 190, in available_versions
    return PeblarVersions.from_json(result)
           ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^
  File "<string>", line 16, in __mashumaro_from_json__
mashumaro.exceptions.MissingField: Field "firmware" of type str is missing in PeblarVersions instance

PS. I now see that this is the same stack trace as @mathiasmoons. 🤓

@mathiasmoons
Copy link

@frenck, Does that mean it is impossible?

@frenck
Copy link
Member

frenck commented Jan 3, 2025

@frenck, Does that mean it is impossible?

It is definitely doable, it just means that you won't have update notifications in Home Assistant. I'm not sure if I'm able to fix this before the final release, but will keep working on it. We are making progress 😄

@frenck
Copy link
Member

frenck commented Jan 4, 2025

Ok, yet again, processed the above warnings and bumped the Home Assistant end. This last bump will be included in the next release (2025.1.1).

../Frenck

@cafferata
Copy link
Author

Thanks, @frenck! I’ll keep an eye out for the next release (2025.1.1) and will test the fix as soon as it’s available. I’ll be sure to report back with the results.

@cafferata
Copy link
Author

I just noticed the 2025.1.1 release is out, so I tested it right away. I’m happy to report that the configuration was successful! 🎉 Please find a screenshot attached for reference.

Screenshot 2025-01-07 at 09 21 46

Is there anything specific you’d like me to test further? Also, would you like me to prepare a PR to remove the Known limitations for white-label products like the CoolBlue BlueBuilt, or would you prefer to handle that yourself?

Thanks again for all your work on this—it’s much appreciated!

@frenck
Copy link
Member

frenck commented Jan 11, 2025

I just noticed the 2025.1.1 release is out, so I tested it right away. I’m happy to report that the configuration was successful! 🎉

Nice! 🎉

s there anything specific you’d like me to test further? Also, would you like me to prepare a PR to remove the Known limitations for white-label products like the CoolBlue BlueBuilt, or would you prefer to handle that yourself?

I'll pick that up, there is some small room for improvement (Peblar was kind enough to provide me more context). I want to add virtual integrations for it as well.

Thanks again for all your work on this—it’s much appreciated!

You're welcome ❤️

../Frenck

@frenck frenck closed this as completed Jan 11, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

5 participants