diff --git a/README.md b/README.md index df691a8..2100a0f 100644 --- a/README.md +++ b/README.md @@ -100,6 +100,24 @@ The YAML files enable standard ESPHome OTA updates. Once a device has been flash Most configurations also expose a managed `Firmware Update` entity in Home Assistant. This entity checks the device-specific manifest published on GitHub Pages and can install released firmware over HTTP. The ESP32-C5 smart plug currently uses standard ESPHome OTA only. +#### Disabling the Managed Firmware Update + +The managed update feature is provided by the `ota` `http_request` platform, the `http_request` component, and the `update` `Firmware Update` entity. On some ESPHome versions the periodic HTTP manifest checks can make the device's status LED flash constantly (see [issue #88](https://github.com/athom-tech/esp32-configs/issues/88)). + +Because devices are imported through `packages:`, do not edit the Athom YAML directly. Instead, add these overrides to your **own** configuration (the file that imports the package) to remove the managed update components: + +```yaml +ota: + - id: !remove ota_http_request + +update: + - id: !remove update_http_request + +http_request: !remove +``` + +Standard ESPHome OTA (the `ota_esphome` platform) still works after this — only the managed HTTP-manifest updating and its `Firmware Update` entity are removed. To re-enable the feature later, delete this override block. + If OTA fails, confirm that: - The device is powered and connected to the same network as ESPHome. @@ -141,6 +159,10 @@ Make sure the device and Home Assistant are on the same network segment, then ad Use the installed device's matching YAML, verify network reachability, and try a USB flash if the device is offline or running incompatible firmware. +### Status LED Flashes Constantly + +On some ESPHome versions, the periodic HTTP requests from the managed firmware-update feature can make the status LED flash rapidly and constantly, even though the device otherwise works and stays connected to Home Assistant. Disable the managed update as described in [Disabling the Managed Firmware Update](#disabling-the-managed-firmware-update). + ### Local Build Fails Update ESPHome, check the error message for missing dependencies or component compatibility, and compare the failing YAML with nearby device configurations that build successfully. The CI workflow is the reference for the ESPHome versions expected to build. diff --git a/athom-smart-plug-v5.yaml b/athom-smart-plug-v5.yaml index b1b7656..159717d 100644 --- a/athom-smart-plug-v5.yaml +++ b/athom-smart-plug-v5.yaml @@ -10,7 +10,7 @@ substitutions: # Project Name project_name: "China Athom Technology.Athom Plug V5" # Projection version denotes the release version of the yaml file, allowing checking of deployed vs latest version - project_version: "v5.0.3" + project_version: "v5.0.4" # Restore the relay (GPO switch) upon reboot to state: relay_restore_mode: RESTORE_DEFAULT_ON # Set the update interval for sensors @@ -209,11 +209,21 @@ binary_sensor: - ON for at most 1s - OFF for at least 0.2s then: - - switch.toggle: relay + # Ignore short press when child lock is on, to stop kids toggling the socket + - if: + condition: + switch.is_off: child_lock + then: + - switch.toggle: relay - timing: - ON for at least 4s then: - - button.press: Reset + # Ignore long press when child lock is on, to prevent accidental factory reset + - if: + condition: + switch.is_off: child_lock + then: + - button.press: Reset sensor: - platform: uptime @@ -329,6 +339,15 @@ switch: restore_mode: ${relay_restore_mode} icon: mdi:${power_plug_type} + # Child lock: when on, ignore physical button short/long press, but keep remote (HA/web) control working + - platform: template + name: "Child Lock" + id: child_lock + icon: mdi:lock + optimistic: true + restore_mode: RESTORE_DEFAULT_OFF # Keep last state after power loss/reboot, default off on first boot + entity_category: config + light: - platform: status_led name: "Status LED" diff --git a/athom-smart-plug.yaml b/athom-smart-plug.yaml index c878c34..6504701 100644 --- a/athom-smart-plug.yaml +++ b/athom-smart-plug.yaml @@ -234,11 +234,21 @@ binary_sensor: - ON for at most 1s - OFF for at least 0.2s then: - - switch.toggle: relay + # Ignore short press when child lock is on, to stop kids toggling the socket + - if: + condition: + switch.is_off: child_lock + then: + - switch.toggle: relay - timing: - ON for at least 4s then: - - button.press: Reset + # Ignore long press when child lock is on, to prevent accidental factory reset + - if: + condition: + switch.is_off: child_lock + then: + - button.press: Reset sensor: - platform: uptime @@ -373,6 +383,15 @@ switch: restore_mode: ${relay_restore_mode} icon: mdi:${power_plug_type} + # Child lock: when on, ignore physical button short/long press, but keep remote (HA/web) control working + - platform: template + name: "Child Lock" + id: child_lock + icon: mdi:lock + optimistic: true + restore_mode: RESTORE_DEFAULT_OFF # Keep last state after power loss/reboot, default off on first boot + entity_category: config + light: - platform: status_led name: "Status LED"