Hi all,
I’m attempting to figure out how I can pass the url hash from Lovelace as a variable to a script. I believe it is possible(?) but I’m struggling to come up with the template.
Any help is greatly appreciated
my test button tap action:
tap_action:
action: call-service
service: script.test_hash_variable_from_lovelace
service_data:
test_hash: >
[[[ {% if window.location.hash == "#p1" %}test1{% elif window.location.hash == "#p2" %}test2{% endif %} ]]]
My test script:
sequence:
- service: input_boolean.turn_on
data_template:
entity_id: 'input_boolean.{{ test_hash }}'