Editing
Home Assistant
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
====<h2>openhasp.yaml</h2>==== This yaml file is called from configuration.yaml and it determines the actions of the objects defined in pages.jasonl.<br> ;Example: <nowiki>plate: objects: - obj: "p1b4" properties: "text": 'Attic: {{ states("sensor.attic_sensors_temperature") }}°F' - obj: "p1b2" # light-switch toggle button properties: "val": '{{ 1 if states("switch.officelight") == "on" else 0 }}' "text": '{{ "\uE6E8" if is_state("switch.officelight", "on") else "\uE335" | e }}' event: "up": - service: homeassistant.toggle entity_id: "switch.officelight"</nowiki> ---- ;Decoded: <nowiki> - obj: "p1b4" properties: "text": 'Attic: {{ states("sensor.attic_sensors_temperature") }}°F'</nowiki> The label object at p1b4 is defined in pages.jsonl: <nowiki>{"page":1,"id":4,"obj":"label","x":175,"y":60,"h":50,"w":200,"text":"XX.X°C","align":0,"bg_color":"#2C3E50","text_color":"#FFFFFF"}</nowiki><br> This assigns the entity value into the label. ---- <nowiki> - obj: "p1b2" # light-switch toggle button properties: "val": '{{ 1 if states("switch.officelight") == "on" else 0 }}' "text": '{{ "\uE6E8" if is_state("switch.officelight", "on") else "\uE335" | e }}' event: "up": - service: homeassistant.toggle entity_id: "switch.officelight"</nowiki><br> The button object at p1b2 is defined in pages,jsonl: <nowiki>{"page":1,"id":2,"obj":"btn","x":10,"y":50,"w":105,"h":90,"toggle":true,"text":"\uE335","text_font":48,"mode":"break","align":1}</nowiki><br> <b>"val"</b> is either 1 or 0 depending on the state of the entity.<br> <b>"text"</b> is one of two icons depending on the state of the entity.<br> <b>event:</b> is what the panel publishes over MQTT: "hasp/plate/state/p1b2"<br> :In this example, if the event is "up", then a service is called to toggle the light.<br> {{template:top}}
Summary:
Please note that all contributions to Notebook may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Notebook:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Search
Navigation
Home Page
C++ Reference
ESP Hardware
ESPHome
Home Assistant
Network Stuff
Tools
What links here
Related changes
Special pages
Page information