Edit esp-masterbdrmwest.yaml
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
# https://home.fox.co.nz/gitea/zorruno/zorruno-homeassistant/src/branch/master/esphome/esp-masterbdrmwest.yaml
|
||||
#:########################################################################################:#
|
||||
# VERSIONS:
|
||||
# v1.4 2026-07-20 Flattened retained North and South MQTT status topics to the device roots.
|
||||
# v1.3 2026-06-12 Reassigned logical controls after live wiring checks.
|
||||
# Relay 1 on both switches = North Lights virtual/Tasmota control.
|
||||
# Relay 2 on both switches = South Lights control; WEST Relay 2 is physical load.
|
||||
@@ -55,7 +56,7 @@
|
||||
# NOTE: TOGGLE is intentionally not handled here to avoid double-toggle if both switches receive it.
|
||||
#
|
||||
# - North Lights retained status/sync topic:
|
||||
# ${mqtt_local_status_topic1}/state
|
||||
# ${mqtt_local_status_topic1}
|
||||
# Payload "On" / "Off" mirrors the actual North Lights state.
|
||||
#
|
||||
# - South Lights local command topic:
|
||||
@@ -65,7 +66,7 @@
|
||||
# NOTE: TOGGLE is intentionally not handled here to avoid ambiguous multi-device toggles.
|
||||
#
|
||||
# - South Lights retained status/sync topic:
|
||||
# ${mqtt_local_status_topic2}/state
|
||||
# ${mqtt_local_status_topic2}
|
||||
# Payload "On" / "Off" published when Relay 2 changes state.
|
||||
#:########################################################################################:#
|
||||
# OFFLINE NOTES:
|
||||
@@ -88,7 +89,6 @@
|
||||
# - Accurate time is NOT needed (SNTP not needed).
|
||||
#:########################################################################################:#
|
||||
|
||||
|
||||
#:########################################################################################:#
|
||||
# SUBSTITUTIONS: Specific device variable substitutions
|
||||
# If NOT using a secrets file, just replace these with the passwords etc (in quotes)
|
||||
@@ -102,7 +102,7 @@ substitutions:
|
||||
|
||||
# Project Naming
|
||||
project_name: "Zemismart Technologies.KS-811 Triple"
|
||||
project_version: "v1.3"
|
||||
project_version: "v1.4"
|
||||
|
||||
# Passwords & Secrets
|
||||
api_key: !secret esp-api_key
|
||||
@@ -217,22 +217,22 @@ globals:
|
||||
- id: north_update_from_sync
|
||||
type: bool
|
||||
restore_value: false
|
||||
initial_value: 'false'
|
||||
initial_value: "false"
|
||||
|
||||
- id: south_update_from_sync
|
||||
type: bool
|
||||
restore_value: false
|
||||
initial_value: 'false'
|
||||
initial_value: "false"
|
||||
|
||||
- id: north_lights_state
|
||||
type: bool
|
||||
restore_value: false
|
||||
initial_value: 'false'
|
||||
initial_value: "false"
|
||||
|
||||
- id: south_lights_state
|
||||
type: bool
|
||||
restore_value: false
|
||||
initial_value: 'false'
|
||||
initial_value: "false"
|
||||
|
||||
#:########################################################################################:#
|
||||
# MQTT: Device-specific MQTT command + retained status/sync triggers
|
||||
@@ -274,7 +274,7 @@ mqtt:
|
||||
}
|
||||
|
||||
# Retained North status is a secondary mirror/sync path.
|
||||
- topic: "${mqtt_local_status_topic1}/state"
|
||||
- topic: "${mqtt_local_status_topic1}"
|
||||
then:
|
||||
- lambda: |-
|
||||
if (x == "On" || x == "ON" || x == "on") {
|
||||
@@ -296,7 +296,7 @@ mqtt:
|
||||
}
|
||||
|
||||
# Retained South status keeps this physical relay and the SOUTH mirror in step.
|
||||
- topic: "${mqtt_local_status_topic2}/state"
|
||||
- topic: "${mqtt_local_status_topic2}"
|
||||
then:
|
||||
- lambda: |-
|
||||
if (x == "On" || x == "ON" || x == "on") {
|
||||
@@ -415,7 +415,7 @@ script:
|
||||
id(north_update_from_sync) = true;
|
||||
- switch.turn_on: relay_1
|
||||
- mqtt.publish:
|
||||
topic: "${mqtt_local_status_topic1}/state"
|
||||
topic: "${mqtt_local_status_topic1}"
|
||||
payload: "On"
|
||||
retain: true
|
||||
- lambda: |-
|
||||
@@ -429,7 +429,7 @@ script:
|
||||
id(north_update_from_sync) = true;
|
||||
- switch.turn_off: relay_1
|
||||
- mqtt.publish:
|
||||
topic: "${mqtt_local_status_topic1}/state"
|
||||
topic: "${mqtt_local_status_topic1}"
|
||||
payload: "Off"
|
||||
retain: true
|
||||
- lambda: |-
|
||||
@@ -554,10 +554,10 @@ switch:
|
||||
}
|
||||
- if:
|
||||
condition:
|
||||
lambda: 'return !id(south_update_from_sync);'
|
||||
lambda: "return !id(south_update_from_sync);"
|
||||
then:
|
||||
- mqtt.publish:
|
||||
topic: "${mqtt_local_status_topic2}/state"
|
||||
topic: "${mqtt_local_status_topic2}"
|
||||
payload: "On"
|
||||
retain: true
|
||||
on_turn_off:
|
||||
@@ -568,10 +568,10 @@ switch:
|
||||
}
|
||||
- if:
|
||||
condition:
|
||||
lambda: 'return !id(south_update_from_sync);'
|
||||
lambda: "return !id(south_update_from_sync);"
|
||||
then:
|
||||
- mqtt.publish:
|
||||
topic: "${mqtt_local_status_topic2}/state"
|
||||
topic: "${mqtt_local_status_topic2}"
|
||||
payload: "Off"
|
||||
retain: true
|
||||
|
||||
|
||||
Reference in New Issue
Block a user