diff --git a/esphome/esp-downstairskitchleds.yaml b/esphome/esp-downstairskitchleds.yaml index a37a749..a688cca 100644 --- a/esphome/esp-downstairskitchleds.yaml +++ b/esphome/esp-downstairskitchleds.yaml @@ -6,6 +6,7 @@ # https://home.fox.co.nz/gitea/zorruno/zorruno-homeassistant/src/branch/master/esphome/esp-downstairskitchleds.yaml #:########################################################################################:# # VERSIONS: +# v2.4 2026-07-26 Republish retained MQTT status whenever the broker reconnects # v2.3 2026-07-25 Standardized MQTT payloads: "ON"/"OFF" → "On"/"Off" # v2.2 2026-07-20 Simplified local MQTT command and status topics to the device root # v2.1 2026-02-25 Updated yaml to zorruno layout V1.1 @@ -96,7 +97,7 @@ substitutions: # Project Naming project_name: "Sinilink.XY-WFMS" # Project details. Manufacturer before the dot, device after the dot. - project_version: "v2.3" # Project version denotes release of the YAML file, allowing checking of deployed vs latest version + project_version: "v2.4" # Project version denotes release of the YAML file, allowing checking of deployed vs latest version # Passwords & Secrets (Unfortunately, you can't use substitutions inside secret names) api_key: !secret esp-api_key @@ -356,6 +357,16 @@ status_led: # MQTT: Device-specific command triggers #:########################################################################################:# mqtt: + on_connect: + then: + - mqtt.publish: + topic: "${mqtt_local_status_topic}" + payload: !lambda |- + return id(mosfet_leds).current_values.is_on() + ? "${mqtt_local_device_command_ON}" + : "${mqtt_local_device_command_OFF}"; + retain: true + on_message: # Light control to ramp up - topic: "${mqtt_local_command_topic}"