Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- script:
- vlookup:
- alias: "VLOOKUP i HA"
- sequence:
- - service: input_select.select_option
- data_template:
- entity_id: "{{ result_list }}"
- option: >-
- {% for needle in state_attr(haystack, "options") %}
- {% if needle == states(haystack) %}
- {{ state_attr(result_list, "options")[loop.index0] }}
- {% endif %}
- {%- endfor %}
- automation:
- - alias: "VLOOKUP - TEST"
- trigger:
- - platform: state
- # Den liste hvor vi f.eks. filmtitler
- entity_id: input_select.movie
- action:
- - service: script.vlookup
- data:
- haystack: "input_select.movie"
- # Listen med f.eks. URL - returner element fra samme plads
- result_list: "input_select.movie_url"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement