koenhendriks / ha-button-plus

Home Assistant integration platform for Button+
GNU General Public License v3.0
16 stars 7 forks source link

HASS Entities seem to move between HASS devices. #67

Open IBlackI opened 4 months ago

IBlackI commented 4 months ago

Using HASS to indicate HomeAssistant.

Describe the bug HASS Entities seem to move between HASS devices.

To Reproduce Steps to reproduce the behavior: Exact steps unknown, these are the steps as I remember taking them.

  1. Factory Reset button+
  2. Add ha-button-plus integration to HASS
  3. Add button+ in ha-button-plus integration.
  4. Use the button+ HASS device and HASS label entity in an automation.
  5. Enable debug logging.
  6. Reboot HASS

Expected behavior A clear and concise description of what you expected to happen.

HASS entities created by the integration remain in the initial HASS device created by the integration

Screenshots If applicable, add screenshots from Home assistant to help explain your problem.

The naming of the BAR modules does not seem correct. image

One of the BAR module HASS devices was linked to a few automations to update the label and handle button press. It is still visible that this one was used in the automations. image

However the actual HASS entities used in the automation seem to have moved to a different HASS device. This HASS device now has the entities of all bar modules. image

Additional context and/or debug log. Software Version
HASS Core 2024.7.4
HASS Supervisor 2024.06.2
Operating System 12.4
HASS Frontend 20240710.0
Button+ firmware 1.13
HACS 1.34.0
ha-button-plus 0.0.15

Logging:

2024-08-03 15:07:23.543 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration button_plus which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2024-08-03 15:07:30.902 WARNING (MainThread) [homeassistant.helpers.frame] Detected that custom integration 'hacs' calls hass.http.register_static_path which is deprecated because it does blocking I/O in the event loop, instead call `await hass.http.async_register_static_paths([StaticPathConfig("/hacsfiles/frontend", "/config/custom_components/hacs/hacs_frontend_experimental", False)])`; This function will be removed in 2025.7 at custom_components/hacs/frontend.py, line 49: hass.http.register_static_path(, please create a bug report at https://github.com/hacs/integration/issues
2024-08-03 15:07:30.914 WARNING (MainThread) [homeassistant.helpers.frame] Detected that custom integration 'hacs' calls hass.http.register_static_path which is deprecated because it does blocking I/O in the event loop, instead call `await hass.http.async_register_static_paths([StaticPathConfig("/hacsfiles/iconset.js", "/config/custom_components/hacs/iconset.js", True)])`; This function will be removed in 2025.7 at custom_components/hacs/frontend.py, line 57: hass.http.register_static_path(, please create a bug report at https://github.com/hacs/integration/issues
2024-08-03 15:07:30.925 WARNING (MainThread) [homeassistant.helpers.frame] Detected that custom integration 'hacs' accesses hass.components.frontend. This is deprecated and will stop working in Home Assistant 2024.9, it should be updated to import functions used from frontend directly at custom_components/hacs/frontend.py, line 68: hass.components.frontend.async_register_built_in_panel(, please create a bug report at https://github.com/hacs/integration/issues
2024-08-03 15:07:30.943 WARNING (MainThread) [homeassistant.helpers.frame] Detected that custom integration 'hacs' calls hass.http.register_static_path which is deprecated because it does blocking I/O in the event loop, instead call `await hass.http.async_register_static_paths([StaticPathConfig("/hacsfiles", "/config/www/community", True)])`; This function will be removed in 2025.7 at custom_components/hacs/base.py, line 1162: self.hass.http.register_static_path(, please create a bug report at https://github.com/hacs/integration/issues
2024-08-03 15:07:33.629 DEBUG (MainThread) [custom_components.button_plus] Button+ init got new device entry! <built-in method title of str object at 0x7f00c37a0120>
2024-08-03 15:07:33.640 DEBUG (MainThread) [custom_components.button_plus] New hub with config <custom_components.button_plus.button_plus_api.model_v1_12.DeviceConfiguration object at 0x7f00a7679c70>
2024-08-03 15:07:33.640 DEBUG (MainThread) [custom_components.button_plus.button_plus_api] Initialize Button+ local API client
2024-08-03 15:07:33.643 DEBUG (MainThread) [custom_components.button_plus.button_plus_api] Filter all 4 connectors by type (<ConnectorType.DISPLAY: 2>,)
2024-08-03 15:07:33.643 WARNING (MainThread) [custom_components.button_plus] Create display module from btn_45a50c
2024-08-03 15:07:33.643 DEBUG (MainThread) [custom_components.button_plus.button_plus_api] Filter all 4 connectors by type (<ConnectorType.BAR: 1>,)
2024-08-03 15:07:33.644 WARNING (MainThread) [custom_components.button_plus] Create bar module from btn_45a50c with connector '1'
2024-08-03 15:07:33.645 WARNING (MainThread) [custom_components.button_plus] Create bar module from btn_45a50c with connector '2'
2024-08-03 15:07:33.645 WARNING (MainThread) [custom_components.button_plus] Create bar module from btn_45a50c with connector '3'
2024-08-03 15:07:33.647 INFO (MainThread) [custom_components.button_plus] Hub btn_45a50c created with 3 bar modules
2024-08-03 15:07:33.648 DEBUG (MainThread) [custom_components.button_plus.coordinator] Initial data fetch from coordinator
2024-08-03 15:07:33.648 DEBUG (MainThread) [custom_components.button_plus.coordinator] MQTT subscribed to buttonplus/btn_45a50c/button/+/click
2024-08-03 15:07:33.649 DEBUG (MainThread) [custom_components.button_plus.coordinator] MQTT subscribed to buttonplus/btn_45a50c/button/+/long_press
2024-08-03 15:07:33.649 DEBUG (MainThread) [custom_components.button_plus.coordinator] MQTT subscribed to buttonplus/btn_45a50c/brightness/+
2024-08-03 15:07:33.649 DEBUG (MainThread) [custom_components.button_plus.coordinator] MQTT subscribed to buttonplus/btn_45a50c/page/+
2024-08-03 15:07:33.650 DEBUG (MainThread) [custom_components.button_plus.coordinator] Finished fetching button_plus_coordinator data in 0.002 seconds (success: True)
2024-08-03 15:07:33.694 DEBUG (MainThread) [custom_components.button_plus.button_plus_api] Filter all 4 connectors by type (<ConnectorType.DISPLAY: 2>, <ConnectorType.BAR: 1>)
2024-08-03 15:07:33.695 INFO (MainThread) [custom_components.button_plus.button] Creating button with parameters: 0 Label Btn 0 btn_45a50c
2024-08-03 15:07:33.695 INFO (MainThread) [custom_components.button_plus.button] Creating button with parameters: 1 Label Btn 1 btn_45a50c
2024-08-03 15:07:33.695 INFO (MainThread) [custom_components.button_plus.button] Creating button with parameters: 2 Label Btn 2 btn_45a50c
2024-08-03 15:07:33.695 INFO (MainThread) [custom_components.button_plus.button] Creating button with parameters: 3 Label Btn 3 btn_45a50c
2024-08-03 15:07:33.696 INFO (MainThread) [custom_components.button_plus.button] Creating button with parameters: 4 Label Btn 4 btn_45a50c
2024-08-03 15:07:33.696 INFO (MainThread) [custom_components.button_plus.button] Creating button with parameters: 5 Label Btn 5 btn_45a50c
2024-08-03 15:07:33.696 INFO (MainThread) [custom_components.button_plus.button] Creating button with parameters: 6 Label Btn 6 btn_45a50c
2024-08-03 15:07:33.696 INFO (MainThread) [custom_components.button_plus.button] Creating button with parameters: 7 Label Btn 7 btn_45a50c
2024-08-03 15:07:33.718 DEBUG (MainThread) [custom_components.button_plus.button_plus_api] Filter all 4 connectors by type (<ConnectorType.DISPLAY: 2>, <ConnectorType.BAR: 1>)
2024-08-03 15:07:33.719 INFO (MainThread) [custom_components.button_plus.text] Creating texts with parameters: 0 Label Btn 0 btn_45a50c
2024-08-03 15:07:33.719 INFO (MainThread) [custom_components.button_plus.text] Creating texts with parameters: 1 Label Btn 1 btn_45a50c
2024-08-03 15:07:33.719 INFO (MainThread) [custom_components.button_plus.text] Creating texts with parameters: 2 Label Btn 2 btn_45a50c
2024-08-03 15:07:33.720 INFO (MainThread) [custom_components.button_plus.text] Creating texts with parameters: 3 Label Btn 3 btn_45a50c
2024-08-03 15:07:33.720 INFO (MainThread) [custom_components.button_plus.text] Creating texts with parameters: 4 Label Btn 4 btn_45a50c
2024-08-03 15:07:33.721 INFO (MainThread) [custom_components.button_plus.text] Creating texts with parameters: 5 Label Btn 5 btn_45a50c
2024-08-03 15:07:33.722 INFO (MainThread) [custom_components.button_plus.text] Creating texts with parameters: 6 Label Btn 6 btn_45a50c
2024-08-03 15:07:33.722 INFO (MainThread) [custom_components.button_plus.text] Creating texts with parameters: 7 Label Btn 7 btn_45a50c
2024-08-03 15:07:33.738 DEBUG (MainThread) [custom_components.button_plus.number] Creating number with parameters: btn_45a50c
2024-08-03 15:07:34.874 WARNING (MainThread) [homeassistant.components.mqtt] The 'schema' option is deprecated, please remove it from your configuration
2024-08-03 15:07:43.243 WARNING (MainThread) [homeassistant.helpers.frame] Detected that custom integration 'hacs' accesses hass.helpers.event. This is deprecated and will stop working in Home Assistant 2024.11, it should be updated to import functions used from event directly at custom_components/hacs/base.py, line 642: self.hass.helpers.event.async_track_time_interval(, please create a bug report at https://github.com/hacs/integration/issues
2024-08-03 15:07:58.230 WARNING (MainThread) [homeassistant.core] Something is blocking Home Assistant from wrapping up the start up phase. We're going to continue anyway. Please report the following info at https://github.com/home-assistant/core/issues: intent, cover, button_plus, light, button_plus.number, mqtt.select, hacs.update, frontend, sun, energy.sensor, person, analytics, bluetooth, stt, input_boolean, google_translate, zone, config, tag, application_credentials, hacs, cloud, counter, button_plus.button, mobile_app, update, history, template, shopping_list, network, mqtt.sensor, ffmpeg, acv.sensor, mqtt.cover, button, image_upload, input_select, hassio.update, blueprint, vacuum, lovelace, stream, homeassistant, input_number, mqtt.light, auth, hassio.binary_sensor, select, shopping_list.todo, mobile_app.binary_sensor, time_date.sensor, script, automation, todo, schedule, mqtt.binary_sensor, device_automation, text, tts, input_button, input_datetime, energy, mobile_app.sensor, websocket_api, binary_sensor, webhook, onboarding, zeroconf, device_tracker, trace, mqtt.switch, dhcp, mobile_app.device_tracker, camera, system_log, switch, mqtt, backup, notify, mobile_app.notify, lock, search, mqtt.vacuum, api, mqtt.number, ssdp, logbook, assist_pipeline, persistent_notification, mqtt.lock, radio_browser, wake_word, button_plus.text, repairs, scene, cloud.tts, diagnostics, template.sensor, recorder, logger, file_upload, timer, map, hacs.sensor, met.weather, number, hardware, mqtt.update, hassio, met, media_source, mqtt.camera, hassio.sensor, default_config, system_health, sun.sensor, my, conversation, http, sensor, usb, weather, google_translate.tts, input_text, mqtt.button, homeassistant_alerts, homeassistant.scene The system is waiting for tasks: {<Task pending name='Task-1566' coro=<HacsBase.startup_tasks() running at /config/custom_components/hacs/base.py:687> wait_for=<_GatheringFuture pending cb=[Task.task_wakeup()]> cb=[set.remove()]>}
2024-08-03 15:08:03.751 DEBUG (SyncWorker_5) [custom_components.button_plus.number] Update Brightness mini display (attr_name: brightness-mini) (unique: brightness_mini-btn_45a50c)
2024-08-03 15:08:03.771 DEBUG (SyncWorker_6) [custom_components.button_plus.number] Update Brightness large display (attr_name: brightness-large) (unique: brightness_large-btn_45a50c)
2024-08-03 15:08:33.750 DEBUG (SyncWorker_7) [custom_components.button_plus.number] Update Brightness mini display (attr_name: brightness-mini) (unique: brightness_mini-btn_45a50c)
2024-08-03 15:08:33.753 DEBUG (SyncWorker_5) [custom_components.button_plus.number] Update Brightness large display (attr_name: brightness-large) (unique: brightness_large-btn_45a50c)
2024-08-03 15:08:33.873 DEBUG (MainThread) [custom_components.button_plus.text] ButtonPlus label update for text.label_btn_45a50c_7
2024-08-03 15:08:33.873 DEBUG (MainThread) [custom_components.button_plus.text] ButtonPlus label update to buttonplus/btn_45a50c/button/7/label with new value: UIT
IBlackI commented 4 months ago

Also tagging @scspijker since he seems to be actively working / using the addon.

Speculation: The addon creates the entities when starting up and this procedure does not match the one used when initializing a new button+ OR The addon always tries to create new entities / devices which causes automations to point at device id's which no longer exist.

IBlackI commented 4 months ago

Interesting to note is that the automation still works. It still detects the entity being triggered. Yet when viewing the automation in homeassistant it knows which enitity it is supposed to be, but won't show it because the device ID is not correct. image