Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 96121

How to debug Sonos script

$
0
0

@rdehuyss wrote:

Hi all,

this is my automation:

ring_on_sonos:
    sequence:
      - condition: template
        value_template: "{{ not is_state('input_select.doorbell', 'ring-off') }}"
      - alias: 'Snapshot sonos'
        service: sonos.snapshot
        data:
          entity_id: all
          with_group: true
      - alias: 'Pause media'
        service: media_player.media_pause
        data:
          entity_id:
            - "media_player.dining_room"
            - "media_player.living_room"
            - "media_player.badkamer"
            - "media_player.den"  
      - alias: 'Join sonos'
        service: sonos.join
        data_template:
          master: media_player.dining_room
          entity_id:
            - "media_player.dining_room"
            - "media_player.living_room"
            - "{% if is_state('input_select.doorbell', 'ring-everywhere') %} media_player.badkamer {% else %} media_player.dining_room {% endif %}"
            - "{% if is_state('input_select.doorbell', 'ring-everywhere') %} media_player.den {% else %} media_player.dining_room {% endif %}"
      - alias: 'Set Sonos volume'
        service: media_player.volume_set
        data_template:
          entity_id:
            - "media_player.dining_room"
            - "media_player.living_room"
            - "{% if is_state('input_select.doorbell', 'ring-everywhere') %} media_player.badkamer {% else %} media_player.dining_room {% endif %}"
            - "{% if is_state('input_select.doorbell', 'ring-everywhere') %} media_player.den {% else %} media_player.dining_room {% endif %}"
          volume_level: 0.4
      - alias: 'Play doorbell sound'
        service: media_player.play_media
        entity_id: media_player.dining_room
        data:
          media_content_id: https://homeassistant.dehuysser.be/local/doorbell.mp3
          media_content_type: 'music'

It used to work fine but since moving to 105.3, I get the following error:

Error executing service <ServiceCall script.ring_on_sonos (c:c7a6093028c64e4882757cf93ffc89f9)>
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/voluptuous/schema_builder.py", line 272, in __call__
    return self._compiled([], data)
  File "/usr/local/lib/python3.7/site-packages/voluptuous/schema_builder.py", line 817, in validate_callable
    return schema(data)
  File "/usr/src/homeassistant/homeassistant/helpers/config_validation.py", line 105, in validate
    raise vol.Invalid("must contain at least one of {}.".format(", ".join(keys)))
voluptuous.error.Invalid: must contain at least one of entity_id, area_id.

Any idea, I think all my sonos service calls have entity_id’s. And the debugging message is not really helpful…

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 96121

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>