Hi!
I am using OpenHasp with HomeAssistant and I want to update the values on my display based on the light selected in the first display element. My config looks like this:
- obj: "p3b1"
event:
"changed":
- service: openhasp.command
data:
keyword: jsonl
parameters: "{\"page\":3,\"id\":2,\"tag\":\"{{ text }}\",\"val\":\"{{ 1 if states(\"light.{{ text }}\") == \"on\" else 0 }}\"}"
target:
entity_id: openhasp.aztouch
The part that doesn’t work is {{ 1 if states(\"light.{{ text }}\") == \"on\" else 0 }}
, for some reason it always returns 0. Setting the tag works, so i highly doubt that the {{ text }} variable (the id of the light for example: test_led) is the problem. When hardcoding a specific light it works. Any ideas what I am doing wrong/how to fix that? Thanks in advance!