thlucas1 / homeassistantcomponent_spotifyplus

Home Assistant integration for Spotify Player control, services, and soundtouchplus integration support.
MIT License
45 stars 3 forks source link

media_player.spotifyplus_username missing entity id #35

Closed gmartenscb closed 2 months ago

gmartenscb commented 2 months ago

System Health details

System Information

version core-2024.7.4
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.31-haos-raspi
arch aarch64
timezone Europe/Amsterdam
config_dir /config
Home Assistant Community Store GitHub API | ok -- | -- GitHub Content | ok GitHub Web | ok GitHub API Calls Remaining | 4970 Installed Version | 1.34.0 Stage | running Available Repositories | 1391 Downloaded Repositories | 12 HACS Data | ok
Home Assistant Cloud logged_in | true -- | -- subscription_expiration | 19 July 2025 at 02:00 relayer_connected | true relayer_region | eu-central-1 remote_enabled | true remote_connected | true alexa_enabled | true google_enabled | true remote_server | eu-central-1-18.ui.nabu.casa certificate_status | ready instance_id | e6c30bf5ff0947c6887d2a4690ea0a30 can_reach_cert_server | ok can_reach_cloud_auth | ok can_reach_cloud | ok
Home Assistant Supervisor host_os | Home Assistant OS 12.4 -- | -- update_channel | stable supervisor_version | supervisor-2024.06.2 agent_version | 1.6.0 docker_version | 26.1.4 disk_total | 458.4 GB disk_used | 7.8 GB healthy | true supported | true host_connectivity | true supervisor_connectivity | true ntp_synchronized | true virtualization | board | yellow supervisor_api | ok version_api | ok installed_addons | Advanced SSH & Web Terminal (18.0.0), Studio Code Server (5.15.0), MariaDB (2.7.1), Samba share (12.3.2)
Dashboards dashboards | 3 -- | -- resources | 5 views | 8 mode | storage
Recorder oldest_recorder_run | 21 July 2024 at 09:42 -- | -- current_recorder_run | 31 July 2024 at 00:31 estimated_db_size | 100.58 MiB database_engine | mysql database_version | 10.11.6
SpotifyPlus integration_version | v1.0.44 -- | -- clients_configured | 1: Gijs (premium) api_endpoint_reachable | ok

Checklist

Describe the issue

If I run watchman after a fresh install of the SpotifyPlus integration, I get a lot of warnings in regards to a missing entity. Not sure how to go about resolving this, or whether it is a bug within the integration.

Let me know if you need any more information, or want me to try a couple of things out.


Watchman report:

-== Watchman Report ==- 

-== Congratulations, all 3 services from your config are available!

-== Missing 1 entity(ies) from 6 found in your config:
+--------------------------------+---------+--------------------------------------------------------------+
| Entity ID                      | State   | Location                                                     |
+--------------------------------+---------+--------------------------------------------------------------+
| media_player.spotifyplus_usern | missing | custom_components/spotifyplus/services.yaml:8,29,57,78,106,1 |
| ame                            |         | 55,204,225,288,327,362,418,481,502,530,558,572,624,666,708,7 |
|                                |         | 36,792,834,848,897,946,995,1026,1081,1119,1157,1195,1238,127 |
|                                |         | 6,1317,1345,1373,1429,1485,1523,1544,1579,1600,1621,1642,166 |
|                                |         | 3,1727,1790,1853,1916,1979,2042,2105,2126,2147,2168,2254,230 |
|                                |         | 5,2356                                                       |
+--------------------------------+---------+--------------------------------------------------------------+

-== Report created on 31 Jul 2024 00:34:42
-== Parsed 16 files in 2.21s., ignored 0 files 
-== Generated in: 0.00s. Validated in: 0.00s.

Reproduction steps

Clean install of the SpotifyPlus integration.

Debug logs

Not much here, but I enabled it and did some media browsing..

<details><summary>Debug logs</summary>

2024-07-31 00:50:03.143 DEBUG (SyncWorker_0) [custom_components.spotifyplus] 'SpotifyPlus Gijs': Update - Integration is powered off; nothing to do
2024-07-31 00:50:04.143 DEBUG (SyncWorker_9) [custom_components.spotifyplus] 'SpotifyPlus Gijs': Update - Integration is powered off; nothing to do
2024-07-31 00:50:05.144 DEBUG (SyncWorker_13) [custom_components.spotifyplus] 'SpotifyPlus Gijs': Update - Integration is powered off; nothing to do
2024-07-31 00:50:06.145 DEBUG (SyncWorker_1) [custom_components.spotifyplus] 'SpotifyPlus Gijs': Update - Integration is powered off; nothing to do
2024-07-31 00:50:07.146 DEBUG (SyncWorker_4) [custom_components.spotifyplus] 'SpotifyPlus Gijs': Update - Integration is powered off; nothing to do
2024-07-31 00:50:08.147 DEBUG (SyncWorker_8) [custom_components.spotifyplus] 'SpotifyPlus Gijs': Update - Integration is powered off; nothing to do
2024-07-31 00:50:09.148 DEBUG (SyncWorker_14) [custom_components.spotifyplus] 'SpotifyPlus Gijs': Update - Integration is powered off; nothing to do
2024-07-31 00:50:10.149 DEBUG (SyncWorker_12) [custom_components.spotifyplus] 'SpotifyPlus Gijs': Update - Integration is powered off; nothing to do
2024-07-31 00:50:11.150 DEBUG (SyncWorker_6) [custom_components.spotifyplus] 'SpotifyPlus Gijs': Update - Integration is powered off; nothing to do
2024-07-31 00:50:12.150 DEBUG (SyncWorker_7) [custom_components.spotifyplus] 'SpotifyPlus Gijs': Update - Integration is powered off; nothing to do
2024-07-31 00:50:13.152 DEBUG (SyncWorker_3) [custom_components.spotifyplus] 'SpotifyPlus Gijs': Update - Integration is powered off; nothing to do
2024-07-31 00:50:14.153 DEBUG (SyncWorker_5) [custom_components.spotifyplus] 'SpotifyPlus Gijs': Update - Integration is powered off; nothing to do
2024-07-31 00:50:15.154 DEBUG (SyncWorker_10) [custom_components.spotifyplus] 'SpotifyPlus Gijs': Update - Integration is powered off; nothing to do
2024-07-31 00:50:16.194 DEBUG (SyncWorker_6) [custom_components.spotifyplus] 'SpotifyPlus Gijs': Update - Integration is powered off; nothing to do
2024-07-31 00:50:17.186 DEBUG (SyncWorker_8) [custom_components.spotifyplus] 'SpotifyPlus Gijs': Update - Integration is powered off; nothing to do
2024-07-31 00:50:18.187 DEBUG (SyncWorker_12) [custom_components.spotifyplus] 'SpotifyPlus Gijs': Update - Integration is powered off; nothing to do
2024-07-31 00:50:19.186 DEBUG (SyncWorker_15) [custom_components.spotifyplus] 'SpotifyPlus Gijs': Update - Integration is powered off; nothing to do
2024-07-31 00:50:20.187 DEBUG (SyncWorker_0) [custom_components.spotifyplus] 'SpotifyPlus Gijs': Update - Integration is powered off; nothing to do
2024-07-31 00:50:21.034 DEBUG (MainThread) [custom_components.spotifyplus] 'SpotifyPlus Gijs': MediaPlayer is browsing main media library index content id 'None'
2024-07-31 00:50:21.049 DEBUG (MainThread) [custom_components.spotifyplus] 'SpotifyPlus Gijs': MediaPlayer is browsing main media library index content id 'None'
2024-07-31 00:50:21.188 DEBUG (SyncWorker_1) [custom_components.spotifyplus] 'SpotifyPlus Gijs': Update - Integration is powered off; nothing to do
2024-07-31 00:50:22.191 DEBUG (SyncWorker_4) [custom_components.spotifyplus] 'SpotifyPlus Gijs': Update - Integration is powered off; nothing to do
2024-07-31 00:50:23.190 DEBUG (SyncWorker_18) [custom_components.spotifyplus] 'SpotifyPlus Gijs': Update - Integration is powered off; nothing to do
2024-07-31 00:50:23.492 DEBUG (MainThread) [custom_components.spotifyplus] 'SpotifyPlus Gijs': MediaPlayer is browsing media node content id 'spotify_user_followed_artists'
2024-07-31 00:50:23.505 DEBUG (SyncWorker_5) [custom_components.spotifyplus.browse_media] 'SpotifyPlus Gijs': querying spotify for Artists Followed
2024-07-31 00:50:24.190 DEBUG (SyncWorker_2) [custom_components.spotifyplus] 'SpotifyPlus Gijs': Update - Integration is powered off; nothing to do
2024-07-31 00:50:25.191 DEBUG (SyncWorker_10) [custom_components.spotifyplus] 'SpotifyPlus Gijs': Update - Integration is powered off; nothing to do
2024-07-31 00:50:26.192 DEBUG (SyncWorker_15) [custom_components.spotifyplus] 'SpotifyPlus Gijs': Update - Integration is powered off; nothing to do
2024-07-31 00:50:27.194 DEBUG (SyncWorker_0) [custom_components.spotifyplus] 'SpotifyPlus Gijs': Update - Integration is powered off; nothing to do
2024-07-31 00:50:28.195 DEBUG (SyncWorker_13) [custom_components.spotifyplus] 'SpotifyPlus Gijs': Update - Integration is powered off; nothing to do
2024-07-31 00:50:29.196 DEBUG (SyncWorker_4) [custom_components.spotifyplus] 'SpotifyPlus Gijs': Update - Integration is powered off; nothing to do
2024-07-31 00:50:30.197 DEBUG (SyncWorker_18) [custom_components.spotifyplus] 'SpotifyPlus Gijs': Update - Integration is powered off; nothing to do
2024-07-31 00:50:31.198 DEBUG (SyncWorker_6) [custom_components.spotifyplus] 'SpotifyPlus Gijs': Update - Integration is powered off; nothing to do
2024-07-31 00:50:32.198 DEBUG (SyncWorker_4) [custom_components.spotifyplus] 'SpotifyPlus Gijs': Update - Integration is powered off; nothing to do

</details>

Diagnostics dump

No response

thlucas1 commented 2 months ago

@gmartenscb Hi, thank you for the information.

I am not familiar with Watchman, but will look into it some more.

Regarding the "Watchman Report" and its "missing entities" ... The media_player.spotifyplus_username entity_id that is mentioned in the report corresponds to example: entries in the service definition yaml file (e.g. custom_components/spotifyplus/services.yaml), down to the specific line numbers (e.g. :8,29,5, ...).

These entries are simply example values that can be supplied for the entity_id field for each custom service that requires an entity_id value. They should not be reported as missing, unless you have automations defined that use the service and have not specified an entity_id value.

For example, the get_artist custom service definition is:

get_artist:
  name: Get Artist
  description: Get Spotify catalog information for a single artist.
  fields:
    entity_id:
      name: Entity ID
      description: Entity ID of the SpotifyPlus device that will make the request to the Spotify Web API.
      example: "media_player.spotifyplus_username"
      required: true
      selector:
        entity:
          integration: spotifyplus
          domain: media_player
    artist_id:
      name: Artist Id
      description: The Spotify ID of the artist.
      example: "6APm8EjxOHSYM5B4i3vT3q"
      required: true
      selector:
        text:

The Missing 1 entity(ies) from 6 found in your config: would indicate that you have a SpotifyPlus custom service call defined somewhere in Automations, and it does not have an entity_id defined. Can you verify that?

gmartenscb commented 2 months ago

Thanks for your quick reply!

And you're absolutely right. I should've taken a closer look myself first, apoligies. This is a bug / issue in Watchman and not within SpotifyPlus!

Watchman is a nice HACS integration that checks your configuration and checks whether you have missing entities or services, aka; if your configuration is (in)valid.

Check that integration's issues, I do see it's brought up there before (multiple times): https://github.com/dummylabs/thewatchman/issues/25#issuecomment-1097941988 Or this one, or this one, so fair to say more people ran into this.

I'll apply the suggested fix, with ignoring the custom_components directory in the first issue I linked.

Once again thank you for your response!

thlucas1 commented 2 months ago

No worries - I learned something new today (brief intro to Watchman). :-)