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
+1 -1
View File
@@ -1 +1 @@
{"pid": 73, "version": 1, "ha_version": "2026.6.3", "start_ts": 1781782769.6367064} {"pid": 71, "version": 1, "ha_version": "2026.6.4", "start_ts": 1781925486.5362422}
@@ -0,0 +1,126 @@
################################################################################
# OPENHASP HEAT AUTO PAGE
################################################################################
# Package: openhasp_heat_auto_page.yaml
# Version: v1.1.0
# Updated: 2026-06-20
#
# Purpose:
# Automatically changes the openHASP display page based on lounge heating/cooling.
#
# Behaviour:
# - Gas fire ON -> openHASP page 1
# - Lounge heatpump HEAT mode -> openHASP page 2
# - Lounge heatpump COOL mode -> openHASP page 3
#
# Priority:
# 1. Gas fire
# 2. Lounge heatpump heating
# 3. Lounge heatpump cooling
#
# Notes:
# - If nothing is heating/cooling, this package does not change the page.
# - openHASP page change is sent via MQTT:
# hasp/openhasp_1/command/page
#
################################################################################
################################################################################
# SCRIPT
################################################################################
script:
openhasp_heat_auto_page_evaluate:
alias: "openHASP Heat Auto Page - Evaluate"
description: "Chooses the correct openHASP page based on gas fire and lounge heatpump state."
mode: restart
variables:
##########################################################################
# CONFIG
##########################################################################
openhasp_page_topic: "hasp/openhasp_1/command/page"
gas_fire_entity: "switch.rinnai_neo_gas_heater_heater_operation"
lounge_heatpump_entity: "climate.lounge"
##########################################################################
# STATE CHECKS
##########################################################################
gas_fire_on: >-
{{ is_state(gas_fire_entity, 'on') }}
lounge_heatpump_heat: >-
{{ is_state(lounge_heatpump_entity, 'heat') }}
lounge_heatpump_cool: >-
{{ is_state(lounge_heatpump_entity, 'cool') }}
target_page: >-
{% if gas_fire_on %}
1
{% elif lounge_heatpump_heat %}
2
{% elif lounge_heatpump_cool %}
3
{% else %}
none
{% endif %}
sequence:
- condition: template
value_template: "{{ target_page != 'none' }}"
- action: mqtt.publish
data:
topic: "{{ openhasp_page_topic }}"
payload: "{{ target_page }}"
qos: 0
retain: false
################################################################################
# AUTOMATIONS
################################################################################
automation:
- id: openhasp_heat_auto_page_change
alias: "openHASP Heat Auto Page - Change Page"
description: "Changes the openHASP page when the gas fire or lounge heatpump state changes."
mode: restart
triggers:
##########################################################################
# Gas fire state changes
##########################################################################
- trigger: state
entity_id: switch.rinnai_neo_gas_heater_heater_operation
##########################################################################
# Lounge heatpump HVAC mode changes
##########################################################################
- trigger: state
entity_id: climate.lounge
##########################################################################
# Re-apply after Home Assistant restart
##########################################################################
- trigger: homeassistant
event: start
##########################################################################
# Re-apply when the openHASP display comes online
##########################################################################
- trigger: mqtt
topic: hasp/openhasp_1/status
payload: online
actions:
- if:
- condition: template
value_template: "{{ trigger.platform in ['homeassistant', 'mqtt'] }}"
then:
- delay: "00:00:02"
- action: script.openhasp_heat_auto_page_evaluate
+481 -131
View File
@@ -1,33 +1,42 @@
############################################################################### ###############################################################################
# PACKAGE: OpenHASP Thermostat / Gas Heater Control # PACKAGE: OpenHASP Thermostat / Gas Heater Control
# VERSION: v1.1 (2026-06-18) # VERSION: v1.3 (2026-06-20)
# NODE/TOPIC ROOT: hasp/openhasp_1/ # NODE/TOPIC ROOT: hasp/openhasp_1/
# #
# PAGE OBJECTS USED # PAGE 1: Gas heater / lounge environment
# - p1b1 = main temperature display # - p1b1 = main temperature display
# - p1b2 = setpoint icon/value display # - p1b2 = gas heater setpoint display
# - p1b3 = setpoint down # - p1b3 = gas heater setpoint down
# - p1b4 = setpoint up # - p1b4 = gas heater setpoint up
# - p1b5 = heater status text # - p1b5 = gas heater status text
# - p1b6 = heater operation / flame button # - p1b6 = gas heater operation / flame button
# - p1b7 = humidity icon/value display # - 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: # NOTES:
# - The HASP flame button toggles the ESPHome Heater Operation switch. # - p1b2/p1b7 and p2b2/p2b7 include their icons in the MQTT text payload so
# - Heater Operation ON = ESPHome Mode AUTO. # HA updates do not overwrite icons loaded from pages.jsonl.
# - Heater Operation OFF = ESPHome Mode OFF. # - p1b3/p1b4 are yellow.
# - BYPASS (Remote Only) is only shown when that ESPHome mode is selected. # - p1b6 is grey when OFF/BYPASS, yellow in AUTO, and red flame when firing.
# - p1b2 and p1b7 include their icons in the MQTT text payload so HA updates # - p2b3/p2b4 are pink.
# do not overwrite the icons loaded from pages.jsonl. # - p2b6 turns climate.lounge ON and sets HVAC mode to heat.
############################################################################### # - p2b6 is pink only when climate.lounge is in heat mode.
###############################################################################
# HELPERS
############################################################################### ###############################################################################
############################################################################### ###############################################################################
# MQTT ENTITIES # MQTT ENTITIES
############################################################################### ###############################################################################
mqtt: mqtt:
sensor: sensor:
- name: "Lounge Environment Humidity MQTT" - name: "Lounge Environment Humidity MQTT"
@@ -42,44 +51,44 @@ mqtt:
{{ raw | replace('%', '') | trim }} {{ raw | replace('%', '') | trim }}
{% endif %} {% 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 # AUTOMATIONS
############################################################################### ###############################################################################
automation: automation:
# ------------------------------------------------------------------------- # -------------------------------------------------------------------------
# Main temperature display # Lounge temperature display on page 1 and page 2
# - Shows normal lounge temperature
# - Normalises values so we do not get duplicated °C or long float strings
# - No space is used before °C
# ------------------------------------------------------------------------- # -------------------------------------------------------------------------
- id: hasp_temp_to_btn_text - id: hasp_lounge_temp_to_page_text
alias: "HASP: update temp (p1b1.text)" alias: "HASP: update lounge temperature displays"
mode: queued mode: queued
trigger: trigger:
- platform: state - platform: state
entity_id: sensor.lounge_environment_lounge_environment_temperature entity_id: sensor.lounge_environment_lounge_environment_temperature
action: action:
- service: mqtt.publish - service: script.hasp_publish_lounge_temp_displays
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 %}
# ------------------------------------------------------------------------- # -------------------------------------------------------------------------
# Heater status text at bottom of screen # Gas heater status text on page 1
# - 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 (...)
# ------------------------------------------------------------------------- # -------------------------------------------------------------------------
- id: hasp_heater_status_to_btn_text - id: hasp_heater_status_to_btn_text
alias: "HASP: update heater status (p1b5.text)" alias: "HASP: update heater status (p1b5.text)"
@@ -89,66 +98,40 @@ automation:
entity_id: entity_id:
- sensor.rinnai_neo_gas_heater_rinnai_neo_gas_heater_status_text - sensor.rinnai_neo_gas_heater_rinnai_neo_gas_heater_status_text
- select.rinnai_neo_gas_heater_mode - 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: action:
- service: script.hasp_publish_heater_status_text - service: script.hasp_publish_heater_status_text
# ------------------------------------------------------------------------- # -------------------------------------------------------------------------
# Setpoint display on left side of centre row # Gas heater setpoint display on page 1
# - Strips any existing units so only one °C is shown
# - Includes thermometer icon so HA updates do not remove it
# ------------------------------------------------------------------------- # -------------------------------------------------------------------------
- id: hasp_setpoint_to_btn_text - id: hasp_setpoint_to_btn_text
alias: "HASP: update setpoint (p1b2.text)" alias: "HASP: update gas heater setpoint (p1b2.text)"
mode: queued mode: queued
trigger: trigger:
- platform: state - platform: state
entity_id: sensor.rinnai_neo_gas_heater_setpoint_text entity_id: sensor.rinnai_neo_gas_heater_setpoint_text
action: action:
- service: mqtt.publish - service: script.hasp_publish_heater_setpoint
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 %}
# ------------------------------------------------------------------------- # -------------------------------------------------------------------------
# Humidity display on right side of centre row # Humidity display on page 1 and page 2
# - Includes water/drop icon so HA updates do not remove it
# ------------------------------------------------------------------------- # -------------------------------------------------------------------------
- id: hasp_humidity_to_btn_text - id: hasp_humidity_to_btn_text
alias: "HASP: update humidity (p1b7.text)" alias: "HASP: update humidity displays"
mode: queued mode: queued
trigger: trigger:
- platform: state - platform: state
entity_id: sensor.lounge_environment_humidity_mqtt entity_id: sensor.lounge_environment_humidity_mqtt
action: action:
- service: mqtt.publish - service: script.hasp_publish_humidity_displays
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 %}
# ------------------------------------------------------------------------- # -------------------------------------------------------------------------
# Up / Down buttons on the HASP plate # Page 1 gas heater setpoint up/down buttons
# These call the existing HA button entities
# ------------------------------------------------------------------------- # -------------------------------------------------------------------------
- id: hasp_btn_up_press - id: hasp_btn_up_press
alias: "HASP: p1b4 up -> heater setpoint UP" alias: "HASP: p1b4 up -> gas heater setpoint UP"
mode: queued mode: queued
trigger: trigger:
- platform: mqtt - platform: mqtt
@@ -162,7 +145,7 @@ automation:
entity_id: button.rinnai_neo_gas_heater_rinnai_neo_gas_heater_setpoint_up entity_id: button.rinnai_neo_gas_heater_rinnai_neo_gas_heater_setpoint_up
- id: hasp_btn_down_press - id: hasp_btn_down_press
alias: "HASP: p1b3 up -> heater setpoint DOWN" alias: "HASP: p1b3 up -> gas heater setpoint DOWN"
mode: queued mode: queued
trigger: trigger:
- platform: mqtt - platform: mqtt
@@ -176,13 +159,10 @@ automation:
entity_id: button.rinnai_neo_gas_heater_rinnai_neo_gas_heater_setpoint_down entity_id: button.rinnai_neo_gas_heater_rinnai_neo_gas_heater_setpoint_down
# ------------------------------------------------------------------------- # -------------------------------------------------------------------------
# Middle flame button # Page 1 gas heater 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.
# ------------------------------------------------------------------------- # -------------------------------------------------------------------------
- id: hasp_btn_heat_toggle - id: hasp_btn_heat_toggle
alias: "HASP: p1b6 up -> heater operation toggle" alias: "HASP: p1b6 up -> gas heater operation toggle"
mode: queued mode: queued
trigger: trigger:
- platform: mqtt - platform: mqtt
@@ -196,14 +176,10 @@ automation:
entity_id: switch.rinnai_neo_gas_heater_heater_operation entity_id: switch.rinnai_neo_gas_heater_heater_operation
# ------------------------------------------------------------------------- # -------------------------------------------------------------------------
# Flame button appearance # Page 1 gas heater middle 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
# ------------------------------------------------------------------------- # -------------------------------------------------------------------------
- id: hasp_heat_button_state - id: hasp_heat_button_state
alias: "HASP: update heat button state (p1b6)" alias: "HASP: update gas heat button state (p1b6)"
mode: restart mode: restart
trigger: trigger:
- platform: state - platform: state
@@ -215,7 +191,91 @@ automation:
- service: script.hasp_apply_heat_button_state - 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 - id: hasp_start_on_ha_start
alias: "HASP: start display loop on HA start" alias: "HASP: start display loop on HA start"
@@ -226,7 +286,7 @@ automation:
- service: script.hasp_push_static_texts - 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 - id: hasp_start_on_panel_online
alias: "HASP: start display loop when panel goes online" alias: "HASP: start display loop when panel goes online"
@@ -243,22 +303,37 @@ automation:
############################################################################### ###############################################################################
# SCRIPTS # SCRIPTS
############################################################################### ###############################################################################
script: script:
# ------------------------------------------------------------------------- # -------------------------------------------------------------------------
# Push all current values / colours to the panel # Push all current values and colours to the panel
# Useful on HA startup and panel reconnect
# ------------------------------------------------------------------------- # -------------------------------------------------------------------------
hasp_push_static_texts: hasp_push_static_texts:
alias: "HASP: push static texts" alias: "HASP: push static texts"
mode: queued mode: queued
sequence: 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_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 - service: mqtt.publish
data: data:
topic: "hasp/openhasp_1/command/p1b1.text" topic: "hasp/openhasp_1/command/p1b1.text"
payload: > payload: >-
{% set raw = states('sensor.lounge_environment_lounge_environment_temperature') %} {% set raw = states('sensor.lounge_environment_lounge_environment_temperature') %}
{% set cleaned = raw {% set cleaned = raw
| replace('°C', '') | replace('°C', '')
@@ -271,12 +346,33 @@ script:
--°C --°C
{% endif %} {% 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 - service: mqtt.publish
data: data:
topic: "hasp/openhasp_1/command/p1b2.text" topic: "hasp/openhasp_1/command/p1b2.text"
payload: > payload: >-
{% set raw = states('sensor.rinnai_neo_gas_heater_setpoint_text') %} {% set raw = states('sensor.rinnai_neo_gas_heater_setpoint_text') %}
{% set cleaned = raw {% set cleaned = raw
| replace('°C', '') | replace('°C', '')
@@ -289,10 +385,17 @@ script:
{{ '\uE50F' }} --°C {{ '\uE50F' }} --°C
{% endif %} {% endif %}
# -------------------------------------------------------------------------
# Publish humidity to page 1 and page 2
# -------------------------------------------------------------------------
hasp_publish_humidity_displays:
alias: "HASP: publish humidity displays"
mode: queued
sequence:
- service: mqtt.publish - service: mqtt.publish
data: data:
topic: "hasp/openhasp_1/command/p1b7.text" topic: "hasp/openhasp_1/command/p1b7.text"
payload: > payload: >-
{% set raw = states('sensor.lounge_environment_humidity_mqtt') %} {% set raw = states('sensor.lounge_environment_humidity_mqtt') %}
{% set cleaned = raw | replace('%', '') | trim %} {% set cleaned = raw | replace('%', '') | trim %}
{% if cleaned in ['unknown', 'unavailable', '', 'none', 'None'] %} {% if cleaned in ['unknown', 'unavailable', '', 'none', 'None'] %}
@@ -301,22 +404,29 @@ script:
{{ '\uE58C' }} {{ cleaned }}% {{ '\uE58C' }} {{ cleaned }}%
{% endif %} {% 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 # Publish gas heater status text to page 1 bottom label
# Keeps OFF/BYPASS display based on ESPHome Mode, not just the operation switch.
# #
# Display behaviour: # Display behaviour:
# - OFF -> Off # - OFF -> Off
# - BYPASS (Remote Only) -> Bypass (Remote Only) # - BYPASS (Remote Only) -> Bypass (Remote Only)
# - Auto but flame OFF -> Auto (Up to Temp) # - Auto but flame OFF -> Auto (Up to Temp)
# - Auto (Level 1) -> Auto 🔥 # - Auto (Level 1) -> Auto + 1 flame icon
# - Auto (Level 2) -> Auto 🔥🔥 # - Auto (Level 2) -> Auto + 2 flame icons
# - Auto (Level 3) -> Auto 🔥🔥🔥 # - Auto (Level 3) -> Auto + 3 flame icons
# - Auto (Level 4) -> Auto 🔥🔥🔥🔥 # - Auto (Level 4) -> Auto + 4 flame icons
#
# The flame is the openHASP/Material icon \uE238, not an emoji.
# ------------------------------------------------------------------------- # -------------------------------------------------------------------------
hasp_publish_heater_status_text: hasp_publish_heater_status_text:
alias: "HASP: publish heater status text" alias: "HASP: publish heater status text"
@@ -325,7 +435,7 @@ script:
- service: mqtt.publish - service: mqtt.publish
data: data:
topic: "hasp/openhasp_1/command/p1b5.text" topic: "hasp/openhasp_1/command/p1b5.text"
payload: > payload: >-
{% set mode = states('select.rinnai_neo_gas_heater_mode') %} {% set mode = states('select.rinnai_neo_gas_heater_mode') %}
{% set op = states('switch.rinnai_neo_gas_heater_heater_operation') %} {% 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') %} {% 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)' %} {% elif mode == 'BYPASS (Remote Only)' %}
Bypass (Remote Only) Bypass (Remote Only)
{% elif op == 'on' and not flame_on %} {% elif op == 'on' and not flame_on %}
Auto Auto (Up to Temp)
{% elif s not in ['unknown', 'unavailable', '', 'none', 'None'] %} {% elif s not in ['unknown', 'unavailable', '', 'none', 'None'] %}
{% set matches = s | regex_findall('Level ([0-9]+)', ignorecase=True) %} {% set matches = s | regex_findall('Level ([0-9]+)') %}
{% set level = matches[0] | int(0) if matches | count > 0 else 0 %} {% if matches | length > 0 %}
{% set level = matches[0] | int(0) %}
{% else %}
{% set level = 0 %}
{% endif %}
{% if level > 0 %} {% if level > 0 %}
Auto {{ flame * level }} Auto {{ flame * level }}
{% else %} {% else %}
@@ -353,10 +467,10 @@ script:
{% endif %} {% endif %}
# ------------------------------------------------------------------------- # -------------------------------------------------------------------------
# Publish middle flame button icon and colours to p1b6 # Apply page 1 gas heater middle flame button state
# ------------------------------------------------------------------------- # -------------------------------------------------------------------------
hasp_apply_heat_button_state: hasp_apply_heat_button_state:
alias: "HASP: apply heat button state" alias: "HASP: apply gas heat button state"
mode: queued mode: queued
sequence: sequence:
- service: mqtt.publish - service: mqtt.publish
@@ -365,8 +479,7 @@ script:
payload: "\uE238" payload: "\uE238"
- choose: - choose:
# BYPASS (Remote Only) -> dark button, amber flame so it is visibly different # BYPASS -> grey button, amber flame
# from ordinary OFF, but still looks inactive.
- conditions: - conditions:
- condition: state - condition: state
entity_id: select.rinnai_neo_gas_heater_mode entity_id: select.rinnai_neo_gas_heater_mode
@@ -389,7 +502,7 @@ script:
topic: "hasp/openhasp_1/command/p1b6.border_color" topic: "hasp/openhasp_1/command/p1b6.border_color"
payload: "#2F3240" payload: "#2F3240"
# OFF -> dark grey button, light grey flame # OFF -> grey button, light grey flame
- conditions: - conditions:
- condition: state - condition: state
entity_id: select.rinnai_neo_gas_heater_mode entity_id: select.rinnai_neo_gas_heater_mode
@@ -412,7 +525,7 @@ script:
topic: "hasp/openhasp_1/command/p1b6.border_color" topic: "hasp/openhasp_1/command/p1b6.border_color"
payload: "#2F3240" payload: "#2F3240"
# AUTO, flame ON -> blue button, red flame # AUTO, flame ON -> yellow button, red flame
- conditions: - conditions:
- condition: state - condition: state
entity_id: switch.rinnai_neo_gas_heater_heater_operation entity_id: switch.rinnai_neo_gas_heater_heater_operation
@@ -428,17 +541,17 @@ script:
- service: mqtt.publish - service: mqtt.publish
data: data:
topic: "hasp/openhasp_1/command/p1b6.bg_color" topic: "hasp/openhasp_1/command/p1b6.bg_color"
payload: "#0095D9" payload: "#FFC107"
- service: mqtt.publish - service: mqtt.publish
data: data:
topic: "hasp/openhasp_1/command/p1b6.bg_grad_color" topic: "hasp/openhasp_1/command/p1b6.bg_grad_color"
payload: "#00B6FF" payload: "#FFD54F"
- service: mqtt.publish - service: mqtt.publish
data: data:
topic: "hasp/openhasp_1/command/p1b6.border_color" 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: - conditions:
- condition: state - condition: state
entity_id: switch.rinnai_neo_gas_heater_heater_operation entity_id: switch.rinnai_neo_gas_heater_heater_operation
@@ -450,19 +563,19 @@ script:
- service: mqtt.publish - service: mqtt.publish
data: data:
topic: "hasp/openhasp_1/command/p1b6.text_color" topic: "hasp/openhasp_1/command/p1b6.text_color"
payload: "#FFFFFF" payload: "#000000"
- service: mqtt.publish - service: mqtt.publish
data: data:
topic: "hasp/openhasp_1/command/p1b6.bg_color" topic: "hasp/openhasp_1/command/p1b6.bg_color"
payload: "#0095D9" payload: "#FFC107"
- service: mqtt.publish - service: mqtt.publish
data: data:
topic: "hasp/openhasp_1/command/p1b6.bg_grad_color" topic: "hasp/openhasp_1/command/p1b6.bg_grad_color"
payload: "#00B6FF" payload: "#FFD54F"
- service: mqtt.publish - service: mqtt.publish
data: data:
topic: "hasp/openhasp_1/command/p1b6.border_color" topic: "hasp/openhasp_1/command/p1b6.border_color"
payload: "#0095D9" payload: "#FFC107"
default: default:
- service: mqtt.publish - service: mqtt.publish
@@ -483,10 +596,129 @@ script:
payload: "#2F3240" payload: "#2F3240"
# ------------------------------------------------------------------------- # -------------------------------------------------------------------------
# Style centre row info buttons as text panels # Push page 2 climate.lounge setpoint and status text
# - p1b2 = setpoint # -------------------------------------------------------------------------
# - p1b7 = humidity hasp_push_page2_climate_texts:
# This removes the default blue button styling from these display-only fields. 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: hasp_style_center_info_buttons:
alias: "HASP: style centre info buttons" alias: "HASP: style centre info buttons"
@@ -525,3 +757,121 @@ script:
data: data:
topic: "hasp/openhasp_1/command/p1b7.border_color" topic: "hasp/openhasp_1/command/p1b7.border_color"
payload: "#000000" 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"
+32 -2
View File
@@ -9,9 +9,13 @@
# quiet_time_on_off_actions.yaml # quiet_time_on_off_actions.yaml
# #
# VERSION: # VERSION:
# V1.1 2026-06-15 # V1.2 2026-06-20
# #
# VERSION HISTORY: # VERSION HISTORY:
# V1.2 2026-06-20
# - Added Quiet Time OFF action to change OpenHASP panel openhasp_1
# back to page 1.
#
# V1.1 2026-06-15 # V1.1 2026-06-15
# - Added separate Quiet Time ON and Quiet Time OFF action sections. # - Added separate Quiet Time ON and Quiet Time OFF action sections.
# - Added support for non-binary Quiet Time OFF actions. # - Added support for non-binary Quiet Time OFF actions.
@@ -37,7 +41,7 @@
# - Empty lists are fine and will simply do nothing. # - Empty lists are fine and will simply do nothing.
# - Use the "Other Quiet Time OFF Actions" section for things that are not # - Use the "Other Quiet Time OFF Actions" section for things that are not
# simple on/off actions, such as setting input_numbers, selects, scenes, # simple on/off actions, such as setting input_numbers, selects, scenes,
# scripts, or custom service calls. # scripts, MQTT commands, or custom service calls.
# #
################################################################################ ################################################################################
@@ -92,6 +96,19 @@ automation:
- entity_id: input_number.openhasp_1_backlight_level - entity_id: input_number.openhasp_1_backlight_level
value: 200 value: 200
##########################################################################
# OPENHASP QUIET TIME OFF PAGE ACTION
##########################################################################
#
# Sends the OpenHASP panel back to the main page when Quiet Time ends.
#
# Current OpenHASP MQTT command topic:
# hasp/openhasp_1/command/page
#
quiet_time_off_openhasp_page_topic: "hasp/openhasp_1/command/page"
quiet_time_off_openhasp_page: 1
triggers: triggers:
- trigger: state - trigger: state
entity_id: input_boolean.quiet_time entity_id: input_boolean.quiet_time
@@ -171,6 +188,19 @@ automation:
data: data:
value: "{{ repeat.item.value | float }}" value: "{{ repeat.item.value | float }}"
##################################################################
# Quiet Time OFF - OpenHASP page action
##################################################################
#
# Change OpenHASP panel back to page 1 when Quiet Time ends.
#
- action: mqtt.publish
data:
topic: "{{ quiet_time_off_openhasp_page_topic }}"
payload: "{{ quiet_time_off_openhasp_page | int }}"
retain: false
################################################################## ##################################################################
# Quiet Time OFF - other custom actions # Quiet Time OFF - other custom actions
################################################################## ##################################################################