additional esphome devices and fixes
This commit is contained in:
@@ -4,41 +4,17 @@
|
||||
#
|
||||
# PAGE OBJECTS USED
|
||||
# - p1b1 = main temperature display
|
||||
# - p1b2 = alternating Setpoint / Humidity display
|
||||
# - p1b2 = setpoint display
|
||||
# - p1b3 = setpoint down
|
||||
# - p1b4 = setpoint up
|
||||
# - p1b5 = heater status text
|
||||
# - p1b6 = heater operation / flame button
|
||||
# - p1b7 = humidity display
|
||||
###############################################################################
|
||||
|
||||
###############################################################################
|
||||
# HELPERS
|
||||
###############################################################################
|
||||
input_boolean:
|
||||
hasp_setpoint_hold_active:
|
||||
name: HASP Setpoint Hold Active
|
||||
initial: false
|
||||
|
||||
input_number:
|
||||
# How long Setpoint and Humidity are each shown before rotating
|
||||
hasp_setpoint_humidity_cycle_seconds:
|
||||
name: HASP Setpoint Humidity Cycle Seconds
|
||||
min: 1
|
||||
max: 60
|
||||
step: 1
|
||||
mode: box
|
||||
unit_of_measurement: s
|
||||
initial: 10
|
||||
|
||||
# After the setpoint changes, hold the setpoint screen for this long
|
||||
hasp_setpoint_hold_seconds:
|
||||
name: HASP Setpoint Hold Seconds
|
||||
min: 1
|
||||
max: 60
|
||||
step: 1
|
||||
mode: box
|
||||
unit_of_measurement: s
|
||||
initial: 15
|
||||
|
||||
###############################################################################
|
||||
# MQTT ENTITIES
|
||||
@@ -48,6 +24,14 @@ mqtt:
|
||||
- name: "Lounge Environment Humidity MQTT"
|
||||
unique_id: "lounge_environment_humidity_mqtt"
|
||||
state_topic: "viewroad-status/lounge-environment/humidity"
|
||||
value_template: >
|
||||
{% set raw = value | trim %}
|
||||
{% if raw.startswith('{') %}
|
||||
{% set j = raw | from_json %}
|
||||
{{ j.humidity | default(j.value | default(raw)) }}
|
||||
{% else %}
|
||||
{{ raw | replace('%', '') | trim }}
|
||||
{% endif %}
|
||||
|
||||
###############################################################################
|
||||
# AUTOMATIONS
|
||||
@@ -99,35 +83,53 @@ automation:
|
||||
{{ s if s not in ['unknown', 'unavailable', ''] else 'HEATER --' }}
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# When setpoint changes:
|
||||
# - immediately show Setpoint
|
||||
# - hold it for hold_seconds
|
||||
# - then allow normal Setpoint/Humidity rotation again
|
||||
# Setpoint display on left side of centre row
|
||||
# - Strips any existing units so only one °C is shown
|
||||
# -------------------------------------------------------------------------
|
||||
- id: hasp_setpoint_changed_hold_display
|
||||
alias: "HASP: show setpoint immediately and hold"
|
||||
mode: restart
|
||||
- id: hasp_setpoint_to_btn_text
|
||||
alias: "HASP: update setpoint (p1b2.text)"
|
||||
mode: queued
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id: sensor.rinnai_neo_gas_heater_setpoint_text
|
||||
action:
|
||||
- service: input_boolean.turn_on
|
||||
target:
|
||||
entity_id: input_boolean.hasp_setpoint_hold_active
|
||||
|
||||
- service: mqtt.publish
|
||||
data:
|
||||
topic: "hasp/openhasp_1/command/p1b2.text"
|
||||
payload: >
|
||||
{% set s = states('sensor.rinnai_neo_gas_heater_setpoint_text') %}
|
||||
{{ 'Setpoint: ' ~ (s if s not in ['unknown', 'unavailable', ''] else '--') }}
|
||||
{% 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'] %}
|
||||
Set: {{ cleaned | float(0) | round(1) }}°C
|
||||
{% else %}
|
||||
Set: -- °C
|
||||
{% endif %}
|
||||
|
||||
- delay:
|
||||
seconds: "{{ states('input_number.hasp_setpoint_hold_seconds') | int(15) }}"
|
||||
|
||||
- service: input_boolean.turn_off
|
||||
target:
|
||||
entity_id: input_boolean.hasp_setpoint_hold_active
|
||||
# -------------------------------------------------------------------------
|
||||
# Humidity display on right side of centre row
|
||||
# -------------------------------------------------------------------------
|
||||
- id: hasp_humidity_to_btn_text
|
||||
alias: "HASP: update humidity (p1b7.text)"
|
||||
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'] %}
|
||||
Hum: Unknown
|
||||
{% else %}
|
||||
Hum: {{ cleaned }}%
|
||||
{% endif %}
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# Up / Down buttons on the HASP plate
|
||||
@@ -298,9 +300,6 @@ automation:
|
||||
event: start
|
||||
action:
|
||||
- service: script.hasp_push_static_texts
|
||||
- service: script.turn_on
|
||||
target:
|
||||
entity_id: script.hasp_rotate_setpoint_humidity
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# Re-push screen state when panel comes online
|
||||
@@ -316,9 +315,6 @@ automation:
|
||||
action:
|
||||
- delay: "00:00:05"
|
||||
- service: script.hasp_push_static_texts
|
||||
- service: script.turn_on
|
||||
target:
|
||||
entity_id: script.hasp_rotate_setpoint_humidity
|
||||
|
||||
###############################################################################
|
||||
# SCRIPTS
|
||||
@@ -332,6 +328,9 @@ script:
|
||||
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: mqtt.publish
|
||||
data:
|
||||
topic: "hasp/openhasp_1/command/p1b1.text"
|
||||
@@ -359,8 +358,29 @@ script:
|
||||
data:
|
||||
topic: "hasp/openhasp_1/command/p1b2.text"
|
||||
payload: >
|
||||
{% set s = states('sensor.rinnai_neo_gas_heater_setpoint_text') %}
|
||||
{{ 'Setpoint: ' ~ (s if s not in ['unknown', 'unavailable', ''] else '--') }}
|
||||
{% 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'] %}
|
||||
Set: {{ cleaned | float(0) | round(1) }}°C
|
||||
{% else %}
|
||||
Set: -- °C
|
||||
{% endif %}
|
||||
|
||||
- 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'] %}
|
||||
Hum: Unknown
|
||||
{% else %}
|
||||
Hum: {{ cleaned }}%
|
||||
{% endif %}
|
||||
|
||||
# Push middle flame button state
|
||||
- service: mqtt.publish
|
||||
@@ -445,42 +465,45 @@ script:
|
||||
payload: "#0095D9"
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# Rotate the middle information line between Setpoint and Humidity
|
||||
# Pauses humidity display while the setpoint hold flag is active
|
||||
# Style centre row info buttons as text panels
|
||||
# - p1b2 = setpoint
|
||||
# - p1b7 = humidity
|
||||
# This removes the default blue button styling from these display-only fields.
|
||||
# -------------------------------------------------------------------------
|
||||
hasp_rotate_setpoint_humidity:
|
||||
alias: "HASP: rotate setpoint and humidity"
|
||||
mode: restart
|
||||
hasp_style_center_info_buttons:
|
||||
alias: "HASP: style centre info buttons"
|
||||
mode: queued
|
||||
sequence:
|
||||
- repeat:
|
||||
while:
|
||||
- condition: template
|
||||
value_template: "{{ true }}"
|
||||
sequence:
|
||||
- service: mqtt.publish
|
||||
data:
|
||||
topic: "hasp/openhasp_1/command/p1b2.text"
|
||||
payload: >
|
||||
{% set s = states('sensor.rinnai_neo_gas_heater_setpoint_text') %}
|
||||
{{ 'Setpoint: ' ~ (s if s not in ['unknown', 'unavailable', ''] else '--') }}
|
||||
- service: mqtt.publish
|
||||
data:
|
||||
topic: "hasp/openhasp_1/command/p1b2.text_color"
|
||||
payload: "#FFFFFF"
|
||||
- service: mqtt.publish
|
||||
data:
|
||||
topic: "hasp/openhasp_1/command/p1b2.bg_color"
|
||||
payload: "#000000"
|
||||
- service: mqtt.publish
|
||||
data:
|
||||
topic: "hasp/openhasp_1/command/p1b2.bg_grad_color"
|
||||
payload: "#000000"
|
||||
- service: mqtt.publish
|
||||
data:
|
||||
topic: "hasp/openhasp_1/command/p1b2.border_color"
|
||||
payload: "#000000"
|
||||
|
||||
- delay:
|
||||
seconds: "{{ states('input_number.hasp_setpoint_humidity_cycle_seconds') | int(10) }}"
|
||||
|
||||
- condition: state
|
||||
entity_id: input_boolean.hasp_setpoint_hold_active
|
||||
state: "off"
|
||||
|
||||
- service: mqtt.publish
|
||||
data:
|
||||
topic: "hasp/openhasp_1/command/p1b2.text"
|
||||
payload: >
|
||||
{% set h = states('sensor.lounge_environment_humidity_mqtt') %}
|
||||
{% if h in ['unknown', 'unavailable', ''] %}
|
||||
Humidity: Unknown
|
||||
{% else %}
|
||||
Humidity: {{ h }}%
|
||||
{% endif %}
|
||||
|
||||
- delay:
|
||||
seconds: "{{ states('input_number.hasp_setpoint_humidity_cycle_seconds') | int(10) }}"
|
||||
- service: mqtt.publish
|
||||
data:
|
||||
topic: "hasp/openhasp_1/command/p1b7.text_color"
|
||||
payload: "#FFFFFF"
|
||||
- service: mqtt.publish
|
||||
data:
|
||||
topic: "hasp/openhasp_1/command/p1b7.bg_color"
|
||||
payload: "#000000"
|
||||
- service: mqtt.publish
|
||||
data:
|
||||
topic: "hasp/openhasp_1/command/p1b7.bg_grad_color"
|
||||
payload: "#000000"
|
||||
- service: mqtt.publish
|
||||
data:
|
||||
topic: "hasp/openhasp_1/command/p1b7.border_color"
|
||||
payload: "#000000"
|
||||
|
||||
Reference in New Issue
Block a user