jseidl / hass-magic_areas

Areas with batteries included for Home Assistant
MIT License
275 stars 28 forks source link

[Bug]: Area aware media player don`t use the default name for the room #406

Closed Jhonattan-Souza closed 3 days ago

Jhonattan-Souza commented 2 months ago

System Health details

System Information

version core-2024.9.1
installation_type Home Assistant OS
dev false
hassio true
docker true
user root
virtualenv false
python_version 3.12.4
os_name Linux
os_version 6.6.46-haos
arch x86_64
timezone America/Sao_Paulo
config_dir /config
Home Assistant Community Store GitHub API | ok -- | -- GitHub Content | ok GitHub Web | ok HACS Data | ok GitHub API Calls Remaining | 5000 Installed Version | 2.0.1 Stage | running Available Repositories | 1398 Downloaded Repositories | 27
Home Assistant Cloud logged_in | true -- | -- subscription_expiration | July 4, 2025 at 21:00 relayer_connected | true relayer_region | us-east-1 remote_enabled | true remote_connected | true alexa_enabled | true google_enabled | true remote_server | us-east-1-1.ui.nabu.casa certificate_status | ready instance_id | db6127394a664ab3ac6845261f204913 can_reach_cert_server | ok can_reach_cloud_auth | ok can_reach_cloud | ok
Home Assistant Supervisor host_os | Home Assistant OS 13.1 -- | -- update_channel | stable supervisor_version | supervisor-2024.08.0 agent_version | 1.6.0 docker_version | 26.1.4 disk_total | 116.7 GB disk_used | 26.8 GB healthy | true supported | true host_connectivity | true supervisor_connectivity | true ntp_synchronized | true virtualization | board | generic-x86-64 supervisor_api | ok version_api | ok installed_addons | MariaDB (2.7.1), Network UPS Tools (0.13.1), ESPHome (2024.8.3), Mosquitto broker (6.4.1), Grocy (0.21.0), Samba share (12.3.2), Zigbee2MQTT (1.40.1-1), Matter Server (6.4.2), OneDrive Backup (2.3.1), Music Assistant Server (beta) (2.3.0b19), openWakeWord (1.10.0), Barcode Buddy for Grocy (dev-docker-based), NetDaemon V4 (.NET 8) (24.35.1), PS5 MQTT (1.4.0), LocalDeck Configurator (0.6), Matterbridge (2.9.0-PSA-121)
Dashboards dashboards | 3 -- | -- resources | 16 views | 11 mode | storage
Recorder oldest_recorder_run | September 1, 2024 at 02:00 -- | -- current_recorder_run | September 7, 2024 at 17:36 estimated_db_size | 3400.44 MiB database_engine | mysql database_version | 10.11.6
Sonoff version | 3.7.3 (e240aaf) -- | -- cloud_online | 1 / 1 local_online | 1 / 1
Xiaomi Miot Auto component_version | 0.7.20 -- | -- can_reach_server | ok can_reach_spec | ok logged_accounts | 1 total_devices | 3

Checklist

Describe the issue

When creating the config for my room, the entity ID is that one:

binary_sensor.magic_areas_presence_tracking_quarto_area_state

But in the logs, the area aware is trying to search for another name

2024-09-07 18:58:58.218 DEBUG (SyncWorker_61) [custom_components.magic_areas.media_player] Area-aware media player: No state found for entity 'binary_sensor.area_quarto' 2024-09-07 18:58:58.218 INFO (SyncWorker_61) [custom_components.magic_areas.media_player] No areas active. Ignoring.

is it intentional? Didn`t find in the docs

Reproduction steps

1. 2. 3. ...

Debug logs

2024-09-07 18:58:58.218 DEBUG (SyncWorker_61) [custom_components.magic_areas.media_player] Area-aware media player: No state found for entity 'binary_sensor.area_quarto'
2024-09-07 18:58:58.218 INFO (SyncWorker_61) [custom_components.magic_areas.media_player] No areas active. Ignoring.

Diagnostics dump

No response

jseidl commented 2 months ago

This is definitely a bug from when the entity names were changed. Thanks for reporting.

jseidl commented 2 months ago

A fix is out on https://github.com/jseidl/hass-magic_areas/pull/414. Haven't tested yet. Will merge after testing. Meanwhile if you'd like to test, just replace the media_player.py file from this PR's branch.

jseidl commented 1 month ago

Just updating this thread, I've started writing the test for this but haven't been able to finish yet, probably by next weekend I'll be able to finish this work and release a hotfix.

jseidl commented 1 month ago

Hey @Jhonattan-Souza, just updating you on this issue. Still working on these tests, just been having very little free-time lately

Thank you for your patience!

Jhonattan-Souza commented 1 month ago

Hey @Jhonattan-Souza, just updating you on this issue. Still working on these tests, just been having very little free-time lately

Thank you for your patience!

No problem @jseidl , I have changed the name of the entity manually to match the one in the log message. Take your time!