openhasp mods

This commit is contained in:
zorruno
2026-06-20 15:46:55 +12:00
parent 79597fb021
commit 28df116a38
4 changed files with 640 additions and 134 deletions
+481 -131
View File
@@ -1,33 +1,42 @@
###############################################################################
# PACKAGE: OpenHASP Thermostat / Gas Heater Control
# VERSION: v1.1 (2026-06-18)
# VERSION: v1.3 (2026-06-20)
# NODE/TOPIC ROOT: hasp/openhasp_1/
#
# PAGE OBJECTS USED
# PAGE 1: Gas heater / lounge environment
# - p1b1 = main temperature display
# - p1b2 = setpoint icon/value display
# - p1b3 = setpoint down
# - p1b4 = setpoint up
# - p1b5 = heater status text
# - p1b6 = heater operation / flame button
# - p1b7 = humidity icon/value display
# - p1b2 = gas heater setpoint display
# - p1b3 = gas heater setpoint down
# - p1b4 = gas heater setpoint up
# - p1b5 = gas heater status text
# - p1b6 = gas heater operation / flame button
# - p1b7 = humidity display
#
# PAGE 2: Lounge climate control
# - p2b1 = main temperature display
# - p2b2 = climate.lounge setpoint display
# - p2b3 = climate.lounge setpoint down 0.5°C
# - p2b4 = climate.lounge setpoint up 0.5°C
# - p2b5 = climate.lounge status text
# - p2b6 = climate.lounge heat mode / sun button
# - p2b7 = humidity display
#
# PAGE 3: Blank placeholder
#
# NOTES:
# - The HASP flame button toggles the ESPHome Heater Operation switch.
# - Heater Operation ON = ESPHome Mode AUTO.
# - Heater Operation OFF = ESPHome Mode OFF.
# - BYPASS (Remote Only) is only shown when that ESPHome mode is selected.
# - p1b2 and p1b7 include their icons in the MQTT text payload so HA updates
# do not overwrite the icons loaded from pages.jsonl.
###############################################################################
###############################################################################
# HELPERS
# - p1b2/p1b7 and p2b2/p2b7 include their icons in the MQTT text payload so
# HA updates do not overwrite icons loaded from pages.jsonl.
# - p1b3/p1b4 are yellow.
# - p1b6 is grey when OFF/BYPASS, yellow in AUTO, and red flame when firing.
# - p2b3/p2b4 are pink.
# - p2b6 turns climate.lounge ON and sets HVAC mode to heat.
# - p2b6 is pink only when climate.lounge is in heat mode.
###############################################################################
###############################################################################
# MQTT ENTITIES
###############################################################################
mqtt:
sensor:
- name: "Lounge Environment Humidity MQTT"
@@ -42,44 +51,44 @@ mqtt:
{{ raw | replace('%', '') | trim }}
{% endif %}
select:
- name: "OpenHASP Lounge Page"
unique_id: "openhasp_lounge_page"
icon: mdi:tablet-dashboard
state_topic: "hasp/openhasp_1/state/page"
command_topic: "hasp/openhasp_1/command/page"
options:
- "1"
- "2"
- "3"
value_template: >
{% set raw = value | trim %}
{% if raw.startswith('{') %}
{% set j = raw | from_json %}
{{ j.page | default(raw) }}
{% else %}
{{ raw }}
{% endif %}
###############################################################################
# AUTOMATIONS
###############################################################################
automation:
# -------------------------------------------------------------------------
# Main temperature display
# - Shows normal lounge temperature
# - Normalises values so we do not get duplicated °C or long float strings
# - No space is used before °C
# Lounge temperature display on page 1 and page 2
# -------------------------------------------------------------------------
- id: hasp_temp_to_btn_text
alias: "HASP: update temp (p1b1.text)"
- id: hasp_lounge_temp_to_page_text
alias: "HASP: update lounge temperature displays"
mode: queued
trigger:
- platform: state
entity_id: sensor.lounge_environment_lounge_environment_temperature
action:
- service: mqtt.publish
data:
topic: "hasp/openhasp_1/command/p1b1.text"
payload: >
{% set raw = states('sensor.lounge_environment_lounge_environment_temperature') %}
{% set cleaned = raw
| replace('°C', '')
| replace('° C', '')
| replace('C', '')
| trim %}
{% if cleaned not in ['unknown', 'unavailable', '', 'none', 'None'] %}
{{ cleaned | float(0) | round(1) }}°C
{% else %}
--°C
{% endif %}
- service: script.hasp_publish_lounge_temp_displays
# -------------------------------------------------------------------------
# Heater status text at bottom of screen
# - Shows OFF when ESPHome Mode is OFF
# - Shows BYPASS only when ESPHome Mode is BYPASS (Remote Only)
# - Otherwise mirrors the ESPHome status text, now normally Auto (...)
# Gas heater status text on page 1
# -------------------------------------------------------------------------
- id: hasp_heater_status_to_btn_text
alias: "HASP: update heater status (p1b5.text)"
@@ -89,66 +98,40 @@ automation:
entity_id:
- sensor.rinnai_neo_gas_heater_rinnai_neo_gas_heater_status_text
- select.rinnai_neo_gas_heater_mode
- switch.rinnai_neo_gas_heater_heater_operation
- switch.rinnai_neo_gas_heater_rinnai_neo_gas_heater_activate_flame
action:
- service: script.hasp_publish_heater_status_text
# -------------------------------------------------------------------------
# Setpoint display on left side of centre row
# - Strips any existing units so only one °C is shown
# - Includes thermometer icon so HA updates do not remove it
# Gas heater setpoint display on page 1
# -------------------------------------------------------------------------
- id: hasp_setpoint_to_btn_text
alias: "HASP: update setpoint (p1b2.text)"
alias: "HASP: update gas heater setpoint (p1b2.text)"
mode: queued
trigger:
- platform: state
entity_id: sensor.rinnai_neo_gas_heater_setpoint_text
action:
- service: mqtt.publish
data:
topic: "hasp/openhasp_1/command/p1b2.text"
payload: >
{% set raw = states('sensor.rinnai_neo_gas_heater_setpoint_text') %}
{% set cleaned = raw
| replace('°C', '')
| replace('° C', '')
| replace('C', '')
| trim %}
{% if cleaned not in ['unknown', 'unavailable', '', 'none', 'None'] %}
{{ '\uE50F' }} {{ cleaned | float(0) | round(1) }}°C
{% else %}
{{ '\uE50F' }} --°C
{% endif %}
- service: script.hasp_publish_heater_setpoint
# -------------------------------------------------------------------------
# Humidity display on right side of centre row
# - Includes water/drop icon so HA updates do not remove it
# Humidity display on page 1 and page 2
# -------------------------------------------------------------------------
- id: hasp_humidity_to_btn_text
alias: "HASP: update humidity (p1b7.text)"
alias: "HASP: update humidity displays"
mode: queued
trigger:
- platform: state
entity_id: sensor.lounge_environment_humidity_mqtt
action:
- service: mqtt.publish
data:
topic: "hasp/openhasp_1/command/p1b7.text"
payload: >
{% set raw = states('sensor.lounge_environment_humidity_mqtt') %}
{% set cleaned = raw | replace('%', '') | trim %}
{% if cleaned in ['unknown', 'unavailable', '', 'none', 'None'] %}
{{ '\uE58C' }} --%
{% else %}
{{ '\uE58C' }} {{ cleaned }}%
{% endif %}
- service: script.hasp_publish_humidity_displays
# -------------------------------------------------------------------------
# Up / Down buttons on the HASP plate
# These call the existing HA button entities
# Page 1 gas heater setpoint up/down buttons
# -------------------------------------------------------------------------
- id: hasp_btn_up_press
alias: "HASP: p1b4 up -> heater setpoint UP"
alias: "HASP: p1b4 up -> gas heater setpoint UP"
mode: queued
trigger:
- platform: mqtt
@@ -162,7 +145,7 @@ automation:
entity_id: button.rinnai_neo_gas_heater_rinnai_neo_gas_heater_setpoint_up
- id: hasp_btn_down_press
alias: "HASP: p1b3 up -> heater setpoint DOWN"
alias: "HASP: p1b3 up -> gas heater setpoint DOWN"
mode: queued
trigger:
- platform: mqtt
@@ -176,13 +159,10 @@ automation:
entity_id: button.rinnai_neo_gas_heater_rinnai_neo_gas_heater_setpoint_down
# -------------------------------------------------------------------------
# Middle flame button
# - Tap toggles Heater Operation, which maps AUTO <-> OFF in ESPHome
# - If Mode is BYPASS (Remote Only), tapping this will turn Heater Operation ON
# and therefore return the ESPHome controller to AUTO.
# Page 1 gas heater middle flame button
# -------------------------------------------------------------------------
- id: hasp_btn_heat_toggle
alias: "HASP: p1b6 up -> heater operation toggle"
alias: "HASP: p1b6 up -> gas heater operation toggle"
mode: queued
trigger:
- platform: mqtt
@@ -196,14 +176,10 @@ automation:
entity_id: switch.rinnai_neo_gas_heater_heater_operation
# -------------------------------------------------------------------------
# Flame button appearance
# - OFF: dark grey background, light grey flame
# - BYPASS: dark grey background, amber flame
# - AUTO, flame OFF: theme blue background, white flame
# - AUTO, flame ON: theme blue background, solid red flame
# Page 1 gas heater middle button appearance
# -------------------------------------------------------------------------
- id: hasp_heat_button_state
alias: "HASP: update heat button state (p1b6)"
alias: "HASP: update gas heat button state (p1b6)"
mode: restart
trigger:
- platform: state
@@ -215,7 +191,91 @@ automation:
- service: script.hasp_apply_heat_button_state
# -------------------------------------------------------------------------
# Start / restart display when HA starts
# Page 2 climate.lounge text and button state updates
# -------------------------------------------------------------------------
- id: hasp_lounge_climate_to_page2
alias: "HASP: update lounge climate page 2"
mode: queued
trigger:
- platform: state
entity_id: climate.lounge
action:
- service: script.hasp_push_page2_climate_texts
- service: script.hasp_apply_climate_heat_button_state
# -------------------------------------------------------------------------
# Page 2 climate.lounge setpoint down
# -------------------------------------------------------------------------
- id: hasp_page2_climate_down_press
alias: "HASP: p2b3 up -> lounge climate setpoint DOWN 0.5"
mode: queued
trigger:
- platform: mqtt
topic: "hasp/openhasp_1/state/p2b3"
condition:
- condition: template
value_template: "{{ trigger.payload_json.event | default('') == 'up' }}"
action:
- service: climate.set_temperature
target:
entity_id: climate.lounge
data:
temperature: >
{% set current = state_attr('climate.lounge', 'temperature') | float(20) %}
{{ (current - 0.5) | round(1) }}
- delay: "00:00:01"
- service: script.hasp_push_page2_climate_texts
# -------------------------------------------------------------------------
# Page 2 climate.lounge setpoint up
# -------------------------------------------------------------------------
- id: hasp_page2_climate_up_press
alias: "HASP: p2b4 up -> lounge climate setpoint UP 0.5"
mode: queued
trigger:
- platform: mqtt
topic: "hasp/openhasp_1/state/p2b4"
condition:
- condition: template
value_template: "{{ trigger.payload_json.event | default('') == 'up' }}"
action:
- service: climate.set_temperature
target:
entity_id: climate.lounge
data:
temperature: >
{% set current = state_attr('climate.lounge', 'temperature') | float(20) %}
{{ (current + 0.5) | round(1) }}
- delay: "00:00:01"
- service: script.hasp_push_page2_climate_texts
# -------------------------------------------------------------------------
# Page 2 climate.lounge heat mode button
# -------------------------------------------------------------------------
- id: hasp_page2_climate_heat_press
alias: "HASP: p2b6 up -> lounge climate heat mode"
mode: queued
trigger:
- platform: mqtt
topic: "hasp/openhasp_1/state/p2b6"
condition:
- condition: template
value_template: "{{ trigger.payload_json.event | default('') == 'up' }}"
action:
- service: climate.turn_on
target:
entity_id: climate.lounge
- service: climate.set_hvac_mode
target:
entity_id: climate.lounge
data:
hvac_mode: heat
- delay: "00:00:01"
- service: script.hasp_push_page2_climate_texts
- service: script.hasp_apply_climate_heat_button_state
# -------------------------------------------------------------------------
# Push all screen state when Home Assistant starts
# -------------------------------------------------------------------------
- id: hasp_start_on_ha_start
alias: "HASP: start display loop on HA start"
@@ -226,7 +286,7 @@ automation:
- service: script.hasp_push_static_texts
# -------------------------------------------------------------------------
# Re-push screen state when panel comes online
# Push all screen state when the openHASP panel comes online
# -------------------------------------------------------------------------
- id: hasp_start_on_panel_online
alias: "HASP: start display loop when panel goes online"
@@ -243,22 +303,37 @@ automation:
###############################################################################
# SCRIPTS
###############################################################################
script:
# -------------------------------------------------------------------------
# Push all current values / colours to the panel
# Useful on HA startup and panel reconnect
# Push all current values and colours to the panel
# -------------------------------------------------------------------------
hasp_push_static_texts:
alias: "HASP: push static texts"
mode: queued
sequence:
# Push Set/Hum display styling first, so the centre row is not blue
- service: script.hasp_style_center_info_buttons
- service: script.hasp_style_page1_control_buttons
- service: script.hasp_style_page2_control_buttons
- service: script.hasp_publish_lounge_temp_displays
- service: script.hasp_publish_heater_status_text
- service: script.hasp_publish_heater_setpoint
- service: script.hasp_publish_humidity_displays
- service: script.hasp_apply_heat_button_state
- service: script.hasp_push_page2_climate_texts
- service: script.hasp_apply_climate_heat_button_state
# -------------------------------------------------------------------------
# Publish lounge temperature to page 1 and page 2
# -------------------------------------------------------------------------
hasp_publish_lounge_temp_displays:
alias: "HASP: publish lounge temperature displays"
mode: queued
sequence:
- service: mqtt.publish
data:
topic: "hasp/openhasp_1/command/p1b1.text"
payload: >
payload: >-
{% set raw = states('sensor.lounge_environment_lounge_environment_temperature') %}
{% set cleaned = raw
| replace('°C', '')
@@ -271,12 +346,33 @@ script:
--°C
{% endif %}
- service: script.hasp_publish_heater_status_text
- service: mqtt.publish
data:
topic: "hasp/openhasp_1/command/p2b1.text"
payload: >-
{% set raw = states('sensor.lounge_environment_lounge_environment_temperature') %}
{% set cleaned = raw
| replace('°C', '')
| replace('° C', '')
| replace('C', '')
| trim %}
{% if cleaned not in ['unknown', 'unavailable', '', 'none', 'None'] %}
{{ cleaned | float(0) | round(1) }}°C
{% else %}
--°C
{% endif %}
# -------------------------------------------------------------------------
# Publish gas heater setpoint to page 1
# -------------------------------------------------------------------------
hasp_publish_heater_setpoint:
alias: "HASP: publish gas heater setpoint"
mode: queued
sequence:
- service: mqtt.publish
data:
topic: "hasp/openhasp_1/command/p1b2.text"
payload: >
payload: >-
{% set raw = states('sensor.rinnai_neo_gas_heater_setpoint_text') %}
{% set cleaned = raw
| replace('°C', '')
@@ -289,10 +385,17 @@ script:
{{ '\uE50F' }} --°C
{% endif %}
# -------------------------------------------------------------------------
# Publish humidity to page 1 and page 2
# -------------------------------------------------------------------------
hasp_publish_humidity_displays:
alias: "HASP: publish humidity displays"
mode: queued
sequence:
- service: mqtt.publish
data:
topic: "hasp/openhasp_1/command/p1b7.text"
payload: >
payload: >-
{% set raw = states('sensor.lounge_environment_humidity_mqtt') %}
{% set cleaned = raw | replace('%', '') | trim %}
{% if cleaned in ['unknown', 'unavailable', '', 'none', 'None'] %}
@@ -301,22 +404,29 @@ script:
{{ '\uE58C' }} {{ cleaned }}%
{% endif %}
- service: script.hasp_apply_heat_button_state
- service: mqtt.publish
data:
topic: "hasp/openhasp_1/command/p2b7.text"
payload: >-
{% set raw = states('sensor.lounge_environment_humidity_mqtt') %}
{% set cleaned = raw | replace('%', '') | trim %}
{% if cleaned in ['unknown', 'unavailable', '', 'none', 'None'] %}
{{ '\uE58C' }} --%
{% else %}
{{ '\uE58C' }} {{ cleaned }}%
{% endif %}
# -------------------------------------------------------------------------
# Publish heater status text to p1b5
# Keeps OFF/BYPASS display based on ESPHome Mode, not just the operation switch.
# Publish gas heater status text to page 1 bottom label
#
# Display behaviour:
# - OFF -> Off
# - BYPASS (Remote Only) -> Bypass (Remote Only)
# - Auto but flame OFF -> Auto (Up to Temp)
# - Auto (Level 1) -> Auto 🔥
# - Auto (Level 2) -> Auto 🔥🔥
# - Auto (Level 3) -> Auto 🔥🔥🔥
# - Auto (Level 4) -> Auto 🔥🔥🔥🔥
#
# The flame is the openHASP/Material icon \uE238, not an emoji.
# - Auto (Level 1) -> Auto + 1 flame icon
# - Auto (Level 2) -> Auto + 2 flame icons
# - Auto (Level 3) -> Auto + 3 flame icons
# - Auto (Level 4) -> Auto + 4 flame icons
# -------------------------------------------------------------------------
hasp_publish_heater_status_text:
alias: "HASP: publish heater status text"
@@ -325,7 +435,7 @@ script:
- service: mqtt.publish
data:
topic: "hasp/openhasp_1/command/p1b5.text"
payload: >
payload: >-
{% set mode = states('select.rinnai_neo_gas_heater_mode') %}
{% set op = states('switch.rinnai_neo_gas_heater_heater_operation') %}
{% set flame_on = is_state('switch.rinnai_neo_gas_heater_rinnai_neo_gas_heater_activate_flame', 'on') %}
@@ -337,10 +447,14 @@ script:
{% elif mode == 'BYPASS (Remote Only)' %}
Bypass (Remote Only)
{% elif op == 'on' and not flame_on %}
Auto
Auto (Up to Temp)
{% elif s not in ['unknown', 'unavailable', '', 'none', 'None'] %}
{% set matches = s | regex_findall('Level ([0-9]+)', ignorecase=True) %}
{% set level = matches[0] | int(0) if matches | count > 0 else 0 %}
{% set matches = s | regex_findall('Level ([0-9]+)') %}
{% if matches | length > 0 %}
{% set level = matches[0] | int(0) %}
{% else %}
{% set level = 0 %}
{% endif %}
{% if level > 0 %}
Auto {{ flame * level }}
{% else %}
@@ -353,10 +467,10 @@ script:
{% endif %}
# -------------------------------------------------------------------------
# Publish middle flame button icon and colours to p1b6
# Apply page 1 gas heater middle flame button state
# -------------------------------------------------------------------------
hasp_apply_heat_button_state:
alias: "HASP: apply heat button state"
alias: "HASP: apply gas heat button state"
mode: queued
sequence:
- service: mqtt.publish
@@ -365,8 +479,7 @@ script:
payload: "\uE238"
- choose:
# BYPASS (Remote Only) -> dark button, amber flame so it is visibly different
# from ordinary OFF, but still looks inactive.
# BYPASS -> grey button, amber flame
- conditions:
- condition: state
entity_id: select.rinnai_neo_gas_heater_mode
@@ -389,7 +502,7 @@ script:
topic: "hasp/openhasp_1/command/p1b6.border_color"
payload: "#2F3240"
# OFF -> dark grey button, light grey flame
# OFF -> grey button, light grey flame
- conditions:
- condition: state
entity_id: select.rinnai_neo_gas_heater_mode
@@ -412,7 +525,7 @@ script:
topic: "hasp/openhasp_1/command/p1b6.border_color"
payload: "#2F3240"
# AUTO, flame ON -> blue button, red flame
# AUTO, flame ON -> yellow button, red flame
- conditions:
- condition: state
entity_id: switch.rinnai_neo_gas_heater_heater_operation
@@ -428,17 +541,17 @@ script:
- service: mqtt.publish
data:
topic: "hasp/openhasp_1/command/p1b6.bg_color"
payload: "#0095D9"
payload: "#FFC107"
- service: mqtt.publish
data:
topic: "hasp/openhasp_1/command/p1b6.bg_grad_color"
payload: "#00B6FF"
payload: "#FFD54F"
- service: mqtt.publish
data:
topic: "hasp/openhasp_1/command/p1b6.border_color"
payload: "#0095D9"
payload: "#FFC107"
# AUTO, flame OFF -> blue button, white flame
# AUTO, flame OFF -> yellow button, black flame
- conditions:
- condition: state
entity_id: switch.rinnai_neo_gas_heater_heater_operation
@@ -450,19 +563,19 @@ script:
- service: mqtt.publish
data:
topic: "hasp/openhasp_1/command/p1b6.text_color"
payload: "#FFFFFF"
payload: "#000000"
- service: mqtt.publish
data:
topic: "hasp/openhasp_1/command/p1b6.bg_color"
payload: "#0095D9"
payload: "#FFC107"
- service: mqtt.publish
data:
topic: "hasp/openhasp_1/command/p1b6.bg_grad_color"
payload: "#00B6FF"
payload: "#FFD54F"
- service: mqtt.publish
data:
topic: "hasp/openhasp_1/command/p1b6.border_color"
payload: "#0095D9"
payload: "#FFC107"
default:
- service: mqtt.publish
@@ -483,10 +596,129 @@ script:
payload: "#2F3240"
# -------------------------------------------------------------------------
# Style centre row info buttons as text panels
# - p1b2 = setpoint
# - p1b7 = humidity
# This removes the default blue button styling from these display-only fields.
# Push page 2 climate.lounge setpoint and status text
# -------------------------------------------------------------------------
hasp_push_page2_climate_texts:
alias: "HASP: push page 2 climate texts"
mode: queued
sequence:
- service: mqtt.publish
data:
topic: "hasp/openhasp_1/command/p2b2.text"
payload: >-
{% set target = state_attr('climate.lounge', 'temperature') %}
{% if target is not none %}
{{ '\uE50F' }} {{ target | float(0) | round(1) }}°C
{% else %}
{{ '\uE50F' }} --°C
{% endif %}
- service: mqtt.publish
data:
topic: "hasp/openhasp_1/command/p2b5.text"
payload: >-
{% set mode = states('climate.lounge') %}
{% set mode_map = {
'off': 'Off',
'heat': 'Heating',
'cool': 'Cooling',
'heat_cool': 'Auto',
'auto': 'Auto',
'dry': 'Dry',
'fan_only': 'Fan'
} %}
{% set mode_text = mode_map.get(mode, mode | replace('_', ' ') | title) %}
{% set preset = state_attr('climate.lounge', 'preset_mode') | default('', true) | string | lower %}
{% set fan = state_attr('climate.lounge', 'fan_mode') | default('', true) | string | lower %}
{% set swing = state_attr('climate.lounge', 'swing_mode') | default('', true) | string | lower %}
{% set eco_attr = state_attr('climate.lounge', 'eco') | default('', true) | string | lower %}
{% set powerful_attr = state_attr('climate.lounge', 'powerful') | default('', true) | string | lower %}
{% set quiet_attr = state_attr('climate.lounge', 'quiet') | default('', true) | string | lower %}
{% set nanoe_attr = state_attr('climate.lounge', 'nanoe') | default('', true) | string | lower %}
{% set nanoe_x_attr = state_attr('climate.lounge', 'nanoe_x') | default('', true) | string | lower %}
{% set ns = namespace(extras=[]) %}
{% if 'eco' in preset or eco_attr in ['on', 'true', '1', 'yes'] %}
{% set ns.extras = ns.extras + ['Eco'] %}
{% endif %}
{% if 'powerful' in preset or 'boost' in preset or powerful_attr in ['on', 'true', '1', 'yes'] %}
{% set ns.extras = ns.extras + ['Powerful'] %}
{% endif %}
{% if 'quiet' in preset or 'quiet' in fan or quiet_attr in ['on', 'true', '1', 'yes'] %}
{% set ns.extras = ns.extras + ['Quiet'] %}
{% endif %}
{% if 'nanoe' in preset or 'nanoe' in swing or nanoe_attr in ['on', 'true', '1', 'yes'] or nanoe_x_attr in ['on', 'true', '1', 'yes'] %}
{% set ns.extras = ns.extras + ['nanoe-x'] %}
{% endif %}
{% if ns.extras | length > 0 %}
{{ mode_text }} ({{ ns.extras | join(', ') }})
{% else %}
{{ mode_text }}
{% endif %}
# -------------------------------------------------------------------------
# Apply page 2 climate.lounge heat button state
# -------------------------------------------------------------------------
hasp_apply_climate_heat_button_state:
alias: "HASP: apply lounge climate heat button state"
mode: queued
sequence:
- service: mqtt.publish
data:
topic: "hasp/openhasp_1/command/p2b6.text"
payload: "\uE599"
- choose:
# climate.lounge is ON and in HEAT mode -> pink sun
- conditions:
- condition: state
entity_id: climate.lounge
state: "heat"
sequence:
- service: mqtt.publish
data:
topic: "hasp/openhasp_1/command/p2b6.text_color"
payload: "#FFFFFF"
- service: mqtt.publish
data:
topic: "hasp/openhasp_1/command/p2b6.bg_color"
payload: "#C2185B"
- service: mqtt.publish
data:
topic: "hasp/openhasp_1/command/p2b6.bg_grad_color"
payload: "#E91E63"
- service: mqtt.publish
data:
topic: "hasp/openhasp_1/command/p2b6.border_color"
payload: "#C2185B"
default:
- service: mqtt.publish
data:
topic: "hasp/openhasp_1/command/p2b6.text_color"
payload: "#C0C0C0"
- service: mqtt.publish
data:
topic: "hasp/openhasp_1/command/p2b6.bg_color"
payload: "#2F3240"
- service: mqtt.publish
data:
topic: "hasp/openhasp_1/command/p2b6.bg_grad_color"
payload: "#2F3240"
- service: mqtt.publish
data:
topic: "hasp/openhasp_1/command/p2b6.border_color"
payload: "#2F3240"
# -------------------------------------------------------------------------
# Style page 1 and page 2 setpoint/humidity display buttons as black panels
# -------------------------------------------------------------------------
hasp_style_center_info_buttons:
alias: "HASP: style centre info buttons"
@@ -525,3 +757,121 @@ script:
data:
topic: "hasp/openhasp_1/command/p1b7.border_color"
payload: "#000000"
- service: mqtt.publish
data:
topic: "hasp/openhasp_1/command/p2b2.text_color"
payload: "#FFFFFF"
- service: mqtt.publish
data:
topic: "hasp/openhasp_1/command/p2b2.bg_color"
payload: "#000000"
- service: mqtt.publish
data:
topic: "hasp/openhasp_1/command/p2b2.bg_grad_color"
payload: "#000000"
- service: mqtt.publish
data:
topic: "hasp/openhasp_1/command/p2b2.border_color"
payload: "#000000"
- service: mqtt.publish
data:
topic: "hasp/openhasp_1/command/p2b7.text_color"
payload: "#FFFFFF"
- service: mqtt.publish
data:
topic: "hasp/openhasp_1/command/p2b7.bg_color"
payload: "#000000"
- service: mqtt.publish
data:
topic: "hasp/openhasp_1/command/p2b7.bg_grad_color"
payload: "#000000"
- service: mqtt.publish
data:
topic: "hasp/openhasp_1/command/p2b7.border_color"
payload: "#000000"
# -------------------------------------------------------------------------
# Style page 1 gas heater up/down buttons yellow
# p1b6 is state-driven by hasp_apply_heat_button_state.
# -------------------------------------------------------------------------
hasp_style_page1_control_buttons:
alias: "HASP: style page 1 control buttons"
mode: queued
sequence:
- service: mqtt.publish
data:
topic: "hasp/openhasp_1/command/p1b3.text_color"
payload: "#000000"
- service: mqtt.publish
data:
topic: "hasp/openhasp_1/command/p1b3.bg_color"
payload: "#FFC107"
- service: mqtt.publish
data:
topic: "hasp/openhasp_1/command/p1b3.bg_grad_color"
payload: "#FFD54F"
- service: mqtt.publish
data:
topic: "hasp/openhasp_1/command/p1b3.border_color"
payload: "#FFC107"
- service: mqtt.publish
data:
topic: "hasp/openhasp_1/command/p1b4.text_color"
payload: "#000000"
- service: mqtt.publish
data:
topic: "hasp/openhasp_1/command/p1b4.bg_color"
payload: "#FFC107"
- service: mqtt.publish
data:
topic: "hasp/openhasp_1/command/p1b4.bg_grad_color"
payload: "#FFD54F"
- service: mqtt.publish
data:
topic: "hasp/openhasp_1/command/p1b4.border_color"
payload: "#FFC107"
# -------------------------------------------------------------------------
# Style page 2 climate up/down buttons pink
# p2b6 is state-driven by hasp_apply_climate_heat_button_state.
# -------------------------------------------------------------------------
hasp_style_page2_control_buttons:
alias: "HASP: style page 2 control buttons"
mode: queued
sequence:
- service: mqtt.publish
data:
topic: "hasp/openhasp_1/command/p2b3.text_color"
payload: "#FFFFFF"
- service: mqtt.publish
data:
topic: "hasp/openhasp_1/command/p2b3.bg_color"
payload: "#C2185B"
- service: mqtt.publish
data:
topic: "hasp/openhasp_1/command/p2b3.bg_grad_color"
payload: "#E91E63"
- service: mqtt.publish
data:
topic: "hasp/openhasp_1/command/p2b3.border_color"
payload: "#C2185B"
- service: mqtt.publish
data:
topic: "hasp/openhasp_1/command/p2b4.text_color"
payload: "#FFFFFF"
- service: mqtt.publish
data:
topic: "hasp/openhasp_1/command/p2b4.bg_color"
payload: "#C2185B"
- service: mqtt.publish
data:
topic: "hasp/openhasp_1/command/p2b4.bg_grad_color"
payload: "#E91E63"
- service: mqtt.publish
data:
topic: "hasp/openhasp_1/command/p2b4.border_color"
payload: "#C2185B"