Just upgraded to 0.93.1 and now script.sonos_say reports "Service not found"

I have a set of sonos speakers and I used the something similar to the sonos_say script to make my speakers talk. Everything worked well before the upgrade to 0.93, this morning. I know the services changed from domains from media_player to sonos and I updated my scripts. However, for some reason when I try to call the service using the services debugger in home assistant it instantly reports “Failed to call service scripts/sonos_say. Service not found” which is strange because I find the service in the dropdown box just fine. Here’s a screen shot of what I see:

image

This is my updated script for reference:

sonos_say:
  alias: "Sonos Say"
  sequence:
    - service: sonos.sonos_snapshot
      data_template:
        entity_id: "{{ sonos_primary|default('media_player.office_sonos') }}"
    - service: sonos.sonos_unjoin
      data_template:
        entity_id: "{{ sonos_primary|default('media_player.office_sonos') }}"
    - service: media_player.volume_set
      data_template:
        entity_id: "{{ sonos_primary|default('media_player.office_sonos') }}"
        volume_level: "{{ volume|default('0.8') }}"
    - service: tts.google_say
      data_template:
        entity_id: "{{ sonos_primary|default('media_player.office_sonos') }}"
        message: "{{ message }}"
    - delay: "{{ delay|default('00:00:00') }}"
    - wait_template: "{{ is_state(sonos_primary|default('media_player.office_sonos'), 'playing') }}"
      timeout: '00:00:05'
    - service: sonos.sonos_restore
      data_template:
        entity_id: "{{ sonos_primary|default('media_player.office_sonos') }}"

What am I doing wrong here?

You should always read the release notes before you take any updates of HA. Not preaching, I’ve learned the hard way.

Sonos is now its own domain called sonos and no longer part of media_player.

0.93.1 Release Notes

Thanks for the response strangedesign13… but I think maybe you didn’t read my post and only looked at the title. I read the release notes before taking the upgrade, made the changes and posted them in my original post. Besides, HA is not giving me a message like “domain command not recognized”. It fails to execute the script completely.

BAH! I finally found the issue after staring at my script for a long time… turns out I only partially converted the names.

The script should read:

sonos_say:
  alias: "Sonos Say"
  sequence:
    - service: sonos.snapshot
      data_template:
        entity_id: "{{ sonos_primary|default('media_player.office_sonos') }}"
    - service: sonos.unjoin
      data_template:
        entity_id: "{{ sonos_primary|default('media_player.office_sonos') }}"
    - service: media_player.volume_set
      data_template:
        entity_id: "{{ sonos_primary|default('media_player.office_sonos') }}"
        volume_level: "{{ volume|default('0.8') }}"
    - service: tts.google_say
      data_template:
        entity_id: "{{ sonos_primary|default('media_player.office_sonos') }}"
        message: "{{ message }}"
    - delay: "{{ delay|default('00:00:00') }}"
    - wait_template: "{{ is_state(sonos_primary|default('media_player.office_sonos'), 'playing') }}"
      timeout: '00:00:05'
    - service: sonos.restore
      data_template:
        entity_id: "{{ sonos_primary|default('media_player.office_sonos') }}"

subtle, but I missed removing the “sonos_” before each of the root services.

I converted media_player.sonos_unjoin to sonos.sonos_unjoin and it should have been sonos.unjoin. lol

Thanks for the kick in the butt strangedesign13. I just wish it would have given me a more meaningful error message but, oh well.

1 Like

Ha no worries. Looks like you found it. As much as I love HA sometimes it’s such a PITA to find all the changes you need to make. It’s actually one of the reasons I left the YAML world and put all my automations in Node-Red. At least for me it’s been easier to manage and keep everything straight, plus I like the visual late out. YAML context was something i always struggled with, especially the formatting and proper indentation.