Edit : Ok I made progress : to translate with more details for others :
- create the openHASP.yaml in your config folder (where configuration.yaml is)
- copy and paste the code above in it
- in the configuration.yaml : add the following line :
openhasp: !include openHASP.yaml
- reload yaml configuration in HA.
- in the openHASP file editor (in your plate), copy/paste the code to have buttons at the bottom (if you want to) :
{
"comment":"-------------------- Navigation --------------------",
"comment":" ----- Previous Page",
"page":0,
"id":1,
"obj":"btn",
"action":{"down": "page prev"},
"x":150,
"y":440,
"w":49,
"h":38,
"bg_color":"blue",
"text":"\uE141",
"text_color":"#FFFFFF",
"radius":0,
"border_side":0,
"text_font":24
}
{
"comment":"----- Home Page",
"page":0,
"id":2,
"obj":"btn",
"action":{"down": "page back"},
"x":200,
"y":440,
"w":80,
"h":38,
"bg_color":"blue",
"text":"\uE2DC",
"text_color":"#FFFFFF",
"radius":0,
"border_side":0,
"text_font":24
}
{
"comment":"----- Next Page",
"page":0,
"id":3,
"obj":"btn",
"action":{"down": "page next"},
"x":281,
"y":440,
"w":49,
"h":38,
"bg_color":"blue",
"text":"\uE142",
"text_color":"#FFFFFF",
"radius":0,
"border_side":0,
"text_font":24
}
{
"comment":"----- Page Number",
"page":0,
"id":4,
"obj":"label",
"x":380,
"y":440,
"w":40,
"h":38,
"text":"00",
"text_color":"#FFFFFF",
"text_font":24
}
Then use the model to create the missing objects listed in the openHASP.yaml. For example :
{
"comment":"----- Time",
"page":0,
"id":5,
"obj":"label",
"x":200,
"y":30,
"w":200,
"h":50,
"text":"00",
"text_color":"#FFFFFF",
"text_font":24
}
This is related to the following yaml code :
- obj: "p0b5"
properties:
"text": "{{ states('sensor.date_time') }}"
I didn’t have the time/date entity configured in my HA ( a quick search give you the ability to create it easily.)
For the rest, tkae inspiration from the default buttons in the openHASP example on their website. Like for a button toggle switch :
{
"comment":"----- bouton1",
"page":1,
"id":1,
"obj":"btn",
"x":30,
"y":30,
"w":100,
"h":100,
"toggle":true,
"mode":"break",
"align":1,
"bg_color":"gray",
"text":"\uE335",
"text_color":"#FFFFFF",
"radius":0,
"border_side":0,
"text_font":24
}
it’s the same thing as on a single line like in the openHASP example.
Here is where I am right now :
Is there templates of pages.jsonl files listed somewhere to ease the task ? (I bet on theopenHASP website, i’ll give a look…)