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

Will not add/show powertag devices in home assistant. #38

Open
lillson opened this issue Jan 21, 2025 · 5 comments
Open

Will not add/show powertag devices in home assistant. #38

lillson opened this issue Jan 21, 2025 · 5 comments
Labels
bug Something isn't working

Comments

@lillson
Copy link

lillson commented Jan 21, 2025

Logger: homeassistant.components.sensor
Kilde: helpers/entity_platform.py:366
integrasjon: Sensor (dokumentasjon, problemer)
Første forekomst: 00:14:32 (1 forekomster)
Sist logget: 00:14:32

Error while setting up powertag_gateway platform for sensor
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 366, in _async_setup_platform
await asyncio.shield(awaitable)
File "/config/custom_components/powertag_gateway/sensor.py", line 79, in async_setup_entry
entities = setup_entities(hass, config_entry, sensors)
File "/config/custom_components/powertag_gateway/entity_base.py", line 196, in setup_entities
gateway_device = gateway_device_info(client, presentation_url)
File "/config/custom_components/powertag_gateway/entity_base.py", line 25, in gateway_device_info
manufacturer=client.manufacturer(),
~~~~~~~~~~~~~~~~~~~^^
File "/config/custom_components/powertag_gateway/schneider_modbus.py", line 776, in manufacturer
return self.__read_string(0x009F, 16, GATEWAY_SLAVE_ID, 32)
~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/powertag_gateway/schneider_modbus.py", line 887, in __read_string
return bytes.decode(filtered_ascii_bytes)
~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80 in position 0: invalid start byte

@lillson lillson changed the title Will not add/show power tag devices in home assistant. Will not add/show powertag devices in home assistant. Jan 21, 2025
@Breina
Copy link
Owner

Breina commented Jan 24, 2025

It's failing to read the manufacturer of one of your devices. I may have wrongly assumed it would use utf-8 encoding. Yours seems to be the first device that uses a special character.

Please inform me the exact name of the manufacturer of this device (can't know for certain which one it is, but the first letter is special). If it's Ç, this will be an easy fix.

@Breina Breina added the bug Something isn't working label Jan 24, 2025
@lillson
Copy link
Author

lillson commented Jan 25, 2025

I have a "PAS600" panel server and six "A9MEM1521" schneider electric powertags.

@Breina
Copy link
Owner

Breina commented Jan 28, 2025

Split to: pymodbus-dev/pymodbus#2555

@lillson I can't fix this for you right away, so here's a temporary workaround for you:

  1. Go to config/custom_components/powertag_gateway/schneider_modbus.py
  2. Find def manufacturer(self) -> str | None: on line 772
  3. Make it look like this:
    Image

You will have to reapply this fix every time you update the integration I'm afraid. Will keep this issue open until a proper fix is found.

@samdaenen
Copy link

Bump +1

@Breina
Copy link
Owner

Breina commented Feb 24, 2025

@samdaenen this still an issue for you?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants