diff --git a/athom-1gang-switch.yaml b/athom-1gang-switch.yaml index f321b95..a590e81 100644 --- a/athom-1gang-switch.yaml +++ b/athom-1gang-switch.yaml @@ -10,7 +10,7 @@ substitutions: # Project Name project_name: "China Athom Technology.1Gang Switch" # Projection version denotes the release version of the yaml file, allowing checking of deployed vs latest version - project_version: "v3.0.1" + project_version: "v3.0.2" # Restore the relay (GPO switch) upon reboot to state: light_restore_mode: RESTORE_DEFAULT_OFF # Define a domain for this device to use. i.e. iot.home.lan (so device will appear as athom-smart-plug-v2.iot.home.lan in DNS/DHCP logs) @@ -37,7 +37,7 @@ esphome: comment: "${device_description}" area: "${room}" name_add_mac_suffix: true - min_version: 2025.7.0 + min_version: 2026.6.0 project: name: "${project_name}" version: "${project_version}" @@ -105,6 +105,23 @@ api: ota: - platform: esphome + # Enables OTA firmware flashing from a URL (used by the update component below) + - platform: http_request + +# Required by the ota http_request platform and the update component. +# verify_ssl: false skips TLS cert validation to reduce heap/RAM pressure during +# the download; the manifest's MD5 still verifies firmware integrity before flashing. +http_request: + verify_ssl: false + +update: + # Managed updates via HTTP request: periodically checks the published manifest + # and exposes a "Firmware Update" entity, pointing at this device's GitHub Pages + # manifest. Pages URLs avoid the redirect/buffer issues of Release download URLs. + - platform: http_request + name: "Firmware Update" + source: https://athom-tech.github.io/esp32-configs/firmware/athom-1gang-switch.manifest.json + # update_interval defaults to 6h (how often it checks, not installs) logger: baud_rate: 0 # 0 Enables logging, but disables serial-port logging to free CPU and memory diff --git a/athom-2ch-relay-board.yaml b/athom-2ch-relay-board.yaml index aeb2901..1b523de 100644 --- a/athom-2ch-relay-board.yaml +++ b/athom-2ch-relay-board.yaml @@ -4,7 +4,7 @@ substitutions: room: "" device_description: "athom esp32 2ch relay board" project_name: "Athom Technology.ESP32 2CH Relay Board" - project_version: "v2.0.5" + project_version: "v2.0.6" update_interval: 60s # Define a domain for this device to use. i.e. iot.home.lan (so device will appear as athom-smart-plug-v2.iot.home.lan in DNS/DHCP logs) dns_domain: ".local" @@ -31,7 +31,7 @@ esphome: comment: "${device_description}" area: "${room}" name_add_mac_suffix: true - min_version: 2025.7.0 + min_version: 2026.6.0 project: name: "${project_name}" version: "${project_version}" @@ -44,6 +44,12 @@ esp32: framework: type: esp-idf version: recommended + sdkconfig_options: + # @grigi found in testing that these options resulted in better responsiveness. + # BLE 4.2 is supported by ALL ESP32 boards that have bluetooth, the original and derivatives. + CONFIG_BT_BLE_42_FEATURES_SUPPORTED: y + # Extend the watchdog timeout, so the device reboots if the device appears locked up for over 10 seconds. + CONFIG_ESP_TASK_WDT_TIMEOUT_S: "10" preferences: flash_write_interval: 5min @@ -61,9 +67,37 @@ web_server: # Enable Home Assistant API api: + on_client_connected: + - esp32_ble_tracker.start_scan: + continuous: true + # Disable BLE tracking when there are no api connections live + on_client_disconnected: + if: + condition: + not: + api.connected: + then: + - esp32_ble_tracker.stop_scan: ota: - platform: esphome + # Enables OTA firmware flashing from a URL (used by the update component below) + - platform: http_request + +# Required by the ota http_request platform and the update component. +# verify_ssl: false skips TLS cert validation to reduce heap/RAM pressure during +# the download; the manifest's MD5 still verifies firmware integrity before flashing. +http_request: + verify_ssl: true + +update: + # Managed updates via HTTP request: periodically checks the published manifest + # and exposes a "Firmware Update" entity, pointing at this device's GitHub Pages + # manifest. Pages URLs avoid the redirect/buffer issues of Release download URLs. + - platform: http_request + name: "Firmware Update" + source: https://athom-tech.github.io/esp32-configs/firmware/athom-2ch-relay-board.manifest.json + # update_interval defaults to 6h (how often it checks, not installs) network: enable_ipv6: ${ipv6_enable} @@ -83,17 +117,22 @@ improv_serial: esp32_improv: authorizer: none +esp32_ble_tracker: + scan_parameters: + # Don't auto start BLE scanning, we control it in the `api` block's automation. + continuous: false + active: true # send scan-request packets to gather more info, like device name for some devices. + interval: 320ms # default 320ms - how long to spend on each advert channel + window: 300ms # default 30ms - how long to actually "listen" in each interval. Reduce this if device is unstable. + # If the device cannot keep up or becomes unstable, reduce the "window" setting. This may be + # required if your device is controlling other sensors or doing PWM for lights etc. + +bluetooth_proxy: + active: true + dashboard_import: package_import_url: github://athom-tech/esp32-configs/athom-2ch-relay-board.yaml -# esp32_ble_tracker: -# scan_parameters: -# interval: 1100ms -# window: 1100ms -# active: true - -# bluetooth_proxy: -# active: true remote_receiver: pin: GPIO17 diff --git a/athom-2gang-switch.yaml b/athom-2gang-switch.yaml index 459fc9d..eea70c7 100644 --- a/athom-2gang-switch.yaml +++ b/athom-2gang-switch.yaml @@ -10,7 +10,7 @@ substitutions: # Project Name project_name: "China Athom Technology.2Gang Switch" # Projection version denotes the release version of the yaml file, allowing checking of deployed vs latest version - project_version: "v3.0.1" + project_version: "v3.0.2" # Restore the relay (GPO switch) upon reboot to state: light1_restore_mode: RESTORE_DEFAULT_OFF light2_restore_mode: RESTORE_DEFAULT_OFF @@ -38,7 +38,7 @@ esphome: comment: "${device_description}" area: "${room}" name_add_mac_suffix: true - min_version: 2025.7.0 + min_version: 2026.6.0 project: name: "${project_name}" version: "${project_version}" @@ -108,6 +108,23 @@ api: ota: - platform: esphome + # Enables OTA firmware flashing from a URL (used by the update component below) + - platform: http_request + +# Required by the ota http_request platform and the update component. +# verify_ssl: false skips TLS cert validation to reduce heap/RAM pressure during +# the download; the manifest's MD5 still verifies firmware integrity before flashing. +http_request: + verify_ssl: false + +update: + # Managed updates via HTTP request: periodically checks the published manifest + # and exposes a "Firmware Update" entity, pointing at this device's GitHub Pages + # manifest. Pages URLs avoid the redirect/buffer issues of Release download URLs. + - platform: http_request + name: "Firmware Update" + source: https://athom-tech.github.io/esp32-configs/firmware/athom-2gang-switch.manifest.json + # update_interval defaults to 6h (how often it checks, not installs) logger: baud_rate: 0 # 0 Enables logging, but disables serial-port logging to free CPU and memory diff --git a/athom-3gang-switch.yaml b/athom-3gang-switch.yaml index bc9b9a7..5a0b263 100644 --- a/athom-3gang-switch.yaml +++ b/athom-3gang-switch.yaml @@ -10,7 +10,7 @@ substitutions: # Project Name project_name: "China Athom Technology.3Gang Switch" # Projection version denotes the release version of the yaml file, allowing checking of deployed vs latest version - project_version: "v3.0.1" + project_version: "v3.0.2" # Restore the relay (GPO switch) upon reboot to state: light1_restore_mode: RESTORE_DEFAULT_OFF light2_restore_mode: RESTORE_DEFAULT_OFF @@ -39,7 +39,7 @@ esphome: comment: "${device_description}" area: "${room}" name_add_mac_suffix: true - min_version: 2025.7.0 + min_version: 2026.6.0 project: name: "${project_name}" version: "${project_version}" @@ -111,6 +111,23 @@ api: ota: - platform: esphome + # Enables OTA firmware flashing from a URL (used by the update component below) + - platform: http_request + +# Required by the ota http_request platform and the update component. +# verify_ssl: false skips TLS cert validation to reduce heap/RAM pressure during +# the download; the manifest's MD5 still verifies firmware integrity before flashing. +http_request: + verify_ssl: false + +update: + # Managed updates via HTTP request: periodically checks the published manifest + # and exposes a "Firmware Update" entity, pointing at this device's GitHub Pages + # manifest. Pages URLs avoid the redirect/buffer issues of Release download URLs. + - platform: http_request + name: "Firmware Update" + source: https://athom-tech.github.io/esp32-configs/firmware/athom-3gang-switch.manifest.json + # update_interval defaults to 6h (how often it checks, not installs) logger: baud_rate: 0 # 0 Enables logging, but disables serial-port logging to free CPU and memory diff --git a/athom-4ch-relay-board.yaml b/athom-4ch-relay-board.yaml index 3544b4f..29418b2 100644 --- a/athom-4ch-relay-board.yaml +++ b/athom-4ch-relay-board.yaml @@ -4,7 +4,7 @@ substitutions: room: "" device_description: "athom esp32 4ch relay board" project_name: "Athom Technology.ESP32 4CH Relay Board" - project_version: "v2.0.5" + project_version: "v2.0.6" update_interval: 60s # Define a domain for this device to use. i.e. iot.home.lan (so device will appear as athom-smart-plug-v2.iot.home.lan in DNS/DHCP logs) dns_domain: ".local" @@ -33,7 +33,7 @@ esphome: comment: "${device_description}" area: "${room}" name_add_mac_suffix: true - min_version: 2025.7.0 + min_version: 2026.6.0 project: name: "${project_name}" version: "${project_version}" @@ -46,6 +46,12 @@ esp32: framework: type: esp-idf version: recommended + sdkconfig_options: + # @grigi found in testing that these options resulted in better responsiveness. + # BLE 4.2 is supported by ALL ESP32 boards that have bluetooth, the original and derivatives. + CONFIG_BT_BLE_42_FEATURES_SUPPORTED: y + # Extend the watchdog timeout, so the device reboots if the device appears locked up for over 10 seconds. + CONFIG_ESP_TASK_WDT_TIMEOUT_S: "10" preferences: flash_write_interval: 5min @@ -63,9 +69,37 @@ web_server: # Enable Home Assistant API api: + on_client_connected: + - esp32_ble_tracker.start_scan: + continuous: true + # Disable BLE tracking when there are no api connections live + on_client_disconnected: + if: + condition: + not: + api.connected: + then: + - esp32_ble_tracker.stop_scan: ota: - platform: esphome + # Enables OTA firmware flashing from a URL (used by the update component below) + - platform: http_request + +# Required by the ota http_request platform and the update component. +# verify_ssl: false skips TLS cert validation to reduce heap/RAM pressure during +# the download; the manifest's MD5 still verifies firmware integrity before flashing. +http_request: + verify_ssl: true + +update: + # Managed updates via HTTP request: periodically checks the published manifest + # and exposes a "Firmware Update" entity, pointing at this device's GitHub Pages + # manifest. Pages URLs avoid the redirect/buffer issues of Release download URLs. + - platform: http_request + name: "Firmware Update" + source: https://athom-tech.github.io/esp32-configs/firmware/athom-4ch-relay-board.manifest.json + # update_interval defaults to 6h (how often it checks, not installs) network: enable_ipv6: ${ipv6_enable} @@ -85,18 +119,22 @@ improv_serial: esp32_improv: authorizer: none +esp32_ble_tracker: + scan_parameters: + # Don't auto start BLE scanning, we control it in the `api` block's automation. + continuous: false + active: true # send scan-request packets to gather more info, like device name for some devices. + interval: 320ms # default 320ms - how long to spend on each advert channel + window: 300ms # default 30ms - how long to actually "listen" in each interval. Reduce this if device is unstable. + # If the device cannot keep up or becomes unstable, reduce the "window" setting. This may be + # required if your device is controlling other sensors or doing PWM for lights etc. + +bluetooth_proxy: + active: true + dashboard_import: package_import_url: github://athom-tech/esp32-configs/athom-4ch-relay-board.yaml -# esp32_ble_tracker: -# scan_parameters: -# interval: 1100ms -# window: 1100ms -# active: true - -# bluetooth_proxy: -# active: true - remote_receiver: pin: GPIO17 dump: rc_switch diff --git a/athom-4gang-switch.yaml b/athom-4gang-switch.yaml index e992a2c..fb0d022 100644 --- a/athom-4gang-switch.yaml +++ b/athom-4gang-switch.yaml @@ -10,7 +10,7 @@ substitutions: # Project Name project_name: "China Athom Technology.4Gang Switch" # Projection version denotes the release version of the yaml file, allowing checking of deployed vs latest version - project_version: "v3.0.1" + project_version: "v3.0.2" # Restore the relay (GPO switch) upon reboot to state: light1_restore_mode: RESTORE_DEFAULT_OFF light2_restore_mode: RESTORE_DEFAULT_OFF @@ -114,6 +114,23 @@ api: ota: - platform: esphome + # Enables OTA firmware flashing from a URL (used by the update component below) + - platform: http_request + +# Required by the ota http_request platform and the update component. +# verify_ssl: false skips TLS cert validation to reduce heap/RAM pressure during +# the download; the manifest's MD5 still verifies firmware integrity before flashing. +http_request: + verify_ssl: false + +update: + # Managed updates via HTTP request: periodically checks the published manifest + # and exposes a "Firmware Update" entity, pointing at this device's GitHub Pages + # manifest. Pages URLs avoid the redirect/buffer issues of Release download URLs. + - platform: http_request + name: "Firmware Update" + source: https://athom-tech.github.io/esp32-configs/firmware/athom-4gang-switch.manifest.json + # update_interval defaults to 6h (how often it checks, not installs) logger: baud_rate: 0 # 0 Enables logging, but disables serial-port logging to free CPU and memory diff --git a/athom-8ch-relay-board.yaml b/athom-8ch-relay-board.yaml index 756d5ef..993314c 100644 --- a/athom-8ch-relay-board.yaml +++ b/athom-8ch-relay-board.yaml @@ -4,7 +4,7 @@ substitutions: room: "" device_description: "athom esp32 8ch relay board" project_name: "Athom Technology.ESP32 8CH Relay Board" - project_version: "v2.0.5" + project_version: "v2.0.6" update_interval: 60s # Define a domain for this device to use. i.e. iot.home.lan (so device will appear as athom-smart-plug-v2.iot.home.lan in DNS/DHCP logs) dns_domain: ".local" @@ -37,7 +37,7 @@ esphome: comment: "${device_description}" area: "${room}" name_add_mac_suffix: true - min_version: 2025.7.0 + min_version: 2026.6.0 project: name: "${project_name}" version: "${project_version}" @@ -50,6 +50,12 @@ esp32: framework: type: esp-idf version: recommended + sdkconfig_options: + # @grigi found in testing that these options resulted in better responsiveness. + # BLE 4.2 is supported by ALL ESP32 boards that have bluetooth, the original and derivatives. + CONFIG_BT_BLE_42_FEATURES_SUPPORTED: y + # Extend the watchdog timeout, so the device reboots if the device appears locked up for over 10 seconds. + CONFIG_ESP_TASK_WDT_TIMEOUT_S: "10" preferences: flash_write_interval: 5min @@ -67,9 +73,37 @@ web_server: # Enable Home Assistant API api: + on_client_connected: + - esp32_ble_tracker.start_scan: + continuous: true + # Disable BLE tracking when there are no api connections live + on_client_disconnected: + if: + condition: + not: + api.connected: + then: + - esp32_ble_tracker.stop_scan: ota: - platform: esphome + # Enables OTA firmware flashing from a URL (used by the update component below) + - platform: http_request + +# Required by the ota http_request platform and the update component. +# verify_ssl: false skips TLS cert validation to reduce heap/RAM pressure during +# the download; the manifest's MD5 still verifies firmware integrity before flashing. +http_request: + verify_ssl: true + +update: + # Managed updates via HTTP request: periodically checks the published manifest + # and exposes a "Firmware Update" entity, pointing at this device's GitHub Pages + # manifest. Pages URLs avoid the redirect/buffer issues of Release download URLs. + - platform: http_request + name: "Firmware Update" + source: https://athom-tech.github.io/esp32-configs/firmware/athom-8ch-relay-board.manifest.json + # update_interval defaults to 6h (how often it checks, not installs) network: enable_ipv6: ${ipv6_enable} @@ -89,18 +123,22 @@ improv_serial: esp32_improv: authorizer: none +esp32_ble_tracker: + scan_parameters: + # Don't auto start BLE scanning, we control it in the `api` block's automation. + continuous: false + active: true # send scan-request packets to gather more info, like device name for some devices. + interval: 320ms # default 320ms - how long to spend on each advert channel + window: 300ms # default 30ms - how long to actually "listen" in each interval. Reduce this if device is unstable. + # If the device cannot keep up or becomes unstable, reduce the "window" setting. This may be + # required if your device is controlling other sensors or doing PWM for lights etc. + +bluetooth_proxy: + active: true + dashboard_import: package_import_url: github://athom-tech/esp32-configs/athom-8ch-relay-board.yaml -# esp32_ble_tracker: -# scan_parameters: -# interval: 1100ms -# window: 1100ms -# active: true - -# bluetooth_proxy: -# active: true - remote_receiver: pin: GPIO17 dump: rc_switch diff --git a/athom-dual-smart-plug-v3.yaml b/athom-dual-smart-plug-v3.yaml new file mode 100644 index 0000000..3839815 --- /dev/null +++ b/athom-dual-smart-plug-v3.yaml @@ -0,0 +1,420 @@ +substitutions: + # Default name + name: athom-dual-smart-plug-v3 + # Default friendly name + friendly_name: Athom Dual Plug V3 + # Allows ESP device to be automatically linked to an 'Area' in Home Assistant. Typically used for areas such as 'Lounge Room', 'Kitchen' etc + room: "" + # Description as appears in ESPHome & top of webserver page + device_description: athom esp32-c3 power monitoring dual smart plug + # Project Name + project_name: China Athom Technology.Athom Dual Plug V3 + # Projection version denotes the release version of the yaml file, allowing checking of deployed vs latest version + project_version: v3.0.1 + # Restore the relay (GPO switch) upon reboot to state: + relay1_restore_mode: RESTORE_DEFAULT_ON + relay2_restore_mode: RESTORE_DEFAULT_ON + # Set the update interval for sensors + sensor_update_interval: 10s + # Current Limit in Amps. + current_limit : "16" + # Define a domain for this device to use. i.e. iot.home.lan (so device will appear as athom-smart-plug-v2.iot.home.lan in DNS/DHCP logs) + dns_domain: ".local" + # Set timezone of the smart plug. Useful if the plug is in a location different to the HA server. Can be entered in unix Country/Area format (i.e. "Australia/Sydney") + timezone: "" + # Set the duration between the sntp service polling ntp.org servers for an update + sntp_update_interval: 6h + # Network time servers for your region, enter from lowest to highest priority. To use local servers update as per zones or countries at: https://www.ntppool.org/zone/@ + sntp_server_1: "0.pool.ntp.org" + sntp_server_2: "1.pool.ntp.org" + sntp_server_3: "2.pool.ntp.org" + # Enables faster network connections, with last connected SSID being connected to and no full scan for SSID being undertaken + wifi_fast_connect: "false" + # Define logging level: NONE, ERROR, WARN, INFO, DEBUG (Default), VERBOSE, VERY_VERBOSE + log_level: "INFO" + # Hide the ENERGY sensor that shows kWh consumed, but with no time period associated with it. Resets when device restarted and reflashed. + hide_energy_sensor: "true" + # Enable or disable the use of IPv6 networking on the device + ipv6_enable: "false" + # Power plug icon selection. Change to reflect the type/country of powr plug in use, this will update the power plug icon shown next to the switch + power_plug_type: "power-socket-eu" # Options: power-socket-au | power-socket-ch | power-socket-de | power-socket-eu | power-socket-fr | power-socket-it | power-socket-jp | power-socket-uk | power-socket-us | + +########################## End of Substitutions ######################### + +esphome: + name: "${name}" + friendly_name: "${friendly_name}" + comment: "${device_description}" + area: "${room}" + name_add_mac_suffix: true + min_version: 2026.6.0 + project: + name: "${project_name}" + version: "${project_version}" + platformio_options: + board_build.mcu: esp32c3 + board_build.variant: esp32c3 + board_build.flash_mode: dio + on_boot: + - priority: 600 + then: + - select.set_index: + id: power_mode + index: !lambda |- + return id(restore_mode)-1; + - lambda: |- + switch(id(restore_mode)) + { + case 1:{ + id(relay1).turn_off(); + id(relay2).turn_off(); + break; + } + case 2:{ + id(relay1).turn_on(); + id(relay2).turn_on(); + break; + } + default:{ + break; + } + } + + +esp32: + board: esp32-c3-devkitm-1 + flash_size: 4MB + variant: ESP32C3 + framework: + type: esp-idf + version: recommended + sdkconfig_options: + # @grigi found in testing that these options resulted in better responsiveness. + # BLE 4.2 is supported by ALL ESP32 boards that have bluetooth, the original and derivatives. + CONFIG_BT_BLE_42_FEATURES_SUPPORTED: y + # Also enable this on any derivative boards (S2, C3 etc) but not the original ESP32. + CONFIG_BT_BLE_50_FEATURES_SUPPORTED: y + # Extend the watchdog timeout, so the device reboots if the device appears locked up for over 10 seconds. + CONFIG_ESP_TASK_WDT_TIMEOUT_S: "10" + +preferences: + flash_write_interval: 5min + +api: + # reboot_timeout: 0s + # Only enable BLE tracking when wifi is up and api is connected + # Gives single-core ESP32-C3 devices time to manage wifi and authenticate with api + on_client_connected: + - esp32_ble_tracker.start_scan: + continuous: true + # Disable BLE tracking when there are no api connections live + on_client_disconnected: + if: + condition: + not: + api.connected: + then: + - esp32_ble_tracker.stop_scan: + +ota: + - platform: esphome + # Enables OTA firmware flashing from a URL (used by the update component below) + - platform: http_request + +# Required by the ota http_request platform and the update component. +# verify_ssl: false skips TLS cert validation to reduce heap/RAM pressure during +# the download; the manifest's MD5 still verifies firmware integrity before flashing. +http_request: + verify_ssl: false + +update: + # Managed updates via HTTP request: periodically checks the published manifest + # and exposes a "Firmware Update" entity, pointing at this device's GitHub Pages + # manifest. Pages URLs avoid the redirect/buffer issues of Release download URLs. + - platform: http_request + name: "Firmware Update" + source: https://athom-tech.github.io/esp32-configs/firmware/athom-dual-smart-plug-v3.manifest.json + # update_interval defaults to 6h (how often it checks, not installs) + +logger: + baud_rate: 0 # 0 Enables logging, but disables serial-port logging to free CPU and memory + level: ${log_level} + +mdns: + disabled: false + +web_server: + port: 80 +# version: 3 + +network: + enable_ipv6: ${ipv6_enable} + +wifi: + # This spawns an AP with the device name and mac address with no password. + ap: {} + # Allow rapid re-connection to previously connect WiFi SSID, skipping scan of all SSID + fast_connect: "${wifi_fast_connect}" + # Define dns domain / suffix to add to hostname + domain: "${dns_domain}" + +captive_portal: + +esp32_improv: + authorizer: none + +esp32_ble_tracker: + scan_parameters: + # Don't auto start BLE scanning, we control it in the `api` block's automation. + continuous: false + active: true # send scan-request packets to gather more info, like device name for some devices. + interval: 320ms # default 320ms - how long to spend on each advert channel + window: 300ms # default 30ms - how long to actually "listen" in each interval. Reduce this if device is unstable. + # If the device cannot keep up or becomes unstable, reduce the "window" setting. This may be + # required if your device is controlling other sensors or doing PWM for lights etc. + +bluetooth_proxy: + active: true + +dashboard_import: + package_import_url: "github://athom-tech/esp32-configs/athom-dual-smart-plug-v3.yaml" + +uart: + tx_pin: GPIO21 + rx_pin: GPIO20 + baud_rate: 4800 + data_bits: 8 + stop_bits: 1 + parity: EVEN + +globals: + - id: total_energy + type: float + restore_value: yes + initial_value: '0.0' + + - id: restore_mode + type: int + restore_value: yes + initial_value: "2" # 0 = Always_Off. 1 = Restore_Power_Off. 2 = Always_On. + +select: + - platform: template + name: "Power On State" + id: "power_mode" + optimistic: true + icon: mdi:electric-switch + options: + - Always Off + - Always On + - Restore Power Off State + on_value: + then: + - lambda: |- + id(restore_mode)=i+1; + +binary_sensor: + - platform: status + name: "Status" + icon: mdi:check-network-outline + entity_category: diagnostic + + - platform: gpio + pin: + number: GPIO7 + mode: INPUT_PULLUP + inverted: true + name: "Power Button1" + id: power_button1 + disabled_by_default: true + on_multi_click: + - timing: + - ON for at most 1s + - OFF for at least 0.2s + then: + - switch.toggle: relay1 + - timing: + - ON for at least 4s + then: + - button.press: Reset + + - platform: gpio + pin: + number: GPIO3 + mode: INPUT_PULLUP + inverted: true + name: "Power Button2" + id: power_button2 + disabled_by_default: true + on_multi_click: + - timing: + - ON for at most 1s + - OFF for at least 0.2s + then: + - switch.toggle: relay2 + - timing: + - ON for at least 4s + then: + - button.press: Reset + +sensor: + - platform: uptime + name: "Uptime Sensor" + id: uptime_sensor + type: + timestamp + entity_category: "diagnostic" + + - platform: wifi_signal + name: "WiFi Signal dB" + id: wifi_signal_db + update_interval: 60s + entity_category: "diagnostic" + + - platform: copy + source_id: wifi_signal_db + name: "WiFi Signal Percent" + filters: + - lambda: return min(max(2 * (x + 100.0), 0.0), 100.0); + unit_of_measurement: "Signal %" + entity_category: "diagnostic" + device_class: "" + + - platform: bl0939 + id: athom_bl0939 + update_interval: ${sensor_update_interval} + voltage: + name: 'Voltage' + current_1: + name: 'Current 1' + on_value_range: + - above: ${current_limit} + then: + - switch.turn_off: relay1 + current_2: + name: 'Current 2' + on_value_range: + - above: ${current_limit} + then: + - switch.turn_off: relay2 + active_power_1: + name: Active Power 1 + id: power_1 + active_power_2: + name: Active Power 2 + id: power_2 + energy_1: + name: Energy 1 + id: energy_1 + energy_2: + name: 'Energy 2' + id: energy_2 + energy_total: + name: 'Energy Total' + + - platform: total_daily_energy + name: "Total Daily Energy 1" + restore: true + power_id: power_1 + unit_of_measurement: kWh + icon: mdi:hours-24 + accuracy_decimals: 3 + filters: + - multiply: 0.001 + + - platform: total_daily_energy + name: "Total Daily Energy 2" + restore: true + power_id: power_2 + unit_of_measurement: kWh + icon: mdi:hours-24 + accuracy_decimals: 3 + filters: + - multiply: 0.001 + +button: + - platform: restart + name: "Restart" + entity_category: config + + - platform: factory_reset + name: "Factory Reset" + id: Reset + entity_category: config + + - platform: safe_mode + name: "Safe Mode" + internal: false + entity_category: config + +switch: + - platform: gpio + name: "Power1" + pin: GPIO4 + id: relay1 + restore_mode: ${relay1_restore_mode} + icon: mdi:${power_plug_type} + + - platform: gpio + name: "Power2" + pin: GPIO5 + id: relay2 + restore_mode: ${relay2_restore_mode} + icon: mdi:${power_plug_type} + +light: + - platform: status_led + name: "Status LED" + id: blue_led + icon: mdi:lightbulb-outline + disabled_by_default: true + pin: + inverted: true + number: GPIO6 + +text_sensor: + - platform: wifi_info + ip_address: + name: "IP Address" + icon: mdi:ip-network + entity_category: diagnostic + ssid: + name: "Connected SSID" + icon: mdi:wifi-strength-2 + entity_category: diagnostic + mac_address: + name: "Mac Address" + icon: mdi:network-pos + entity_category: diagnostic + + # Creates a sensor showing when the device was last restarted + - platform: template + name: 'Last Restart' + id: device_last_restart + icon: mdi:clock + entity_category: diagnostic +# device_class: timestamp + +time: + - platform: sntp + id: sntp_time + # Define the timezone of the device + timezone: "${timezone}" + # Change sync interval from default 5min to 6 hours (or as set in substitutions) + update_interval: ${sntp_update_interval} + # Set specific sntp servers to use + servers: + - "${sntp_server_1}" + - "${sntp_server_2}" + - "${sntp_server_3}" + # Publish the time the device was last restarted + on_time_sync: + then: + # Update last restart time, but only once. + - if: + condition: + lambda: 'return id(device_last_restart).state == "";' + then: + - text_sensor.template.publish: + id: device_last_restart + state: !lambda 'return id(sntp_time).now().strftime("%a %d %b %Y - %I:%M:%S %p");' \ No newline at end of file diff --git a/athom-energy-monitor-x2.yaml b/athom-energy-monitor-x2.yaml index cf21a13..a520075 100644 --- a/athom-energy-monitor-x2.yaml +++ b/athom-energy-monitor-x2.yaml @@ -5,7 +5,7 @@ substitutions: room: "" device_description: "athom bl0906 energy meter (2 channels)" project_name: "Athom Technology.Athom Energy Meter(2 Channels)" - project_version: "3.0.1" + project_version: "3.0.2" update_interval: 5s # Define a domain for this device to use. i.e. iot.home.lan (so device will appear as athom-smart-plug-v2.iot.home.lan in DNS/DHCP logs) dns_domain: ".local" @@ -43,7 +43,7 @@ esphome: comment: "${device_description}" area: "${room}" name_add_mac_suffix: true - min_version: 2025.7.0 + min_version: 2026.6.0 project: name: "${project_name}" version: "${project_version}" @@ -55,15 +55,53 @@ esp32: framework: type: esp-idf version: recommended + sdkconfig_options: + # @grigi found in testing that these options resulted in better responsiveness. + # BLE 4.2 is supported by ALL ESP32 boards that have bluetooth, the original and derivatives. + CONFIG_BT_BLE_42_FEATURES_SUPPORTED: y + # Also enable this on any derivative boards (S2, C3 etc) but not the original ESP32. + CONFIG_BT_BLE_50_FEATURES_SUPPORTED: y + # Extend the watchdog timeout, so the device reboots if the device appears locked up for over 10 seconds. + CONFIG_ESP_TASK_WDT_TIMEOUT_S: "10" preferences: flash_write_interval: 5min api: # reboot_timeout: 0s + # Only enable BLE tracking when wifi is up and api is connected + # Gives single-core ESP32-C3 devices time to manage wifi and authenticate with api + on_client_connected: + - esp32_ble_tracker.start_scan: + continuous: true + # Disable BLE tracking when there are no api connections live + on_client_disconnected: + if: + condition: + not: + api.connected: + then: + - esp32_ble_tracker.stop_scan: ota: - platform: esphome + # Enables OTA firmware flashing from a URL (used by the update component below) + - platform: http_request + +# Required by the ota http_request platform and the update component. +# verify_ssl: false skips TLS cert validation to reduce heap/RAM pressure during +# the download; the manifest's MD5 still verifies firmware integrity before flashing. +http_request: + verify_ssl: false + +update: + # Managed updates via HTTP request: periodically checks the published manifest + # and exposes a "Firmware Update" entity, pointing at this device's GitHub Pages + # manifest. Pages URLs avoid the redirect/buffer issues of Release download URLs. + - platform: http_request + name: "Firmware Update" + source: https://athom-tech.github.io/esp32-configs/firmware/athom-energy-monitor-x2.manifest.json + # update_interval defaults to 6h (how often it checks, not installs) logger: baud_rate: 115200 @@ -91,6 +129,19 @@ improv_serial: esp32_improv: authorizer: none +esp32_ble_tracker: + scan_parameters: + # Don't auto start BLE scanning, we control it in the `api` block's automation. + continuous: false + active: true # send scan-request packets to gather more info, like device name for some devices. + interval: 320ms # default 320ms - how long to spend on each advert channel + window: 300ms # default 30ms - how long to actually "listen" in each interval. Reduce this if device is unstable. + # If the device cannot keep up or becomes unstable, reduce the "window" setting. This may be + # required if your device is controlling other sensors or doing PWM for lights etc. + +bluetooth_proxy: + active: true + dashboard_import: package_import_url: github://athom-tech/esp32-configs/athom-energy-monitor-x2.yaml diff --git a/athom-energy-monitor-x6.yaml b/athom-energy-monitor-x6.yaml index 6c91124..10b7be5 100644 --- a/athom-energy-monitor-x6.yaml +++ b/athom-energy-monitor-x6.yaml @@ -5,7 +5,7 @@ substitutions: room: "" device_description: "athom bl0906 energy meter (6 channels)" project_name: "Athom Technology.Athom Energy Meter(6 Channels)" - project_version: "3.0.1" + project_version: "3.0.2" update_interval: 5s # Define a domain for this device to use. i.e. iot.home.lan (so device will appear as athom-smart-plug-v2.iot.home.lan in DNS/DHCP logs) dns_domain: ".local" @@ -55,7 +55,7 @@ esphome: comment: "${device_description}" area: "${room}" name_add_mac_suffix: true - min_version: 2025.7.0 + min_version: 2026.6.0 project: name: "${project_name}" version: "${project_version}" @@ -67,6 +67,14 @@ esp32: framework: type: esp-idf version: recommended + sdkconfig_options: + # @grigi found in testing that these options resulted in better responsiveness. + # BLE 4.2 is supported by ALL ESP32 boards that have bluetooth, the original and derivatives. + CONFIG_BT_BLE_42_FEATURES_SUPPORTED: y + # Also enable this on any derivative boards (S2, C3 etc) but not the original ESP32. + CONFIG_BT_BLE_50_FEATURES_SUPPORTED: y + # Extend the watchdog timeout, so the device reboots if the device appears locked up for over 10 seconds. + CONFIG_ESP_TASK_WDT_TIMEOUT_S: "10" # esp32: # board: esp32dev @@ -81,9 +89,39 @@ preferences: api: # reboot_timeout: 0s + # Only enable BLE tracking when wifi is up and api is connected + # Gives single-core ESP32-C3 devices time to manage wifi and authenticate with api + on_client_connected: + - esp32_ble_tracker.start_scan: + continuous: true + # Disable BLE tracking when there are no api connections live + on_client_disconnected: + if: + condition: + not: + api.connected: + then: + - esp32_ble_tracker.stop_scan: ota: - platform: esphome + # Enables OTA firmware flashing from a URL (used by the update component below) + - platform: http_request + +# Required by the ota http_request platform and the update component. +# verify_ssl: false skips TLS cert validation to reduce heap/RAM pressure during +# the download; the manifest's MD5 still verifies firmware integrity before flashing. +http_request: + verify_ssl: false + +update: + # Managed updates via HTTP request: periodically checks the published manifest + # and exposes a "Firmware Update" entity, pointing at this device's GitHub Pages + # manifest. Pages URLs avoid the redirect/buffer issues of Release download URLs. + - platform: http_request + name: "Firmware Update" + source: https://athom-tech.github.io/esp32-configs/firmware/athom-energy-monitor-x6.manifest.json + # update_interval defaults to 6h (how often it checks, not installs) logger: baud_rate: 115200 diff --git a/athom-garage-door.yaml b/athom-garage-door.yaml index 4df535b..87a53ed 100644 --- a/athom-garage-door.yaml +++ b/athom-garage-door.yaml @@ -10,7 +10,7 @@ substitutions: # Project Name project_name: "China Athom Technology.Garage Door Opener" # Project version denotes the release version of the yaml file, allowing checking of deployed vs latest version - project_version: "v3.1.2" + project_version: "v3.1.3" # Status inverted status_inverted: "true" # Define a domain for this device to use. i.e. iot.home.lan (so device will appear as athom-smart-plug-v2.iot.home.lan in DNS/DHCP logs) @@ -80,6 +80,23 @@ api: ota: - platform: esphome + # Enables OTA firmware flashing from a URL (used by the update component below) + - platform: http_request + +# Required by the ota http_request platform and the update component. +# verify_ssl: false skips TLS cert validation to reduce heap/RAM pressure during +# the download; the manifest's MD5 still verifies firmware integrity before flashing. +http_request: + verify_ssl: false + +update: + # Managed updates via HTTP request: periodically checks the published manifest + # and exposes a "Firmware Update" entity, pointing at this device's GitHub Pages + # manifest. Pages URLs avoid the redirect/buffer issues of Release download URLs. + - platform: http_request + name: "Firmware Update" + source: https://athom-tech.github.io/esp32-configs/firmware/athom-garage-door.manifest.json + # update_interval defaults to 6h (how often it checks, not installs) logger: baud_rate: 0 # 0 Enables logging, but disables serial-port logging to free CPU and memory diff --git a/athom-ld2450-sensor.yaml b/athom-ld2450-sensor.yaml index 3dc044b..1273aa8 100644 --- a/athom-ld2450-sensor.yaml +++ b/athom-ld2450-sensor.yaml @@ -4,7 +4,7 @@ substitutions: room: "" device_description: "athom esp32c3 ld2450 motion target tracking sensor" project_name: "China Athom Technology.PS02C3MZ LD2450" - project_version: "v2.0.4" + project_version: "v2.0.5" update_interval: 60s # Define a domain for this device to use. i.e. iot.home.lan (so device will appear as athom-smart-plug-v2.iot.home.lan in DNS/DHCP logs) dns_domain: "" @@ -66,6 +66,23 @@ web_server: ota: - platform: esphome + # Enables OTA firmware flashing from a URL (used by the update component below) + - platform: http_request + +# Required by the ota http_request platform and the update component. +# verify_ssl: false skips TLS cert validation to reduce heap/RAM pressure during +# the download; the manifest's MD5 still verifies firmware integrity before flashing. +http_request: + verify_ssl: false + +update: + # Managed updates via HTTP request: periodically checks the published manifest + # and exposes a "Firmware Update" entity, pointing at this device's GitHub Pages + # manifest. Pages URLs avoid the redirect/buffer issues of Release download URLs. + - platform: http_request + name: "Firmware Update" + source: https://athom-tech.github.io/esp32-configs/firmware/athom-ld2450-sensor.manifest.json + # update_interval defaults to 6h (how often it checks, not installs) network: enable_ipv6: ${ipv6_enable} diff --git a/athom-mini-relay-v2.yaml b/athom-mini-relay-v2.yaml index 3f398f6..9aff57b 100644 --- a/athom-mini-relay-v2.yaml +++ b/athom-mini-relay-v2.yaml @@ -10,7 +10,7 @@ substitutions: # Project Name project_name: "China Athom Technology.Mini Relay V2" # Projection version denotes the release version of the yaml file, allowing checking of deployed vs latest version - project_version: "v3.1.0" + project_version: "v3.1.1" # Restore the relay (GPO switch) upon reboot to state: light_restore_mode: RESTORE_DEFAULT_OFF # Set the update interval for sensors @@ -88,6 +88,23 @@ api: ota: - platform: esphome + # Enables OTA firmware flashing from a URL (used by the update component below) + - platform: http_request + +# Required by the ota http_request platform and the update component. +# verify_ssl: false skips TLS cert validation to reduce heap/RAM pressure during +# the download; the manifest's MD5 still verifies firmware integrity before flashing. +http_request: + verify_ssl: false + +update: + # Managed updates via HTTP request: periodically checks the published manifest + # and exposes a "Firmware Update" entity, pointing at this device's GitHub Pages + # manifest. Pages URLs avoid the redirect/buffer issues of Release download URLs. + - platform: http_request + name: "Firmware Update" + source: https://athom-tech.github.io/esp32-configs/firmware/athom-mini-relay-v2.manifest.json + # update_interval defaults to 6h (how often it checks, not installs) logger: baud_rate: 0 # 0 Enables logging, but disables serial-port logging to free CPU and memory diff --git a/athom-presence-sensor-v3.yaml b/athom-presence-sensor-v3.yaml index 95ada0f..acad062 100644 --- a/athom-presence-sensor-v3.yaml +++ b/athom-presence-sensor-v3.yaml @@ -10,7 +10,7 @@ substitutions: # Project Name project_name: "Athom Technology.Athom PS01C3 Presence Sensor" # Projection version denotes the release version of the yaml file, allowing checking of deployed vs latest version - project_version: "v4.0.0" + project_version: "v4.0.1" # Define a domain for this device to use. i.e. iot.home.lan (so device will appear as athom-smart-plug-v2.iot.home.lan in DNS/DHCP logs) dns_domain: ".local" # Set timezone of the smart plug. Useful if the plug is in a location different to the HA server. Can be entered in unix Country/Area format (i.e. "Australia/Sydney") @@ -34,7 +34,7 @@ esphome: comment: "${device_description}" area: "${room}" name_add_mac_suffix: true - min_version: 2025.7.0 + min_version: 2026.6.0 project: name: "${project_name}" version: "${project_version}" @@ -48,6 +48,14 @@ esp32: framework: type: esp-idf version: recommended + sdkconfig_options: + # @grigi found in testing that these options resulted in better responsiveness. + # BLE 4.2 is supported by ALL ESP32 boards that have bluetooth, the original and derivatives. + CONFIG_BT_BLE_42_FEATURES_SUPPORTED: y + # Also enable this on any derivative boards (S2, C3 etc) but not the original ESP32. + CONFIG_BT_BLE_50_FEATURES_SUPPORTED: y + # Extend the watchdog timeout, so the device reboots if the device appears locked up for over 10 seconds. + CONFIG_ESP_TASK_WDT_TIMEOUT_S: "10" preferences: flash_write_interval: 1min @@ -58,9 +66,40 @@ logger: baud_rate: 115200 api: + # reboot_timeout: 0s + # Only enable BLE tracking when wifi is up and api is connected + # Gives single-core ESP32-C3 devices time to manage wifi and authenticate with api + on_client_connected: + - esp32_ble_tracker.start_scan: + continuous: true + # Disable BLE tracking when there are no api connections live + on_client_disconnected: + if: + condition: + not: + api.connected: + then: + - esp32_ble_tracker.stop_scan: ota: - platform: esphome + # Enables OTA firmware flashing from a URL (used by the update component below) + - platform: http_request + +# Required by the ota http_request platform and the update component. +# verify_ssl: false skips TLS cert validation to reduce heap/RAM pressure during +# the download; the manifest's MD5 still verifies firmware integrity before flashing. +http_request: + verify_ssl: false + +update: + # Managed updates via HTTP request: periodically checks the published manifest + # and exposes a "Firmware Update" entity, pointing at this device's GitHub Pages + # manifest. Pages URLs avoid the redirect/buffer issues of Release download URLs. + - platform: http_request + name: "Firmware Update" + source: https://athom-tech.github.io/esp32-configs/firmware/athom-presence-sensor-v3.manifest.json + # update_interval defaults to 6h (how often it checks, not installs) mdns: disabled: false @@ -84,18 +123,22 @@ captive_portal: esp32_improv: authorizer: none +esp32_ble_tracker: + scan_parameters: + # Don't auto start BLE scanning, we control it in the `api` block's automation. + continuous: false + active: true # send scan-request packets to gather more info, like device name for some devices. + interval: 320ms # default 320ms - how long to spend on each advert channel + window: 300ms # default 30ms - how long to actually "listen" in each interval. Reduce this if device is unstable. + # If the device cannot keep up or becomes unstable, reduce the "window" setting. This may be + # required if your device is controlling other sensors or doing PWM for lights etc. + +bluetooth_proxy: + active: true + dashboard_import: package_import_url: github://athom-tech/esp32-configs/athom-presence-sensor-v3.yaml -# esp32_ble_tracker: -# scan_parameters: -# interval: 1100ms -# window: 1100ms -# active: true - -# bluetooth_proxy: -# active: true - light: - platform: status_led name: "Status LED" diff --git a/athom-rf-ir-remote.yaml b/athom-rf-ir-remote.yaml index 3f0b46d..222afa8 100644 --- a/athom-rf-ir-remote.yaml +++ b/athom-rf-ir-remote.yaml @@ -10,7 +10,7 @@ substitutions: # Project Name project_name: "China Athom Technology.Athom RF IR Remote" # Projection version denotes the release version of the yaml file, allowing checking of deployed vs latest version - project_version: "v3.0.3" + project_version: "v3.0.4" # Define a domain for this device to use. i.e. iot.home.lan (so device will appear as athom-smart-plug-v2.iot.home.lan in DNS/DHCP logs) dns_domain: ".local" # Set timezone of the smart plug. Useful if the plug is in a location different to the HA server. Can be entered in unix Country/Area format (i.e. "Australia/Sydney") @@ -107,6 +107,23 @@ api: ota: - platform: esphome + # Enables OTA firmware flashing from a URL (used by the update component below) + - platform: http_request + +# Required by the ota http_request platform and the update component. +# verify_ssl: false skips TLS cert validation to reduce heap/RAM pressure during +# the download; the manifest's MD5 still verifies firmware integrity before flashing. +http_request: + verify_ssl: true + +update: + # Managed updates via HTTP request: periodically checks the published manifest + # and exposes a "Firmware Update" entity, pointing at this device's GitHub Pages + # manifest. Pages URLs avoid the redirect/buffer issues of Release download URLs. + - platform: http_request + name: "Firmware Update" + source: https://athom-tech.github.io/esp32-configs/firmware/athom-rf-ir-remote.manifest.json + # update_interval defaults to 6h (how often it checks, not installs) logger: baud_rate: 0 diff --git a/athom-rgbcw-bulb.yaml b/athom-rgbcw-bulb.yaml index 510dd0d..5f2461e 100644 --- a/athom-rgbcw-bulb.yaml +++ b/athom-rgbcw-bulb.yaml @@ -10,7 +10,7 @@ substitutions: # Project Name project_name: "China Athom Technology.Athom RGBCW Bulb" # Projection version denotes the release version of the yaml file, allowing checking of deployed vs latest version - project_version: "v3.2.2" + project_version: "v3.2.3" # Restore the light (GPO switch) upon reboot to state: light_restore_mode: RESTORE_DEFAULT_ON # Define a domain for this device to use. i.e. iot.home.lan (so device will appear as athom-smart-plug-v2.iot.home.lan in DNS/DHCP logs) @@ -97,7 +97,7 @@ esphome: comment: "${device_description}" area: "${room}" name_add_mac_suffix: true - min_version: 2026.5.0 + min_version: 2026.6.0 project: name: "${project_name}" version: "${project_version}" @@ -204,6 +204,23 @@ api: ota: - platform: esphome + # Enables OTA firmware flashing from a URL (used by the update component below) + - platform: http_request + +# Required by the ota http_request platform and the update component. +# verify_ssl: false skips TLS cert validation to reduce heap/RAM pressure during +# the download; the manifest's MD5 still verifies firmware integrity before flashing. +http_request: + verify_ssl: false + +update: + # Managed updates via HTTP request: periodically checks the published manifest + # and exposes a "Firmware Update" entity, pointing at this device's GitHub Pages + # manifest. Pages URLs avoid the redirect/buffer issues of Release download URLs. + - platform: http_request + name: "Firmware Update" + source: https://athom-tech.github.io/esp32-configs/firmware/athom-rgbcw-bulb.manifest.json + # update_interval defaults to 6h (how often it checks, not installs) logger: baud_rate: 0 # 0 Enables logging, but disables serial-port logging to free CPU and memory diff --git a/athom-rgbcw-light.yaml b/athom-rgbcw-light.yaml index ee5e2d3..069e140 100644 --- a/athom-rgbcw-light.yaml +++ b/athom-rgbcw-light.yaml @@ -10,7 +10,7 @@ substitutions: # Project Name project_name: "China Athom Technology.Athom 12W RGBCW Bulb" # Projection version denotes the release version of the yaml file, allowing checking of deployed vs latest version - project_version: "v3.1.4" + project_version: "v3.1.5" # Restore the light (GPO switch) upon reboot to state: light_restore_mode: RESTORE_DEFAULT_ON # Define a domain for this device to use. i.e. iot.home.lan (so device will appear as athom-smart-plug-v2.iot.home.lan in DNS/DHCP logs) @@ -97,7 +97,7 @@ esphome: comment: "${device_description}" area: "${room}" name_add_mac_suffix: true - min_version: 2026.5.0 + min_version: 2026.6.0 project: name: "${project_name}" version: "${project_version}" @@ -204,6 +204,23 @@ api: ota: - platform: esphome + # Enables OTA firmware flashing from a URL (used by the update component below) + - platform: http_request + +# Required by the ota http_request platform and the update component. +# verify_ssl: false skips TLS cert validation to reduce heap/RAM pressure during +# the download; the manifest's MD5 still verifies firmware integrity before flashing. +http_request: + verify_ssl: false + +update: + # Managed updates via HTTP request: periodically checks the published manifest + # and exposes a "Firmware Update" entity, pointing at this device's GitHub Pages + # manifest. Pages URLs avoid the redirect/buffer issues of Release download URLs. + - platform: http_request + name: "Firmware Update" + source: https://athom-tech.github.io/esp32-configs/firmware/athom-rgbcw-light.manifest.json + # update_interval defaults to 6h (how often it checks, not installs) logger: baud_rate: 0 # 0 Enables logging, but disables serial-port logging to free CPU and memory diff --git a/athom-scd40-sensor.yaml b/athom-scd40-sensor.yaml index 0f7275c..7db1062 100644 --- a/athom-scd40-sensor.yaml +++ b/athom-scd40-sensor.yaml @@ -5,7 +5,7 @@ substitutions: room: "" device_description: "athom scd40 CO₂ sensor" project_name: "China Athom Technology.CO₂ Sensor" - project_version: "1.0.8" + project_version: "1.0.9" update_interval: 5s # Define a domain for this device to use. i.e. iot.home.lan (so device will appear as athom-smart-plug-v2.iot.home.lan in DNS/DHCP logs) dns_domain: ".local" @@ -88,6 +88,23 @@ api: ota: - platform: esphome + # Enables OTA firmware flashing from a URL (used by the update component below) + - platform: http_request + +# Required by the ota http_request platform and the update component. +# verify_ssl: false skips TLS cert validation to reduce heap/RAM pressure during +# the download; the manifest's MD5 still verifies firmware integrity before flashing. +http_request: + verify_ssl: false + +update: + # Managed updates via HTTP request: periodically checks the published manifest + # and exposes a "Firmware Update" entity, pointing at this device's GitHub Pages + # manifest. Pages URLs avoid the redirect/buffer issues of Release download URLs. + - platform: http_request + name: "Firmware Update" + source: https://athom-tech.github.io/esp32-configs/firmware/athom-scd40-sensor.manifest.json + # update_interval defaults to 6h (how often it checks, not installs) logger: baud_rate: 0 # 0 Enables logging, but disables serial-port logging to free CPU and memory diff --git a/athom-sht40-sensor.yaml b/athom-sht40-sensor.yaml index e7dbb6f..38637cf 100644 --- a/athom-sht40-sensor.yaml +++ b/athom-sht40-sensor.yaml @@ -5,7 +5,7 @@ substitutions: room: "" device_description: "athom sht40 temperature and humidity sensor" project_name: "China Athom Technology.Temperature Humidity Sensor" - project_version: "1.0.7" + project_version: "1.0.8" update_interval: 5s # Define a domain for this device to use. i.e. iot.home.lan (so device will appear as athom-smart-plug-v2.iot.home.lan in DNS/DHCP logs) dns_domain: ".local" @@ -39,7 +39,7 @@ esphome: comment: "${device_description}" area: "${room}" name_add_mac_suffix: true - min_version: 2025.7.0 + min_version: 2026.6.0 project: name: "${project_name}" version: "${project_version}" @@ -93,6 +93,23 @@ api: ota: - platform: esphome + # Enables OTA firmware flashing from a URL (used by the update component below) + - platform: http_request + +# Required by the ota http_request platform and the update component. +# verify_ssl: false skips TLS cert validation to reduce heap/RAM pressure during +# the download; the manifest's MD5 still verifies firmware integrity before flashing. +http_request: + verify_ssl: false + +update: + # Managed updates via HTTP request: periodically checks the published manifest + # and exposes a "Firmware Update" entity, pointing at this device's GitHub Pages + # manifest. Pages URLs avoid the redirect/buffer issues of Release download URLs. + - platform: http_request + name: "Firmware Update" + source: https://athom-tech.github.io/esp32-configs/firmware/athom-sht40-sensor.manifest.json + # update_interval defaults to 6h (how often it checks, not installs) logger: baud_rate: 0 # 0 Enables logging, but disables serial-port logging to free CPU and memory diff --git a/athom-smart-plug-v5.yaml b/athom-smart-plug-v5.yaml index 981a3bc..023823a 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.1" + project_version: "v5.0.2" # Restore the relay (GPO switch) upon reboot to state: relay_restore_mode: RESTORE_DEFAULT_ON # Set the update interval for sensors @@ -44,7 +44,7 @@ esphome: comment: "${device_description}" area: "${room}" name_add_mac_suffix: true - min_version: 2026.5.1 + min_version: 2026.6.0 project: name: "${project_name}" version: "${project_version}" @@ -112,6 +112,23 @@ api: ota: - platform: esphome + # Enables OTA firmware flashing from a URL (used by the update component below) + - platform: http_request + +# Required by the ota http_request platform and the update component. +# verify_ssl: false skips TLS cert validation to reduce heap/RAM pressure during +# the download; the manifest's MD5 still verifies firmware integrity before flashing. +http_request: + verify_ssl: false + +update: + # Managed updates via HTTP request: periodically checks the published manifest + # and exposes a "Firmware Update" entity, pointing at this device's GitHub Pages + # manifest. Pages URLs avoid the redirect/buffer issues of Release download URLs. + - platform: http_request + name: "Firmware Update" + source: https://athom-tech.github.io/esp32-configs/firmware/athom-smart-plug-v5.manifest.json + # update_interval defaults to 6h (how often it checks, not installs) logger: baud_rate: 0 # 0 Enables logging, but disables serial-port logging to free CPU and memory diff --git a/athom-smart-plug.yaml b/athom-smart-plug.yaml index f88f85c..69f8205 100644 --- a/athom-smart-plug.yaml +++ b/athom-smart-plug.yaml @@ -10,7 +10,7 @@ substitutions: # Project Name project_name: "China Athom Technology.Athom Plug V3" # Projection version denotes the release version of the yaml file, allowing checking of deployed vs latest version - project_version: "v2.0.2" + project_version: "v2.0.3" # Restore the relay (GPO switch) upon reboot to state: relay_restore_mode: RESTORE_DEFAULT_ON # Set the update interval for sensors @@ -46,7 +46,7 @@ esphome: comment: "${device_description}" area: "${room}" name_add_mac_suffix: true - min_version: 2025.7.0 + min_version: 2026.6.0 project: name: "${project_name}" version: "${project_version}" @@ -115,6 +115,23 @@ api: ota: - platform: esphome + # Enables OTA firmware flashing from a URL (used by the update component below) + - platform: http_request + +# Required by the ota http_request platform and the update component. +# verify_ssl: false skips TLS cert validation to reduce heap/RAM pressure during +# the download; the manifest's MD5 still verifies firmware integrity before flashing. +http_request: + verify_ssl: false + +update: + # Managed updates via HTTP request: periodically checks the published manifest + # and exposes a "Firmware Update" entity, pointing at this device's GitHub Pages + # manifest. Pages URLs avoid the redirect/buffer issues of Release download URLs. + - platform: http_request + name: "Firmware Update" + source: https://athom-tech.github.io/esp32-configs/firmware/athom-smart-plug.manifest.json + # update_interval defaults to 6h (how often it checks, not installs) logger: baud_rate: 0 # 0 Enables logging, but disables serial-port logging to free CPU and memory diff --git a/athom-wall-outlet-v3.yaml b/athom-wall-outlet-v3.yaml index 5eb043e..cc1fd7e 100644 --- a/athom-wall-outlet-v3.yaml +++ b/athom-wall-outlet-v3.yaml @@ -10,7 +10,7 @@ substitutions: # Project Name project_name: "China Athom Technology.Athom Wall Outlet V3" # Projection version denotes the release version of the yaml file, allowing checking of deployed vs latest version - project_version: "v3.0.1" + project_version: "v3.0.2" # Restore the relay (GPO switch) upon reboot to state: relay_restore_mode: RESTORE_DEFAULT_OFF # Set the update interval for sensors @@ -46,7 +46,7 @@ esphome: comment: "${device_description}" area: "${room}" name_add_mac_suffix: true - min_version: 2025.7.0 + min_version: 2026.6.0 project: name: "${project_name}" version: "${project_version}" @@ -114,6 +114,23 @@ api: ota: - platform: esphome + # Enables OTA firmware flashing from a URL (used by the update component below) + - platform: http_request + +# Required by the ota http_request platform and the update component. +# verify_ssl: false skips TLS cert validation to reduce heap/RAM pressure during +# the download; the manifest's MD5 still verifies firmware integrity before flashing. +http_request: + verify_ssl: false + +update: + # Managed updates via HTTP request: periodically checks the published manifest + # and exposes a "Firmware Update" entity, pointing at this device's GitHub Pages + # manifest. Pages URLs avoid the redirect/buffer issues of Release download URLs. + - platform: http_request + name: "Firmware Update" + source: https://athom-tech.github.io/esp32-configs/firmware/athom-wall-outlet-v3.manifest.json + # update_interval defaults to 6h (how often it checks, not installs) logger: baud_rate: 0 # 0 Enables logging, but disables serial-port logging to free CPU and memory diff --git a/athom-zigbee-gateway.yaml b/athom-zigbee-gateway.yaml index e923418..27e71fe 100644 --- a/athom-zigbee-gateway.yaml +++ b/athom-zigbee-gateway.yaml @@ -10,7 +10,7 @@ substitutions: # Project Name project_name: "China Athom Technology.Athom Zigbee Gateway" # Projection version denotes the release version of the yaml file, allowing checking of deployed vs latest version - project_version: "v2.0.6" + project_version: "v2.0.7" # Define a domain for this device to use. i.e. iot.home.lan (so device will appear as athom-smart-plug-v2.iot.home.lan in DNS/DHCP logs) dns_domain: ".local" # Set timezone of the smart plug. Useful if the plug is in a location different to the HA server. Can be entered in unix Country/Area format (i.e. "Australia/Sydney") @@ -39,6 +39,26 @@ esp32: framework: type: esp-idf version: recommended + sdkconfig_options: + # @grigi found in testing that these options resulted in better responsiveness. + # BLE 4.2 is supported by ALL ESP32 boards that have bluetooth, the original and derivatives. + CONFIG_BT_BLE_42_FEATURES_SUPPORTED: y + # Extend the watchdog timeout, so the device reboots if the device appears locked up for over 10 seconds. + CONFIG_ESP_TASK_WDT_TIMEOUT_S: "10" + +# Enable Home Assistant API +api: + on_client_connected: + - esp32_ble_tracker.start_scan: + continuous: true + # Disable BLE tracking when there are no api connections live + on_client_disconnected: + if: + condition: + not: + api.connected: + then: + - esp32_ble_tracker.stop_scan: external_components: - source: github://oxan/esphome-stream-server @@ -86,7 +106,24 @@ api: reboot_timeout: 0s ota: - platform: esphome + - platform: esphome + # Enables OTA firmware flashing from a URL (used by the update component below) + - platform: http_request + +# Required by the ota http_request platform and the update component. +# verify_ssl: false skips TLS cert validation to reduce heap/RAM pressure during +# the download; the manifest's MD5 still verifies firmware integrity before flashing. +http_request: + verify_ssl: false + +update: + # Managed updates via HTTP request: periodically checks the published manifest + # and exposes a "Firmware Update" entity, pointing at this device's GitHub Pages + # manifest. Pages URLs avoid the redirect/buffer issues of Release download URLs. + - platform: http_request + name: "Firmware Update" + source: https://athom-tech.github.io/esp32-configs/firmware/athom-zigbee-gateway.manifest.json + # update_interval defaults to 6h (how often it checks, not installs) web_server: port: 80