Server-Satellite not sending to Home Assistant

Regarding the service_template, its not needed anymore since 2020, but it is still in a lot of examples and documentation, which is irritating, see https://github.com/home-assistant/core/pull/39210

I try to pass the entire event data array, not a single value, so i can use one automation to call different scripts regarding grocy without knowing before which values are neded by this script.
How can i do this?

Or should i use node red instead? Does it help preventing such big template blocks with ifs and else?

O, in home assistant? I was not aware, thanks for the tip.

I have never tried, you can debug the event and checkout what is actually in it and work from there.

That is up to you. You need that logic somewhere, whatever best suits you I guess.

Now it works passing the event.data array to the script, i think i had some other mismatch.
I changed my player ids to media_player.siteId, so i dont need to tell rhasspy, which player to use.
It also works for entity_id, but i added player to data fore use as entity_id for simplicity.

Automation:

trigger:
  - platform: event
    event_type: rhasspy_PlayPlaylist
condition: []
action:
  - service: script.lms_play_playlist
    data:
      player: 'media_player.{{ trigger.event.data._intent.siteId }}'
      eventdata: '{{ trigger.event.data }}'

Script

  - service: squeezebox.call_method
    target:
      entity_id: media_player.{{ eventdata._intent.siteId }}
    data:
      command: playlist
      parameters:
        - play
        - media/Playlists/{{ eventdata.playlist }}.m3u
2 Likes