Firstly, thanks for the replies! Secondly I’ve corrected ID assignments of the buttons on page1 and copied the properties from one button to the other. Did not change a lot except for the expected but after around two reboots Button 1 seems to finally toggle the light and a long press on Button 2 seems to also toggle the same light for some reason.
That’s all of <pages.jsonl>
{"comment":"Designer Config","page_size":"large_square","plate_name":"openhasp"}
{"page":0,"comment":"Page 0"}
{"id":1,"obj":"obj","x":0,"y":0,"w":240,"h":60,"enabled":false,"bg_color":"#aa47bc","bg_opa":128}
{"id":3,"obj":"obj","x":240,"y":0,"w":240,"h":60,"enabled":false,"bg_color":"#aa47bc","bg_opa":128}
{"id":8,"obj":"label","x":0,"y":0,"w":240,"h":60,"parentid":3,"align":"center","text":"00:00","template":"%H:%M"}
{"id":5,"obj":"btn","x":400,"y":420,"w":60,"h":40,"radius":20,"text":">","action":{"down":"page next"}}
{"id":6,"obj":"btn","x":20,"y":420,"w":60,"h":40,"radius":20,"text":"<","action":{"down":"page back"}}
{"id":9,"obj":"btn","x":180,"y":420,"w":100,"h":40,"radius":20,"text":"reboot","action":{"up":"reboot"}}
{"page":1,"comment":"Page 1"}
{"id":1,"obj":"btn","x":80,"y":120,"w":120,"h":260,"radius":25,"text":"Button 1"}
{"id":2,"obj":"btn","x":280,"y":120,"w":120,"h":260,"radius":25,"text":"Button 2"}
And that’s the openhasp config in <configuration.yaml>
openhasp:
test:
objects:
- obj: "p1b2" # Button Button 2
properties:
"val": '{{ 1 if states("light.w1") == "on" else 0 }}'
"text": '{{ "\uE6E8" if is_state("light.w1", "on") else "\uE335" | e }}'
event:
"up":
- service: homeassistant.toggle
entity_id: "light.w1"
- obj: "p1b1" # Button Button 1
properties:
"val": '{{ 1 if states("light.w2") == "on" else 0 }}'
"text": '{{ "\uE6E8" if is_state("light.w2", "on") else "\uE335" | e }}'
event:
"up":
hold:
- service: homeassistant.toggle
entity_id: "light.w2"