Patrick762 / hassio-bluetti-bt

Bluetti Integration for Home Assistant
MIT License
49 stars 14 forks source link

[Bug]: Cannot rename entities? #49

Closed TarheelGrad1998 closed 6 months ago

TarheelGrad1998 commented 8 months ago

What happened?

This is working pretty well overall. However, I renamed my entity_ids to be human readable. Things were fine for a while, but then I noticed all my entities were unavailable. When I checked the integration, my renamed entities were unavailable but the original entities were back. So it seems it does not honor entity id changes for some reason.

Version

0.0.11

What device are you seeing the problem on?

EB3A

What bluetooth connection are you using?

ESPHome bluetooth proxy

Have you changed the integration settings?

Yes (Please write down the changed settings in the next step)

Integration settings (if you changed them)

Polling interval changed to 45 seconds.

Relevant log output

No response

Patrick762 commented 8 months ago

Could you try beta version 0.0.17? I couldn't reproduce this behavior

TarheelGrad1998 commented 7 months ago

Hrm, I thought I would be able to reproduce it. It definitely happened before, but I renamed one entity I'm not referencing (DC Input Power) and rebooted, and could not get it to happen.

So I updated to your 0.0.17 and also tried 0.0.19 and in both cases the integration no longer functions for me. I am working again by reinstalling the 0.0.11. Relevant logs from 0.0.19:


Platform bluetti_bt does not generate unique IDs. ID bluetti_eb3a2334000902890_ac_output already exists - ignoring binary_sensor.bluetti_eb3a2334000902890_ac_output
Platform bluetti_bt does not generate unique IDs. ID bluetti_eb3a2334000902890_dc_output already exists - ignoring binary_sensor.bluetti_eb3a2334000902890_dc_output

Unexpected error fetching Bluetti polling coordinator data: argument of type 'int' is not iterable
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 313, in _async_refresh
    self.data = await self._async_update_data()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/bluetti_bt/coordinator.py", line 70, in _async_update_data
    return await self.reader.read_data()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/bluetti_bt/bluetti_bt_lib/bluetooth/device_reader.py", line 105, in read_data
    self.bluetti_device.build_setter_command(
  File "/config/custom_components/bluetti_bt/bluetti_bt_lib/base_devices/BluettiDevice.py", line 55, in build_setter_command
    device_field = next(
                   ^^^^^
  File "/config/custom_components/bluetti_bt/bluetti_bt_lib/base_devices/BluettiDevice.py", line 56, in <genexpr>
    f for f in matches if any(f.address in r for r in self.writable_ranges)
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/bluetti_bt/bluetti_bt_lib/base_devices/BluettiDevice.py", line 56, in <genexpr>
    f for f in matches if any(f.address in r for r in self.writable_ranges)
                              ^^^^^^^^^^^^^^
TypeError: argument of type 'int' is not iterable

Data from coordinator is None. Skipping update for bluettXXXXXXXXXXeb3a2334000902890_total_battery_percent
Data from coordinator is None. Skipping update for bluettXXXXXXXXXXeb3a2334000902890_total_battery_voltage
Data from coordinator is None. Skipping update for bluettXXXXXXXXXXeb3a2334000902890_ac_input_voltage
Data from coordinator is None. Skipping update for bluettXXXXXXXXXXeb3a2334000902890_internal_dc_input_voltage
Data from coordinator is None. Skipping update for bluettXXXXXXXXXXeb3a2334000902890_led_mode
TarheelGrad1998 commented 7 months ago

Just checking in, I'm still running the "old" version with just the one renamed entity, and it has not reverted. I'm not sure what happened the first time, but I'm hesitant to change them all again.

github-actions[bot] commented 6 months ago

This issue was closed because it has been inactive for 14 days since being marked as stale.

TarheelGrad1998 commented 6 months ago

Well that was mighty nice of you. I guess I'll update to the latest beta at some point and hope it's working now.