diff --git a/esphome/esp-officeusbhubpower.yaml b/esphome/esp-officeusbhubpower.yaml index 3d3bd85..c962e44 100644 --- a/esphome/esp-officeusbhubpower.yaml +++ b/esphome/esp-officeusbhubpower.yaml @@ -6,6 +6,7 @@ # https://home.fox.co.nz/gitea/zorruno/zorruno-homeassistant/src/branch/master/esphome/esp-officeusbhubpower.yaml #:########################################################################################:# # VERSIONS: +# V1.2 2026-07-20 Simplified local MQTT command and status topics to the device root # V1.1 2026-02-25 Updated yaml to zorruno layout V1.1 # V1.0 2025-06-14 Initial Version #:########################################################################################:# @@ -22,10 +23,10 @@ #:########################################################################################:# # MQTT COMMANDS: # Command (set relay): -# - ${mqtt_command_topic}/relay1/set -> ON, OFF +# - ${mqtt_command_topic} -> ON, OFF # # Status (published from template sensor): -# - ${mqtt_status_topic}/relay1/state -> ON, OFF +# - ${mqtt_status_topic} -> ON, OFF #:########################################################################################:# # OFFLINE NOTES: # a) Home Assistant OFFLINE, but Network and MQTT ONLINE @@ -54,7 +55,7 @@ substitutions: # Project Naming project_name: "Sonoff Technologies.Sonoff Basic V1" - project_version: "v1.1" + project_version: "v1.2" # Passwords & Secrets (Unfortunately, you cannot use substitutions inside secret names) api_key: !secret esp-api_key @@ -201,12 +202,12 @@ binary_sensor: return id(relay1).state; on_press: - mqtt.publish: - topic: "${mqtt_status_topic}/relay1/state" + topic: "${mqtt_status_topic}" payload: "ON" retain: false on_release: - mqtt.publish: - topic: "${mqtt_status_topic}/relay1/state" + topic: "${mqtt_status_topic}" payload: "OFF" retain: false @@ -227,12 +228,12 @@ status_led: #:########################################################################################:# mqtt: on_message: - - topic: "${mqtt_command_topic}/relay1/set" + - topic: "${mqtt_command_topic}" payload: "ON" then: - switch.turn_on: relay1 - - topic: "${mqtt_command_topic}/relay1/set" + - topic: "${mqtt_command_topic}" payload: "OFF" then: - - switch.turn_off: relay1 \ No newline at end of file + - switch.turn_off: relay1