How can you make an automation end up a value?

When making in automation, i basically want it to produce a URL based on the action and condition I define. I cant seem to think of an action I could use that would just be text. If I could use a sensor as an action? I dont think so, ihoping someone could throw me a bone…

- alias: how in the
    platform: state
    entity_id: media_player.living_room
    from: 'playing'
    condition: and
      platform: state
      entity_id: media_player.plex_living_room
    condition: template
        value_template: '{{ states.media_player.plex_living_room.state != "playing" }}'
    - service: gimme.awaytogetaurlplease?

this would then grab a pic. i need to create a couple of these based on the conditions. thanks!

Are you asking how to generate the url, or how to put it somewhere so you can use it?

If the latter, an input_text would be the solution I suspect.

1 Like

how to get it. how to get the action to produce readable text rather than performing an action :wink:

Thank you sir! I will dig into that now!

Yeah, or write it to a file using the file notification platform.

1 Like

Do you know how to use and in an if statement?

for example…

value_template: "{{ states.sun.sun.attributes.elevation }} and …