Change attribute value via automation

Is there some way to set attribute values via automation?

I have a receiver where I would like to set the volume depending on which source I’m using.

take a look at templating:

Also, when you say:

are you refering to an entity_id or what?

1 Like

You mean something like this?

  action:
    - service: media_player.volume_set
      data_template:
        entity_id: media_player.livingroom
        volume_level: 0.14

Wow, that was easy. Exactly what I was looking for! Thnx