core icon indicating copy to clipboard operation
core copied to clipboard

Yamaha Integration Has Unstable Entity IDs

Open codahq opened this issue 1 year ago • 1 comments

The problem

The Yamaha integration creates entity IDs based on the "Name" value in the yaml. For example, if the yaml looks like this:

- platform: yamaha
  host: 10.10.1.149
  name: "Theater Yamaha"
  zone_names:
    Main_Zone: "Receiver"

This creates a media player entity like this:

media_player.theater_yamaha

Unfortunately, if the device is turned on when Home Assistant restarts then the Yamaha integration appears to tacks on the area where the device resides resulting in:

media_player.theater_yamaha_theater

Additionally, I have noticed that if I set the zone name it will take the zone name instead when Home Assistant is restarted and the device is on resulting in:

media_player.theater_yamaha_receiver

This is a horrible experience to keep dashboards and automations working. I have three Yamaha receivers and the IDs are always jumping between these values.

#for my family room device media_player.family_room_yamaha media_player.family_room_yamaha_family_room media_player.family_room_yamaha_receiver

#for my theater device media_player.theater_yamaha media_player.theater_yamaha_theater media_player.theater_yamaha_receiver

#for my gym device media_player.gym_yamaha media_player.gym_yamaha_gym media_player.gym_yamaha_receiver

Please make it so we can define the unique_id in the yaml. If that is not possible for whatever reason make it so it will definitively take "Name".yamilize() + "_" + "Zone Name".yamilize() or just "Name".yamilize(). The flip flopping around is not working.

What version of Home Assistant Core has the issue?

core-2024.10.1

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Yamaha

Link to integration documentation on our website

https://www.home-assistant.io/integrations/yamaha/

Diagnostics information

No response

Example YAML snippet

#family room
- platform: yamaha
  host: 10.10.1.149
  name: "Family Room Yamaha"
  source_ignore:
    - "AV1"
    - "AV2"
    - "AV3"
    - "AV4"
    - "AV5"
    - "AV6"
    - "AirPlay"
    - "NET RADIO"
    - "Pandora"
    - "Rhapsody"
    - "SERVER"
    - "SiriusXM"
    - "Spotify"
    - "TUNER"
    - "USB"
    - "iPod (USB)"
    - "AUX"
    - "V-AUX"
    - "HDMI3"
    - "HDMI4"
    - "HDMI5"
    - "HDMI6"
    - "AUDIO2"
  source_names:
    HDMI1: "Nvidia Shield"
    HDMI2: "PlayStation 3"
    AUDIO1: "Chromecast Audio"
  zone_ignore:
    - "Zone_2"
  zone_names:
    Main_Zone: "Receiver"
#theater
- platform: yamaha
  host: 10.10.1.147
  name: "Theater Yamaha"
  source_ignore:
    - "AV1"
    - "AV2"
    - "AV3"
    - "AV4"
    - "AV5"
    - "AV6"
    - "AirPlay"
    - "NET RADIO"
    - "Pandora"
    - "Rhapsody"
    - "SERVER"
    - "SiriusXM"
    - "Spotify"
    - "TUNER"
    - "USB"
    - "iPod (USB)"
    - "AUX"
    - "V-AUX"
    - "HDMI4"
    - "HDMI5"
    - "HDMI6"
    - "AUDIO2"
  source_names:
    HDMI1: "Blu-ray"
    HDMI2: "Nvidia Shield"
    HDMI3: "Nintendo Switch"
    AUDIO1: "Chromecast Audio"
  zone_ignore:
    - "Zone_2"
  zone_names:
    Main_Zone: "Receiver"

Anything in the logs that might be useful for us?

No response

Additional information

No response

codahq avatar Oct 06 '24 16:10 codahq

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

How can I help here?

codahq avatar Jan 05 '25 09:01 codahq

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

Hmm. This is still an issue. It plagues my enjoyment of Home Assistant. Anything I can do to help?

brimmasch avatar Apr 06 '25 23:04 brimmasch

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

The latest version does not fix this

codahq avatar Jul 06 '25 04:07 codahq

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

I wanted to update the thread. I think the reason my IDs changed even after the change was reverted is because I had the Yamaha configuration importing two places in my config.yaml.

I commented one spot out and the IDs are now stable. I think it might have had to do with the entities loading from one imported config versus the other.

codahq avatar Oct 05 '25 16:10 codahq