#Pass entity_id to service_call

1 messages · Page 1 of 1 (latest)

hoary pelican
#

I would like to pass the entity_id to a service call directly in an action. Anyone knows if it can be achieved in any way?

#
type: custom:auto-entities
filter:
  include:
    - options:
        type: template
        tap_action:
          action: perform-action
          perform_action: media_player.unjoin
          target:
            entity_id: "{{entity}}"
          data: {}
        icon: mdi:speaker
        picture: "{{state_attr(entity, 'entity_picture_local')}}"
        content: "{{state_attr(entity, 'friendly_name')}}"
      domain: media_player
      state: playing
      attributes:
        group_members: $$*media_player.koksradio_ma*
card:
  type: custom:mushroom-chips-card
show_empty: true
card_param: chips
sort:
  method: state
  numeric: true
  ignore_case: false
#

In this case it's in a mushroom chips card where you have the entity saved in a variable that you can use everywhere else it seems.

        tap_action:
          action: perform-action
          perform_action: media_player.unjoin
          target:
            entity_id: "{{entity}}"
          data: {}
lucid marsh