Edit esp-centralstairs-top.yaml

This commit is contained in:
ESPHome Device Builder
2026-07-21 18:28:33 +12:00
parent 4e2107f7f7
commit 6dc9b56ff7
+32 -9
View File
@@ -6,6 +6,7 @@
# https://home.fox.co.nz/gitea/zorruno/zorruno-homeassistant/src/branch/master/esphome/esp-centralstairs-top.yaml
#:########################################################################################:#
# VERSIONS:
# V3.9 2026-07-21 Added retained MQTT status mirroring for HA-independent two-way switching
# V3.8 2026-04-26 Added Downstairs Lights Bulk Activation virtual switch toggled by Button 1 double-click
# V3.7 2025-09-24 Upload to this device
# V3.5 2025-07-24 YAML tidyups
@@ -83,7 +84,7 @@ substitutions:
# Project Naming
project_name: "Zemismart Technologies.KS-811 Double" # Project Details
project_version: "v2.1" # Project V denotes release of yaml file, allowing checking of deployed vs latest version
project_version: "v3.9" # Project V denotes release of yaml file, allowing checking of deployed vs latest version
# MQTT Controls
mqtt_command_main_topic: !secret mqtt_command_main_topic
@@ -184,19 +185,19 @@ mqtt:
then:
- if:
condition:
lambda: 'return id(Relay_2).state;'
lambda: "return id(Relay_2).state;"
then:
- mqtt.publish:
topic: "${mqtt_status_topic_2}"
payload: "${mqtt_command_ON}"
qos: 0
retain: false
qos: 1
retain: true
else:
- mqtt.publish:
topic: "${mqtt_status_topic_2}"
payload: "${mqtt_command_OFF}"
qos: 0
retain: false
qos: 1
retain: true
on_message:
# Relay 1: only turn ON if currently OFF
@@ -241,6 +242,26 @@ mqtt:
then:
- switch.turn_off: Relay_2
# Relay 1 is a mirror of the remote physical Main Stair Lights relay.
- topic: "${mqtt_status_topic_1}"
payload: "${mqtt_command_ON}"
then:
- if:
condition:
not:
- switch.is_on: Relay_1
then:
- switch.turn_on: Relay_1
- topic: "${mqtt_status_topic_1}"
payload: "${mqtt_command_OFF}"
then:
- if:
condition:
- switch.is_on: Relay_1
then:
- switch.turn_off: Relay_1
#:########################################################################################:#
# STATUS LED:
# https://esphome.io/components/status_led.html
@@ -286,7 +307,7 @@ binary_sensor:
then:
- if:
condition:
lambda: 'return id(Relay_1).state;'
lambda: "return id(Relay_1).state;"
then:
- mqtt.publish:
topic: "${mqtt_command_topic_1}"
@@ -338,9 +359,11 @@ switch:
- mqtt.publish:
topic: "${mqtt_status_topic_2}"
payload: "${mqtt_command_ON}"
retain: false
qos: 1
retain: true
on_turn_off:
- mqtt.publish:
topic: "${mqtt_status_topic_2}"
payload: "${mqtt_command_OFF}"
retain: false
qos: 1
retain: true