Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- automation:
- - alias: "Find Movie URL"
- trigger:
- - platform: state
- # Den input_select som indeholder søgeværdien ( filmen )
- entity_id: input_select.movie
- action:
- - service: script.vlookup
- script:
- vlookup:
- alias: "VLOOKUP"
- sequence:
- - service: input_select.select_option
- data_template:
- # Den input_select som der skal returneres fra ( URL )
- entity_id: input_select.movie_url
- option: >-
- # Gå alle filmene igennem
- {% for item in states.input_select.movie.attributes.options %}
- {% if item == states('input_select.movie') %}
- # Returner URL fra samme index som filmens navn ( loop.index0 )
- {{ states.input_select.movie_url.attributes.options[loop.index0] }}
- {% endif %}
- {%- endfor %}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement