Edit esp-centralstairs-top.yaml
This commit is contained in:
@@ -6,6 +6,7 @@
|
|||||||
# https://home.fox.co.nz/gitea/zorruno/zorruno-homeassistant/src/branch/master/esphome/esp-centralstairs-top.yaml
|
# https://home.fox.co.nz/gitea/zorruno/zorruno-homeassistant/src/branch/master/esphome/esp-centralstairs-top.yaml
|
||||||
#:########################################################################################:#
|
#:########################################################################################:#
|
||||||
# VERSIONS:
|
# 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.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.7 2025-09-24 Upload to this device
|
||||||
# V3.5 2025-07-24 YAML tidyups
|
# V3.5 2025-07-24 YAML tidyups
|
||||||
@@ -83,7 +84,7 @@ substitutions:
|
|||||||
|
|
||||||
# Project Naming
|
# Project Naming
|
||||||
project_name: "Zemismart Technologies.KS-811 Double" # Project Details
|
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 Controls
|
||||||
mqtt_command_main_topic: !secret mqtt_command_main_topic
|
mqtt_command_main_topic: !secret mqtt_command_main_topic
|
||||||
@@ -184,19 +185,19 @@ mqtt:
|
|||||||
then:
|
then:
|
||||||
- if:
|
- if:
|
||||||
condition:
|
condition:
|
||||||
lambda: 'return id(Relay_2).state;'
|
lambda: "return id(Relay_2).state;"
|
||||||
then:
|
then:
|
||||||
- mqtt.publish:
|
- mqtt.publish:
|
||||||
topic: "${mqtt_status_topic_2}"
|
topic: "${mqtt_status_topic_2}"
|
||||||
payload: "${mqtt_command_ON}"
|
payload: "${mqtt_command_ON}"
|
||||||
qos: 0
|
qos: 1
|
||||||
retain: false
|
retain: true
|
||||||
else:
|
else:
|
||||||
- mqtt.publish:
|
- mqtt.publish:
|
||||||
topic: "${mqtt_status_topic_2}"
|
topic: "${mqtt_status_topic_2}"
|
||||||
payload: "${mqtt_command_OFF}"
|
payload: "${mqtt_command_OFF}"
|
||||||
qos: 0
|
qos: 1
|
||||||
retain: false
|
retain: true
|
||||||
|
|
||||||
on_message:
|
on_message:
|
||||||
# Relay 1: only turn ON if currently OFF
|
# Relay 1: only turn ON if currently OFF
|
||||||
@@ -241,6 +242,26 @@ mqtt:
|
|||||||
then:
|
then:
|
||||||
- switch.turn_off: Relay_2
|
- 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:
|
# STATUS LED:
|
||||||
# https://esphome.io/components/status_led.html
|
# https://esphome.io/components/status_led.html
|
||||||
@@ -286,7 +307,7 @@ binary_sensor:
|
|||||||
then:
|
then:
|
||||||
- if:
|
- if:
|
||||||
condition:
|
condition:
|
||||||
lambda: 'return id(Relay_1).state;'
|
lambda: "return id(Relay_1).state;"
|
||||||
then:
|
then:
|
||||||
- mqtt.publish:
|
- mqtt.publish:
|
||||||
topic: "${mqtt_command_topic_1}"
|
topic: "${mqtt_command_topic_1}"
|
||||||
@@ -338,9 +359,11 @@ switch:
|
|||||||
- mqtt.publish:
|
- mqtt.publish:
|
||||||
topic: "${mqtt_status_topic_2}"
|
topic: "${mqtt_status_topic_2}"
|
||||||
payload: "${mqtt_command_ON}"
|
payload: "${mqtt_command_ON}"
|
||||||
retain: false
|
qos: 1
|
||||||
|
retain: true
|
||||||
on_turn_off:
|
on_turn_off:
|
||||||
- mqtt.publish:
|
- mqtt.publish:
|
||||||
topic: "${mqtt_status_topic_2}"
|
topic: "${mqtt_status_topic_2}"
|
||||||
payload: "${mqtt_command_OFF}"
|
payload: "${mqtt_command_OFF}"
|
||||||
retain: false
|
qos: 1
|
||||||
|
retain: true
|
||||||
|
|||||||
Reference in New Issue
Block a user