additional esphome devices and fixes
This commit is contained in:
@@ -0,0 +1,88 @@
|
||||
################################################################################
|
||||
# PACKAGE: Downstairs Lights Bulk Activation
|
||||
# FILE: packages/downstairs_lights_bulk_activation.yaml
|
||||
#
|
||||
# Version: 1.0
|
||||
# Date: 2026-04-26
|
||||
#
|
||||
# Notes:
|
||||
# - Uses the virtual switch:
|
||||
# switch.central_stair_lightswitch_top_2_downstairs_lights_bulk_activation
|
||||
#
|
||||
# - When the virtual switch turns ON:
|
||||
# Turns ON the listed downstairs lights, but only if each light is currently OFF.
|
||||
#
|
||||
# - When the virtual switch turns OFF:
|
||||
# Turns OFF the listed downstairs lights, but only if each light is currently ON.
|
||||
#
|
||||
# - No action is taken unless:
|
||||
# input_boolean.downstairs_flat_occupied is ON.
|
||||
################################################################################
|
||||
|
||||
automation:
|
||||
- id: downstairs_lights_bulk_activation
|
||||
alias: "Downstairs Lights Bulk Activation"
|
||||
description: >
|
||||
V1.0 - 2026-04-26: Bulk ON/OFF control for downstairs lights from the
|
||||
central stair lightswitch virtual switch. Only operates when the downstairs
|
||||
flat occupied input_boolean is ON.
|
||||
|
||||
mode: single
|
||||
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id: switch.central_stair_lightswitch_top_2_downstairs_lights_bulk_activation
|
||||
to:
|
||||
- "on"
|
||||
- "off"
|
||||
|
||||
condition:
|
||||
- condition: state
|
||||
entity_id: input_boolean.downstairs_flat_occupied
|
||||
state: "off"
|
||||
|
||||
action:
|
||||
- choose:
|
||||
######################################################################
|
||||
# BULK ACTIVATION ON:
|
||||
# Turn lights ON, but only where they are currently OFF.
|
||||
######################################################################
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: switch.central_stair_lightswitch_top_2_downstairs_lights_bulk_activation
|
||||
state: "on"
|
||||
sequence:
|
||||
- repeat:
|
||||
for_each:
|
||||
- switch.esp_centralstairs_bottom_relay_1_main_stair_lights_lower
|
||||
- switch.esp_downstloungemain_relay_1_main_lights
|
||||
- switch.esp_downstkitchlights_relay_2_kitchen_light
|
||||
- switch.esp_downstkitchlights_relay_1_dining_light
|
||||
sequence:
|
||||
- condition: template
|
||||
value_template: "{{ is_state(repeat.item, 'off') }}"
|
||||
- service: switch.turn_on
|
||||
target:
|
||||
entity_id: "{{ repeat.item }}"
|
||||
|
||||
######################################################################
|
||||
# BULK ACTIVATION OFF:
|
||||
# Turn lights OFF, but only where they are currently ON.
|
||||
######################################################################
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: switch.central_stair_lightswitch_top_2_downstairs_lights_bulk_activation
|
||||
state: "off"
|
||||
sequence:
|
||||
- repeat:
|
||||
for_each:
|
||||
- switch.esp_centralstairs_bottom_relay_1_main_stair_lights_lower
|
||||
- switch.esp_downstloungemain_relay_1_main_lights
|
||||
- switch.esp_downstkitchlights_relay_2_kitchen_light
|
||||
- switch.esp_downstkitchlights_relay_1_dining_light
|
||||
sequence:
|
||||
- condition: template
|
||||
value_template: "{{ is_state(repeat.item, 'on') }}"
|
||||
- service: switch.turn_off
|
||||
target:
|
||||
entity_id: "{{ repeat.item }}"
|
||||
@@ -132,15 +132,15 @@ automation:
|
||||
target:
|
||||
entity_id: switch.esp_officedeskrightgpo_office_right_hand_gpo
|
||||
|
||||
- alias: "Turn on Office USB Hub if needed"
|
||||
if:
|
||||
- condition: state
|
||||
entity_id: switch.esp_officeusbhubpower_usb_hub_power_supply
|
||||
state: "off"
|
||||
then:
|
||||
- action: switch.turn_on
|
||||
target:
|
||||
entity_id: switch.esp_officeusbhubpower_usb_hub_power_supply
|
||||
#- alias: "Turn on Office USB Hub if needed"
|
||||
# if:
|
||||
# - condition: state
|
||||
# entity_id: switch.esp_officeusbhubpower_usb_hub_power_supply
|
||||
# state: "off"
|
||||
# then:
|
||||
# - action: switch.turn_on
|
||||
# target:
|
||||
# entity_id: switch.esp_officeusbhubpower_usb_hub_power_supply
|
||||
|
||||
##############################################################
|
||||
# Lights.
|
||||
@@ -294,15 +294,15 @@ automation:
|
||||
target:
|
||||
entity_id: switch.esp_officeelvcontrol_office_elv_power_supply
|
||||
|
||||
- alias: "Turn off Office USB Hub power supply if needed"
|
||||
if:
|
||||
- condition: state
|
||||
entity_id: switch.esp_officeusbhubpower_usb_hub_power_supply
|
||||
state: "on"
|
||||
then:
|
||||
- action: switch.turn_off
|
||||
target:
|
||||
entity_id: switch.esp_officeusbhubpower_usb_hub_power_supply
|
||||
#- alias: "Turn off Office USB Hub power supply if needed"
|
||||
# if:
|
||||
# - condition: state
|
||||
# entity_id: switch.esp_officeusbhubpower_usb_hub_power_supply
|
||||
# state: "on"
|
||||
# then:
|
||||
# - action: switch.turn_off
|
||||
# target:
|
||||
# entity_id: switch.esp_officeusbhubpower_usb_hub_power_supply
|
||||
|
||||
##############################################################
|
||||
# Manual master/latch relay off last.
|
||||
@@ -395,15 +395,15 @@ automation:
|
||||
target:
|
||||
entity_id: switch.esp_officeelvcontrol_office_elv_power_supply
|
||||
|
||||
- alias: "Turn off Office USB Hub power supply if needed"
|
||||
if:
|
||||
- condition: state
|
||||
entity_id: switch.esp_officeusbhubpower_usb_hub_power_supply
|
||||
state: "on"
|
||||
then:
|
||||
- action: switch.turn_off
|
||||
target:
|
||||
entity_id: switch.esp_officeusbhubpower_usb_hub_power_supply
|
||||
#- alias: "Turn off Office USB Hub power supply if needed"
|
||||
# if:
|
||||
# - condition: state
|
||||
# entity_id: switch.esp_officeusbhubpower_usb_hub_power_supply
|
||||
# state: "on"
|
||||
# then:
|
||||
# - action: switch.turn_off
|
||||
# target:
|
||||
# entity_id: switch.esp_officeusbhubpower_usb_hub_power_supply
|
||||
|
||||
##############################################################
|
||||
# Manual master/latch relay off last.
|
||||
@@ -456,15 +456,15 @@ automation:
|
||||
target:
|
||||
entity_id: switch.esp_officedeskrightgpo_office_right_hand_gpo
|
||||
|
||||
- alias: "Turn on Office USB Hub power supply if needed"
|
||||
if:
|
||||
- condition: state
|
||||
entity_id: switch.esp_officeusbhubpower_usb_hub_power_supply
|
||||
state: "off"
|
||||
then:
|
||||
- action: switch.turn_on
|
||||
target:
|
||||
entity_id: switch.esp_officeusbhubpower_usb_hub_power_supply
|
||||
# alias: "Turn on Office USB Hub power supply if needed"
|
||||
# if:
|
||||
# - condition: state
|
||||
# entity_id: switch.esp_officeusbhubpower_usb_hub_power_supply
|
||||
# state: "off"
|
||||
# then:
|
||||
# - action: switch.turn_on
|
||||
# target:
|
||||
# entity_id: switch.esp_officeusbhubpower_usb_hub_power_supply
|
||||
|
||||
##############################################################
|
||||
# Lights.
|
||||
|
||||
@@ -56,7 +56,6 @@ automation:
|
||||
# -------------------------------------------------------------------------
|
||||
# Main temperature display
|
||||
# - Shows normal lounge temperature
|
||||
# - If heater test mode is ON, shows the test temperature instead
|
||||
# - Normalises values so we do not get duplicated °C or long float strings
|
||||
# -------------------------------------------------------------------------
|
||||
- id: hasp_temp_to_btn_text
|
||||
@@ -64,20 +63,13 @@ automation:
|
||||
mode: queued
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id:
|
||||
- sensor.lounge_environment_lounge_environment_temperature
|
||||
- switch.rinnai_neo_gas_heater_rinnai_neo_gas_heater_test_mode
|
||||
- sensor.rinnai_neo_gas_heater_rinnai_neo_gas_heater_test_mode_temp
|
||||
entity_id: sensor.lounge_environment_lounge_environment_temperature
|
||||
action:
|
||||
- service: mqtt.publish
|
||||
data:
|
||||
topic: "hasp/openhasp_1/command/p1b1.text"
|
||||
payload: >
|
||||
{% if is_state('switch.rinnai_neo_gas_heater_rinnai_neo_gas_heater_test_mode', 'on') %}
|
||||
{% set raw = states('sensor.rinnai_neo_gas_heater_rinnai_neo_gas_heater_test_mode_temp') %}
|
||||
{% else %}
|
||||
{% set raw = states('sensor.lounge_environment_lounge_environment_temperature') %}
|
||||
{% endif %}
|
||||
{% set raw = states('sensor.lounge_environment_lounge_environment_temperature') %}
|
||||
{% set cleaned = raw
|
||||
| replace('°C', '')
|
||||
| replace('° C', '')
|
||||
@@ -189,9 +181,9 @@ automation:
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# Flame button appearance
|
||||
# - Operation OFF: solid light grey background, white flame
|
||||
# - Operation ON, flame OFF: solid dark background, white flame
|
||||
# - Operation ON, flame ON: solid dark background, continuous red/orange flicker
|
||||
# - Operation OFF: dark grey background, light grey flame
|
||||
# - Operation ON, Activate Flame OFF: theme blue background, white flame
|
||||
# - Operation ON, Activate Flame ON: theme blue background, solid red flame
|
||||
# -------------------------------------------------------------------------
|
||||
- id: hasp_heat_button_state
|
||||
alias: "HASP: update heat button state (p1b6)"
|
||||
@@ -200,19 +192,15 @@ automation:
|
||||
- platform: state
|
||||
entity_id:
|
||||
- switch.rinnai_neo_gas_heater_heater_operation
|
||||
- switch.rinnai_neo_gas_heater_rinnai_neo_gas_heater_power
|
||||
- switch.rinnai_neo_gas_heater_rinnai_neo_gas_heater_activate_flame
|
||||
action:
|
||||
- choose:
|
||||
# OFF → dark grey (same as your other inactive buttons)
|
||||
# Heater Operation OFF -> dark grey button, light grey flame
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: switch.rinnai_neo_gas_heater_heater_operation
|
||||
state: "off"
|
||||
sequence:
|
||||
- service: script.turn_off
|
||||
target:
|
||||
entity_id: script.hasp_heat_flame_flicker
|
||||
|
||||
- service: mqtt.publish
|
||||
data:
|
||||
topic: "hasp/openhasp_1/command/p1b6.text"
|
||||
@@ -221,9 +209,8 @@ automation:
|
||||
- service: mqtt.publish
|
||||
data:
|
||||
topic: "hasp/openhasp_1/command/p1b6.text_color"
|
||||
payload: "#FFFFFF"
|
||||
payload: "#C0C0C0"
|
||||
|
||||
# solid dark grey (no gradient)
|
||||
- service: mqtt.publish
|
||||
data:
|
||||
topic: "hasp/openhasp_1/command/p1b6.bg_color"
|
||||
@@ -237,19 +224,15 @@ automation:
|
||||
topic: "hasp/openhasp_1/command/p1b6.border_color"
|
||||
payload: "#2F3240"
|
||||
|
||||
# ON (not firing) → theme blue
|
||||
# Heater Operation ON, flame OFF -> blue button, white flame
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: switch.rinnai_neo_gas_heater_heater_operation
|
||||
state: "on"
|
||||
- condition: state
|
||||
entity_id: switch.rinnai_neo_gas_heater_rinnai_neo_gas_heater_power
|
||||
entity_id: switch.rinnai_neo_gas_heater_rinnai_neo_gas_heater_activate_flame
|
||||
state: "off"
|
||||
sequence:
|
||||
- service: script.turn_off
|
||||
target:
|
||||
entity_id: script.hasp_heat_flame_flicker
|
||||
|
||||
- service: mqtt.publish
|
||||
data:
|
||||
topic: "hasp/openhasp_1/command/p1b6.text"
|
||||
@@ -260,7 +243,6 @@ automation:
|
||||
topic: "hasp/openhasp_1/command/p1b6.text_color"
|
||||
payload: "#FFFFFF"
|
||||
|
||||
# MATCH THEME BLUE
|
||||
- service: mqtt.publish
|
||||
data:
|
||||
topic: "hasp/openhasp_1/command/p1b6.bg_color"
|
||||
@@ -274,13 +256,13 @@ automation:
|
||||
topic: "hasp/openhasp_1/command/p1b6.border_color"
|
||||
payload: "#0095D9"
|
||||
|
||||
# ON + flame → blue background + flicker
|
||||
# Heater Operation ON, flame ON -> blue button, red flame
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: switch.rinnai_neo_gas_heater_heater_operation
|
||||
state: "on"
|
||||
- condition: state
|
||||
entity_id: switch.rinnai_neo_gas_heater_rinnai_neo_gas_heater_power
|
||||
entity_id: switch.rinnai_neo_gas_heater_rinnai_neo_gas_heater_activate_flame
|
||||
state: "on"
|
||||
sequence:
|
||||
- service: mqtt.publish
|
||||
@@ -288,7 +270,11 @@ automation:
|
||||
topic: "hasp/openhasp_1/command/p1b6.text"
|
||||
payload: "\uE238"
|
||||
|
||||
# keep blue background
|
||||
- service: mqtt.publish
|
||||
data:
|
||||
topic: "hasp/openhasp_1/command/p1b6.text_color"
|
||||
payload: "#FF3030"
|
||||
|
||||
- service: mqtt.publish
|
||||
data:
|
||||
topic: "hasp/openhasp_1/command/p1b6.bg_color"
|
||||
@@ -302,10 +288,6 @@ automation:
|
||||
topic: "hasp/openhasp_1/command/p1b6.border_color"
|
||||
payload: "#0095D9"
|
||||
|
||||
- service: script.turn_on
|
||||
target:
|
||||
entity_id: script.hasp_heat_flame_flicker
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# Start / restart display when HA starts
|
||||
# -------------------------------------------------------------------------
|
||||
@@ -354,11 +336,7 @@ script:
|
||||
data:
|
||||
topic: "hasp/openhasp_1/command/p1b1.text"
|
||||
payload: >
|
||||
{% if is_state('switch.rinnai_neo_gas_heater_rinnai_neo_gas_heater_test_mode', 'on') %}
|
||||
{% set raw = states('sensor.rinnai_neo_gas_heater_rinnai_neo_gas_heater_test_mode_temp') %}
|
||||
{% else %}
|
||||
{% set raw = states('sensor.lounge_environment_lounge_environment_temperature') %}
|
||||
{% endif %}
|
||||
{% set raw = states('sensor.lounge_environment_lounge_environment_temperature') %}
|
||||
{% set cleaned = raw
|
||||
| replace('°C', '')
|
||||
| replace('° C', '')
|
||||
@@ -391,6 +369,7 @@ script:
|
||||
payload: "\uE238"
|
||||
|
||||
- choose:
|
||||
# Heater Operation OFF -> dark grey button, light grey flame
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: switch.rinnai_neo_gas_heater_heater_operation
|
||||
@@ -399,7 +378,7 @@ script:
|
||||
- service: mqtt.publish
|
||||
data:
|
||||
topic: "hasp/openhasp_1/command/p1b6.text_color"
|
||||
payload: "#FFFFFF"
|
||||
payload: "#C0C0C0"
|
||||
- service: mqtt.publish
|
||||
data:
|
||||
topic: "hasp/openhasp_1/command/p1b6.bg_color"
|
||||
@@ -413,12 +392,13 @@ script:
|
||||
topic: "hasp/openhasp_1/command/p1b6.border_color"
|
||||
payload: "#2F3240"
|
||||
|
||||
# Heater Operation ON, flame OFF -> blue button, white flame
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: switch.rinnai_neo_gas_heater_heater_operation
|
||||
state: "on"
|
||||
- condition: state
|
||||
entity_id: switch.rinnai_neo_gas_heater_rinnai_neo_gas_heater_power
|
||||
entity_id: switch.rinnai_neo_gas_heater_rinnai_neo_gas_heater_activate_flame
|
||||
state: "off"
|
||||
sequence:
|
||||
- service: mqtt.publish
|
||||
@@ -438,14 +418,19 @@ script:
|
||||
topic: "hasp/openhasp_1/command/p1b6.border_color"
|
||||
payload: "#0095D9"
|
||||
|
||||
# Heater Operation ON, flame ON -> blue button, red flame
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: switch.rinnai_neo_gas_heater_heater_operation
|
||||
state: "on"
|
||||
- condition: state
|
||||
entity_id: switch.rinnai_neo_gas_heater_rinnai_neo_gas_heater_power
|
||||
entity_id: switch.rinnai_neo_gas_heater_rinnai_neo_gas_heater_activate_flame
|
||||
state: "on"
|
||||
sequence:
|
||||
- service: mqtt.publish
|
||||
data:
|
||||
topic: "hasp/openhasp_1/command/p1b6.text_color"
|
||||
payload: "#FF3030"
|
||||
- service: mqtt.publish
|
||||
data:
|
||||
topic: "hasp/openhasp_1/command/p1b6.bg_color"
|
||||
@@ -458,9 +443,6 @@ script:
|
||||
data:
|
||||
topic: "hasp/openhasp_1/command/p1b6.border_color"
|
||||
payload: "#0095D9"
|
||||
- service: script.turn_on
|
||||
target:
|
||||
entity_id: script.hasp_heat_flame_flicker
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# Rotate the middle information line between Setpoint and Humidity
|
||||
@@ -502,45 +484,3 @@ script:
|
||||
|
||||
- delay:
|
||||
seconds: "{{ states('input_number.hasp_setpoint_humidity_cycle_seconds') | int(10) }}"
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# Continuous flame flicker while heater operation is ON and flame/power is ON
|
||||
# Only the icon colour flickers. Background stays fixed.
|
||||
# Flicker colours are red <-> orange
|
||||
# -------------------------------------------------------------------------
|
||||
hasp_heat_flame_flicker:
|
||||
alias: "HASP: heat flame flicker"
|
||||
mode: restart
|
||||
sequence:
|
||||
- repeat:
|
||||
while:
|
||||
- condition: state
|
||||
entity_id: switch.rinnai_neo_gas_heater_heater_operation
|
||||
state: "on"
|
||||
- condition: state
|
||||
entity_id: switch.rinnai_neo_gas_heater_rinnai_neo_gas_heater_power
|
||||
state: "on"
|
||||
sequence:
|
||||
- service: mqtt.publish
|
||||
data:
|
||||
topic: "hasp/openhasp_1/command/p1b6.text_color"
|
||||
payload: "#FF3030"
|
||||
- delay: "00:00:00.35"
|
||||
|
||||
- service: mqtt.publish
|
||||
data:
|
||||
topic: "hasp/openhasp_1/command/p1b6.text_color"
|
||||
payload: "#FF8C00"
|
||||
- delay: "00:00:00.20"
|
||||
|
||||
- service: mqtt.publish
|
||||
data:
|
||||
topic: "hasp/openhasp_1/command/p1b6.text_color"
|
||||
payload: "#FF5A36"
|
||||
- delay: "00:00:00.30"
|
||||
|
||||
- service: mqtt.publish
|
||||
data:
|
||||
topic: "hasp/openhasp_1/command/p1b6.text_color"
|
||||
payload: "#FFA500"
|
||||
- delay: "00:00:00.18"
|
||||
|
||||
Reference in New Issue
Block a user