From 9dcfe3e203a1a5957be722f2b8529af5ac0fecc0 Mon Sep 17 00:00:00 2001 From: Aiden <37043404+tarontop@users.noreply.github.com> Date: Tue, 7 Feb 2023 12:51:58 +0800 Subject: [PATCH 01/18] Update ci.yml --- .github/workflows/ci.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c0b3d027..80ec5c42 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,24 +15,25 @@ jobs: - rgbww-light - rgbct-light - rgbw-light - - cb02 - garage-door + - ws2812b - mini-switch - relay-board-x1 - relay-board-x2 - relay-board-x4 - relay-board-x8 - - rgb-light - - rgbct-light - - rgbww-light - smart-plug - smart-plug-v2 - wall-outlet - sw01 + - sw01-v2 - sw02 + - sw02-v2 - sw03 - sw04 - - ws2812b + - cb02 + - ls-4p-3wire + - ls-4p-4wire steps: - name: Checkout source uses: actions/checkout@v3.2.0 From e306eb6ff06b9e991d84795b82fc2ac211417b19 Mon Sep 17 00:00:00 2001 From: Aiden <891483489@qq.com> Date: Thu, 23 Mar 2023 17:21:54 +0800 Subject: [PATCH 02/18] Modify friendly_name --- athom-cb02.yaml | 34 +++++++++++++-------- athom-garage-door.yaml | 42 ++++++++++++++++---------- athom-mini-switch.yaml | 42 ++++++++++++++++---------- athom-relay-board-x1.yaml | 40 +++++++++++++++++-------- athom-relay-board-x2.yaml | 42 +++++++++++++++++--------- athom-relay-board-x4.yaml | 48 ++++++++++++++++++----------- athom-relay-board-x8.yaml | 63 +++++++++++++++++++++------------------ athom-rgb-light.yaml | 33 +++++++++++++------- athom-rgbct-light.yaml | 31 ++++++++++++------- athom-rgbw-light.yaml | 33 +++++++++++++------- athom-rgbww-light.yaml | 31 ++++++++++++------- athom-smart-plug-v2.yaml | 9 ++++-- athom-smart-plug.yaml | 45 ++++++++++++++++------------ athom-sw01-v2.yaml | 36 ++++++++++++---------- athom-sw01.yaml | 36 ++++++++++++---------- athom-sw02-v2.yaml | 46 +++++++++++++++------------- athom-sw02.yaml | 44 ++++++++++++++++----------- athom-sw03.yaml | 52 ++++++++++++++++++-------------- athom-sw04.yaml | 48 +++++++++++++++++------------ athom-wall-outlet.yaml | 42 +++++++++++++++----------- 20 files changed, 490 insertions(+), 307 deletions(-) diff --git a/athom-cb02.yaml b/athom-cb02.yaml index 1123e568..3594bc1b 100644 --- a/athom-cb02.yaml +++ b/athom-cb02.yaml @@ -1,12 +1,12 @@ substitutions: device_name: "athom-cb02-switch" - friendly_name: "Athom CB02 Switch" - project_name: "athom.cb02-switch" + project_name: "Athom Technology.Switch Module" project_version: "1.1" relay_restore_mode: RESTORE_DEFAULT_OFF esphome: name: "${device_name}" + friendly_name: "" name_add_mac_suffix: true project: name: "${project_name}" @@ -16,6 +16,9 @@ esp8266: board: esp8285 restore_from_flash: true +preferences: + flash_write_interval: 1min + api: ota: @@ -38,14 +41,14 @@ dashboard_import: binary_sensor: - platform: status - name: "${friendly_name} Status" + name: "Status" - platform: gpio pin: number: 3 mode: INPUT_PULLUP inverted: true - name: "${friendly_name} Power Button" + name: "Power Button" disabled_by_default: true on_multi_click: - timing: @@ -60,17 +63,20 @@ binary_sensor: sensor: - platform: uptime - name: "${friendly_name} Uptime" - disabled_by_default: true + name: "Uptime Sensor" button: - platform: factory_reset - name: Restart with Factory Default Settings + name: "Reset" id: Reset + - platform: safe_mode + name: "Safe Mode" + internal: false + switch: - platform: gpio - name: "${friendly_name}" + name: "Relay" pin: GPIO13 id: relay restore_mode: ${relay_restore_mode} @@ -82,7 +88,7 @@ switch: light: - platform: status_led - name: "${friendly_name} Status LED" + name: "Status LED" id: blue_led disabled_by_default: true pin: @@ -92,9 +98,13 @@ light: text_sensor: - platform: wifi_info ip_address: - name: "${friendly_name} IP Address" - disabled_by_default: true + name: "IP Address" + ssid: + name: "Connected SSID" + mac_address: + name: "Mac Address" time: - platform: sntp - id: my_time + id: sntp_time + diff --git a/athom-garage-door.yaml b/athom-garage-door.yaml index 381a43f5..335f4460 100644 --- a/athom-garage-door.yaml +++ b/athom-garage-door.yaml @@ -1,11 +1,11 @@ substitutions: - name: "athom-garage-door" - friendly_name: "Athom Garage Door" - project_name: "athom.garage-door" + device_name: "athom-garage-door" + pproject_name: "Athom Technology.Garage Door Opener" project_version: "1.2" esphome: - name: "${name}" + name: "${device_name}" + friendly_name: "" name_add_mac_suffix: true project: name: "${project_name}" @@ -20,6 +20,10 @@ ota: logger: + +mdns: + disabled: false + web_server: port: 80 @@ -33,15 +37,14 @@ dashboard_import: sensor: - platform: uptime - name: "${friendly_name} Uptime" - disabled_by_default: true + name: "Uptime Sensor" binary_sensor: - platform: status - name: "${friendly_name} Status" + name: "Status" - platform: gpio - name: "${friendly_name} Contact" + name: "Contact" disabled_by_default: true device_class: garage_door id: contact @@ -56,7 +59,7 @@ binary_sensor: number: GPIO14 mode: INPUT_PULLUP inverted: true - name: "${friendly_name} Button" + name: "Button" disabled_by_default: true on_multi_click: - timing: @@ -71,13 +74,17 @@ binary_sensor: button: - platform: factory_reset - name: Restart with Factory Default Settings + name: "Reset" id: Reset + - platform: safe_mode + name: "Safe Mode" + internal: false + switch: - platform: gpio pin: GPIO5 - name: "${friendly_name} Relay" + name: "Relay" id: relay disabled_by_default: true on_turn_on: @@ -88,7 +95,7 @@ switch: light: - platform: status_led - name: "${friendly_name} Status LED" + name: "Status LED" id: wifi_led disabled_by_default: true pin: GPIO12 @@ -96,7 +103,7 @@ light: cover: - platform: template device_class: garage - name: "${friendly_name}" + name: "Garage Door" lambda: "return id(contact).state ? COVER_OPEN : COVER_CLOSED;" open_action: then: @@ -118,9 +125,12 @@ cover: text_sensor: - platform: wifi_info ip_address: - name: "${friendly_name} IP Address" - disabled_by_default: true + name: "IP Address" + ssid: + name: "Connected SSID" + mac_address: + name: "Mac Address" time: - platform: sntp - id: my_time + id: sntp_time diff --git a/athom-mini-switch.yaml b/athom-mini-switch.yaml index eb7ea3fd..c0e43c42 100644 --- a/athom-mini-switch.yaml +++ b/athom-mini-switch.yaml @@ -1,12 +1,12 @@ substitutions: - name: "athom-mini-switch" - friendly_name: "Athom Mini Switch" - project_name: "athom.mini-switch" + device_name: "athom-mini-switch" + project_name: "Athom Technology.Mini Relay Switch Module" project_version: "1.1" light_restore_mode: RESTORE_DEFAULT_OFF esphome: - name: "${name}" + name: "${device_name}" + friendly_name: "" name_add_mac_suffix: true project: name: "${project_name}" @@ -16,12 +16,15 @@ esp8266: board: esp8285 restore_from_flash: true +preferences: + flash_write_interval: 1min + api: ota: logger: - baud_rate: 0 + mdns: disabled: false @@ -39,9 +42,13 @@ dashboard_import: button: - platform: factory_reset - name: Restart with Factory Default Settings + name: "Reset" id: Reset + - platform: safe_mode + name: "Safe Mode" + internal: false + output: - platform: gpio id: relay_output @@ -49,7 +56,7 @@ output: light: - platform: status_led - name: "${friendly_name} Blue LED" + name: "Blue LED" disabled_by_default: true pin: number: GPIO4 @@ -58,19 +65,18 @@ light: - platform: binary id: mini_relay output: relay_output - name: "${friendly_name} Light" + name: "Mini Switch" restore_mode: ${light_restore_mode} sensor: - platform: uptime - name: "${friendly_name} Uptime" - disabled_by_default: true + name: "Uptime Sensor" binary_sensor: # Wired switch - platform: gpio id: the_switch - name: "${friendly_name} Power Switch" + name: "Power Switch" disabled_by_default: true pin: number: GPIO14 @@ -97,7 +103,7 @@ binary_sensor: number: GPIO3 mode: INPUT_PULLUP inverted: true - name: "${friendly_name} Power Button" + name: "Power Button" disabled_by_default: true on_multi_click: - timing: @@ -111,13 +117,17 @@ binary_sensor: - button.press: Reset - platform: status - name: "${friendly_name} Status" + name: "Status" + text_sensor: - platform: wifi_info ip_address: - name: "${friendly_name} IP Address" - disabled_by_default: true + name: "IP Address" + ssid: + name: "Connected SSID" + mac_address: + name: "Mac Address" time: - platform: sntp - id: my_time + id: sntp_time diff --git a/athom-relay-board-x1.yaml b/athom-relay-board-x1.yaml index a3cd1501..801a69ff 100644 --- a/athom-relay-board-x1.yaml +++ b/athom-relay-board-x1.yaml @@ -1,12 +1,12 @@ substitutions: - name: "athom-relay-board-x1" - friendly_name: "Athom Relay Board x1" - project_name: "athom.relay-board-x1" + device_name: "athom-relay-board-x1" + project_name: "Athom Technology.Relay-Board-X1" project_version: "1.0" relay_restore_mode: RESTORE_DEFAULT_OFF esphome: - name: "${name}" + name: "${device_name}" + friendly_name: "" name_add_mac_suffix: true project: name: "${project_name}" @@ -16,6 +16,9 @@ esp8266: board: esp8285 restore_from_flash: true +preferences: + flash_write_interval: 1min + api: ota: @@ -35,28 +38,32 @@ dashboard_import: binary_sensor: - platform: status - name: "${friendly_name} Status" + name: "Status" sensor: - platform: uptime - name: "${friendly_name} Uptime" + name: "Uptime Sensor" button: - - platform: restart - id: restart_button - name: "${friendly_name} Restart" + - platform: factory_reset + name: "Reset" + id: Reset + + - platform: safe_mode + name: "Safe Mode" + internal: false switch: # Relay - platform: gpio - name: "${friendly_name}" + name: "Relay" pin: GPIO5 id: relay1 restore_mode: ${relay_restore_mode} light: - platform: status_led - name: "${friendly_name} Status LED" + name: "Status LED" disabled_by_default: true pin: inverted: true @@ -65,5 +72,12 @@ light: text_sensor: - platform: wifi_info ip_address: - name: "${friendly_name} IP Address" - disabled_by_default: true + name: "IP Address" + ssid: + name: "Connected SSID" + mac_address: + name: "Mac Address" + +time: + - platform: sntp + id: sntp_time diff --git a/athom-relay-board-x2.yaml b/athom-relay-board-x2.yaml index 8b64ec23..146ff6bb 100644 --- a/athom-relay-board-x2.yaml +++ b/athom-relay-board-x2.yaml @@ -1,13 +1,13 @@ substitutions: - name: "athom-relay-board-x2" - friendly_name: "Athom Relay Board x2" - project_name: "athom.relay-board-x2" + device_name: "athom-relay-board-x2" + project_name: "Athom Technology.Relay-Board-X2" project_version: "1.0" relay1_restore_mode: RESTORE_DEFAULT_OFF relay2_restore_mode: RESTORE_DEFAULT_OFF esphome: - name: "${name}" + name: "${device_name}" + friendly_name: "" name_add_mac_suffix: true project: name: "${project_name}" @@ -17,6 +17,9 @@ esp8266: board: esp8285 restore_from_flash: true +preferences: + flash_write_interval: 1min + api: ota: @@ -36,34 +39,38 @@ dashboard_import: binary_sensor: - platform: status - name: "${friendly_name} Status" + name: "Status" sensor: - platform: uptime - name: "${friendly_name} Uptime" + name: "Uptime Sensor" button: - - platform: restart - id: restart_button - name: "${friendly_name} Restart" + - platform: factory_reset + name: "Reset" + id: Reset + + - platform: safe_mode + name: "Safe Mode" + internal: false switch: # Relay - platform: gpio - name: "${friendly_name} - 1" + name: "Relay1" pin: GPIO5 id: relay1 restore_mode: ${relay1_restore_mode} - platform: gpio - name: "${friendly_name} - 2" + name: "Relay2" pin: GPIO4 id: relay2 restore_mode: ${relay2_restore_mode} light: - platform: status_led - name: "${friendly_name} Status LED" + name: "Status LED" disabled_by_default: true pin: inverted: true @@ -72,5 +79,12 @@ light: text_sensor: - platform: wifi_info ip_address: - name: "${friendly_name} IP Address" - disabled_by_default: true + name: "IP Address" + ssid: + name: "Connected SSID" + mac_address: + name: "Mac Address" + +time: + - platform: sntp + id: sntp_time diff --git a/athom-relay-board-x4.yaml b/athom-relay-board-x4.yaml index e0ad6799..8f757acf 100644 --- a/athom-relay-board-x4.yaml +++ b/athom-relay-board-x4.yaml @@ -1,7 +1,6 @@ substitutions: - name: "athom-relay-board-x4" - friendly_name: "Athom Relay Board x4" - project_name: "athom.relay-board-x4" + device_name: "athom-relay-board-x4" + project_name: "Athom Technology.Relay-Board-X4" project_version: "1.0" relay1_restore_mode: RESTORE_DEFAULT_OFF relay2_restore_mode: RESTORE_DEFAULT_OFF @@ -9,7 +8,8 @@ substitutions: relay4_restore_mode: RESTORE_DEFAULT_OFF esphome: - name: "${name}" + name: "${device_name}" + friendly_name: "" name_add_mac_suffix: true project: name: "${project_name}" @@ -19,6 +19,9 @@ esp8266: board: esp8285 restore_from_flash: true +preferences: + flash_write_interval: 1min + api: ota: @@ -38,46 +41,49 @@ dashboard_import: binary_sensor: - platform: status - name: "${friendly_name} Status" + name: "Status" sensor: - platform: uptime - name: "${friendly_name} Uptime" - disabled_by_default: true + name: "Uptime Sensor" button: - - platform: restart - id: restart_button - name: "${friendly_name} Restart" + - platform: factory_reset + name: "Reset" + id: Reset + + - platform: safe_mode + name: "Safe Mode" + internal: false switch: - platform: gpio - name: "${friendly_name} - 1" + name: "Relay1" pin: GPIO16 id: relay1 restore_mode: ${relay1_restore_mode} - platform: gpio - name: "${friendly_name} - 2" + name: "Relay2" pin: GPIO14 id: relay2 restore_mode: ${relay2_restore_mode} - platform: gpio - name: "${friendly_name} - 3" + name: "Relay3" pin: GPIO12 id: relay3 restore_mode: ${relay3_restore_mode} - platform: gpio - name: "${friendly_name} - 4" + name: "Relay4" pin: GPIO13 id: relay4 restore_mode: ${relay4_restore_mode} light: - platform: status_led - name: "${friendly_name} Status LED" + name: "Status LED" disabled_by_default: true pin: inverted: true @@ -86,5 +92,13 @@ light: text_sensor: - platform: wifi_info ip_address: - name: "${friendly_name} IP Address" - disabled_by_default: true + name: "IP Address" + ssid: + name: "Connected SSID" + mac_address: + name: "Mac Address" + +time: + - platform: sntp + id: sntp_time + diff --git a/athom-relay-board-x8.yaml b/athom-relay-board-x8.yaml index bd3f3d1e..d732faea 100644 --- a/athom-relay-board-x8.yaml +++ b/athom-relay-board-x8.yaml @@ -1,7 +1,6 @@ substitutions: - name: "athom-relay-board-x8" - friendly_name: "Athom Relay Board x8" - project_name: "athom.relay-board-x8" + device_name: "athom-relay-board-x8" + project_name: "Athom Technology.Relay-Board-X8" project_version: "1.0" relay1_restore_mode: RESTORE_DEFAULT_OFF relay2_restore_mode: RESTORE_DEFAULT_OFF @@ -13,7 +12,8 @@ substitutions: relay8_restore_mode: RESTORE_DEFAULT_OFF esphome: - name: "${name}" + name: "${device_name}" + friendly_name: "" name_add_mac_suffix: true project: name: "${project_name}" @@ -23,6 +23,9 @@ esp8266: board: esp8285 restore_from_flash: true +preferences: + flash_write_interval: 1min + api: ota: @@ -42,78 +45,73 @@ dashboard_import: binary_sensor: - platform: status - name: "${friendly_name} Status" - - - platform: gpio - name: "${friendly_name} IO2" - disabled_by_default: true - pin: - number: GPIO2 - mode: INPUT_PULLUP - inverted: true + name: "Status" sensor: - platform: uptime - name: "${friendly_name} Uptime" - disabled_by_default: true + name: "Uptime Sensor" button: - - platform: restart - id: restart_button - name: "${friendly_name} Restart" + - platform: factory_reset + name: "Reset" + id: Reset + + - platform: safe_mode + name: "Safe Mode" + internal: false switch: - platform: gpio - name: "${friendly_name} - 1" + name: "Relay1" pin: GPIO16 id: relay1 restore_mode: ${relay1_restore_mode} - platform: gpio - name: "${friendly_name} - 2" + name: "Relay2" pin: GPIO14 id: relay2 restore_mode: ${relay2_restore_mode} - platform: gpio - name: "${friendly_name} - 3" + name: "Relay3" pin: GPIO12 id: relay3 restore_mode: ${relay3_restore_mode} - platform: gpio - name: "${friendly_name} - 4" + name: "Relay4" pin: GPIO13 id: relay4 restore_mode: ${relay4_restore_mode} - platform: gpio - name: "${friendly_name} - 5" + name: "Relay5" pin: GPIO15 id: relay5 restore_mode: ${relay5_restore_mode} - platform: gpio - name: "${friendly_name} - 6" + name: "Relay6" pin: GPIO0 id: relay6 restore_mode: ${relay6_restore_mode} - platform: gpio - name: "${friendly_name} - 7" + name: "Relay7" pin: GPIO4 id: relay7 restore_mode: ${relay7_restore_mode} - platform: gpio - name: "${friendly_name} - 8" + name: "Relay8" pin: GPIO5 id: relay8 restore_mode: ${relay8_restore_mode} light: - platform: status_led - name: "${friendly_name} Status LED" + name: "Status LED" disabled_by_default: true pin: inverted: true @@ -122,5 +120,12 @@ light: text_sensor: - platform: wifi_info ip_address: - name: "${friendly_name} IP Address" - disabled_by_default: true + name: "IP Address" + ssid: + name: "Connected SSID" + mac_address: + name: "Mac Address" + +time: + - platform: sntp + id: sntp_time diff --git a/athom-rgb-light.yaml b/athom-rgb-light.yaml index 929f5979..291d7ad7 100644 --- a/athom-rgb-light.yaml +++ b/athom-rgb-light.yaml @@ -1,12 +1,12 @@ substitutions: - name: "athom-rgb-light" - friendly_name: "Athom RGB Light Strip" - project_name: "athom.rgb-light" + device_name: "athom-rgb-light" + project_name: "Athom Technology.RGB Light Strip Controller" project_version: "1.1" light_restore_mode: RESTORE_DEFAULT_OFF esphome: - name: "${name}" + name: "${device_name}" + friendly_name: "" name_add_mac_suffix: true project: name: "${project_name}" @@ -42,14 +42,14 @@ dashboard_import: binary_sensor: - platform: status - name: "${friendly_name} Status" + name: "Status" - platform: gpio pin: number: 0 mode: INPUT_PULLUP inverted: true - name: "${friendly_name} Power Button" + name: "Power Button" disabled_by_default: true on_multi_click: - timing: @@ -64,13 +64,17 @@ binary_sensor: sensor: - platform: uptime - name: "${friendly_name} Uptime" + name: "Uptime" button: - platform: factory_reset - name: Restart with Factory Default Settings + name: "Reset" id: Reset + - platform: safe_mode + name: "Safe Mode" + internal: false + output: - platform: esp8266_pwm @@ -85,7 +89,7 @@ output: light: - platform: rgb - name: "${friendly_name}" + name: "RGB Light Strip" restore_mode: ${light_restore_mode} red: red_output green: green_output @@ -95,5 +99,12 @@ light: text_sensor: - platform: wifi_info ip_address: - name: "${friendly_name} IP Address" - disabled_by_default: true + name: "IP Address" + ssid: + name: "Connected SSID" + mac_address: + name: "Mac Address" + +time: + - platform: sntp + id: sntp_time diff --git a/athom-rgbct-light.yaml b/athom-rgbct-light.yaml index bb875c17..dfbab57c 100644 --- a/athom-rgbct-light.yaml +++ b/athom-rgbct-light.yaml @@ -1,7 +1,6 @@ substitutions: - name: "athom-rgbct-light" - friendly_name: "Athom RGBCT Light" - project_name: "athom.rgbct-light" + device_name: "athom-rgbct-light" + project_name: "Athom Technology.RGBCCT Bulb" project_version: "1.1" light_restore_mode: RESTORE_DEFAULT_ON color_interlock: 'true' @@ -13,7 +12,8 @@ globals: initial_value: '0' esphome: - name: "${name}" + name: "${device_name}" + friendly_name: "" name_add_mac_suffix: true project: name: "${project_name}" @@ -51,17 +51,21 @@ dashboard_import: binary_sensor: - platform: status - name: "${friendly_name} Status" + name: "Status" sensor: - platform: uptime - name: "${friendly_name} Uptime" + name: "Uptime Sensor" button: - platform: factory_reset - name: Restart with Factory Default Settings + name: "Reset" id: Reset + - platform: safe_mode + name: "Safe Mode" + internal: false + output: - platform: esp8266_pwm id: red_output @@ -95,7 +99,7 @@ output: light: - platform: rgbct id: rgbct_light - name: "${friendly_name}" + name: "RGBCT_Bulb" restore_mode: ${light_restore_mode} red: red_output green: green_output @@ -109,8 +113,15 @@ light: text_sensor: - platform: wifi_info ip_address: - name: "${friendly_name} IP Address" - disabled_by_default: true + name: "IP Address" + ssid: + name: "Connected SSID" + mac_address: + name: "Mac Address" + +time: + - platform: sntp + id: sntp_time script: - id: fast_boot_script diff --git a/athom-rgbw-light.yaml b/athom-rgbw-light.yaml index a3d5ac5d..c99a1202 100644 --- a/athom-rgbw-light.yaml +++ b/athom-rgbw-light.yaml @@ -1,12 +1,12 @@ substitutions: - name: "athom-rgbw-light" - friendly_name: "Athom RGBW Light" - project_name: "athom.rgbw-light" + device_name: "athom-rgbw-light" + project_name: "Athom Technology.RGBW Light Strip Controller" project_version: "1.1" light_restore_mode: RESTORE_DEFAULT_OFF esphome: - name: "${name}" + name: "${device_name}" + friendly_name: "" name_add_mac_suffix: true project: name: "${project_name}" @@ -38,14 +38,14 @@ dashboard_import: binary_sensor: - platform: status - name: "${friendly_name} Status" + name: "Status" - platform: gpio pin: number: 0 mode: INPUT_PULLUP inverted: true - name: "${friendly_name} Power Button" + name: "Power Button" disabled_by_default: true on_multi_click: - timing: @@ -60,12 +60,16 @@ binary_sensor: sensor: - platform: uptime - name: "${friendly_name} Uptime" + name: "Uptime Sensor" button: - platform: factory_reset - name: Restart with Factory Default Settings + name: "Reset" id: Reset + + - platform: safe_mode + name: "Safe Mode" + internal: false output: - platform: esp8266_pwm @@ -86,7 +90,7 @@ output: light: - platform: rgbw - name: "${friendly_name}" + name: "RGBW_Controller" id: leds red: output_red green: output_green @@ -98,5 +102,12 @@ light: text_sensor: - platform: wifi_info ip_address: - name: "${friendly_name} IP Address" - disabled_by_default: true + name: "IP Address" + ssid: + name: "Connected SSID" + mac_address: + name: "Mac Address" + +time: + - platform: sntp + id: sntp_time diff --git a/athom-rgbww-light.yaml b/athom-rgbww-light.yaml index 743b3a68..fd01f8de 100644 --- a/athom-rgbww-light.yaml +++ b/athom-rgbww-light.yaml @@ -1,7 +1,6 @@ substitutions: - name: "athom-rgbww-light" - friendly_name: "Athom RGBWW Light" - project_name: "athom.rgbww-light" + device_name: "athom-rgbww-light" + project_name: "Athom Technology.RGBCW Bulb" project_version: "1.1" light_restore_mode: RESTORE_DEFAULT_ON color_interlock: 'true' @@ -13,7 +12,8 @@ globals: initial_value: '0' esphome: - name: "${name}" + name: "${device_name}" + friendly_name: "" name_add_mac_suffix: true project: name: "${project_name}" @@ -51,17 +51,21 @@ dashboard_import: binary_sensor: - platform: status - name: "${friendly_name} Status" + name: "Status" sensor: - platform: uptime - name: "${friendly_name} Uptime" + name: "Uptime Sensor" button: - platform: factory_reset - name: Restart with Factory Default Settings + name: "Reset" id: Reset + - platform: safe_mode + name: "Safe Mode" + internal: false + output: - platform: esp8266_pwm id: red_output @@ -93,7 +97,7 @@ output: light: - platform: rgbww id: rgbww_light - name: "${friendly_name}" + name: "RGBCW_Bulb" restore_mode: ${light_restore_mode} red: red_output green: green_output @@ -107,8 +111,15 @@ light: text_sensor: - platform: wifi_info ip_address: - name: "${friendly_name} IP Address" - disabled_by_default: true + name: "IP Address" + ssid: + name: "Connected SSID" + mac_address: + name: "Mac Address" + +time: + - platform: sntp + id: sntp_time script: - id: fast_boot_script diff --git a/athom-smart-plug-v2.yaml b/athom-smart-plug-v2.yaml index 2a2f6185..aba0c4ef 100644 --- a/athom-smart-plug-v2.yaml +++ b/athom-smart-plug-v2.yaml @@ -1,7 +1,6 @@ substitutions: device_name: "athom-smart-plug-v2" - alias_name: "Athom Plug" - project_name: "athom.smart-plug-v2" + project_name: "Athom Technology.Smart Plug V2" project_version: "1.1" relay_restore_mode: RESTORE_DEFAULT_OFF @@ -135,9 +134,13 @@ button: name: "Reset" id: Reset + - platform: safe_mode + name: "Safe Mode" + internal: false + switch: - platform: gpio - name: "${alias_name}" + name: "Plug V2" pin: GPIO12 id: relay restore_mode: ${relay_restore_mode} diff --git a/athom-smart-plug.yaml b/athom-smart-plug.yaml index 0ca45aeb..1525352b 100644 --- a/athom-smart-plug.yaml +++ b/athom-smart-plug.yaml @@ -1,12 +1,12 @@ substitutions: - name: "athom-smart-plug" - friendly_name: "Athom Smart Plug" - project_name: "athom.smart-plug" + device_name: "athom-smart-plug" + project_name: "Athom Technology.Smart Plug" project_version: "1.1" relay_restore_mode: RESTORE_DEFAULT_OFF esphome: - name: "${name}" + name: "${device_name}" + friendly_name: "" name_add_mac_suffix: true project: name: "${project_name}" @@ -38,14 +38,14 @@ dashboard_import: binary_sensor: - platform: status - name: "${friendly_name} Status" + name: "Status" - platform: gpio pin: number: 3 mode: INPUT_PULLUP inverted: true - name: "${friendly_name} Power Button" + name: "Power Button" disabled_by_default: true on_multi_click: - timing: @@ -60,8 +60,7 @@ binary_sensor: sensor: - platform: uptime - name: "${friendly_name} Uptime" - disabled_by_default: true + name: "Uptime Sensor" - platform: hlw8012 sel_pin: @@ -71,7 +70,7 @@ sensor: cf1_pin: GPIO5 voltage_divider: 780 current: - name: "${friendly_name} Current" + name: "Current" filters: - calibrate_linear: - 0.0000 -> 0.0110 # Relay off no load @@ -85,10 +84,10 @@ sensor: # Normalize for plug load - lambda: if (x < 0.0260) return 0; else return (x - 0.0260); voltage: - name: "${friendly_name} Voltage" + name: "Voltage" power: - name: "${friendly_name} Power" + name: "Power" id: socket_my_power unit_of_measurement: W filters: @@ -107,7 +106,7 @@ sensor: update_interval: 5s - platform: total_daily_energy - name: "${friendly_name} Total Energy" + name: "Total Energy" power_id: socket_my_power unit_of_measurement: kWh accuracy_decimals: 3 @@ -118,12 +117,16 @@ sensor: button: - platform: factory_reset - name: Restart with Factory Default Settings + name: "Reset" id: Reset + - platform: safe_mode + name: "Safe Mode" + internal: false + switch: - platform: gpio - name: "${friendly_name}" + name: "Plug" pin: GPIO14 id: relay restore_mode: ${relay_restore_mode} @@ -135,7 +138,7 @@ switch: light: - platform: status_led - name: "${friendly_name} Status LED" + name: "Status LED" id: blue_led disabled_by_default: true pin: @@ -145,9 +148,13 @@ light: text_sensor: - platform: wifi_info ip_address: - name: "${friendly_name} IP Address" - disabled_by_default: true - + name: "IP Address" + ssid: + name: "Connected SSID" + mac_address: + name: "Mac Address" + time: - platform: sntp - id: my_time + id: sntp_time + diff --git a/athom-sw01-v2.yaml b/athom-sw01-v2.yaml index 09f15c2e..aa4d579c 100644 --- a/athom-sw01-v2.yaml +++ b/athom-sw01-v2.yaml @@ -1,12 +1,12 @@ substitutions: - name: "athom-sw01-v2" - friendly_name: "Athom SW01 V2" - project_name: "athom.sw01-v2" + device_name: "athom-1gang-switch-v2" + project_name: "Athom Technology.1 Gang Switch V2" project_version: "1.1" light_restore_mode: RESTORE_DEFAULT_OFF esphome: - name: "${name}" + name: "${device_name}" + friendly_name: "" name_add_mac_suffix: true project: name: "${project_name}" @@ -42,7 +42,7 @@ dashboard_import: binary_sensor: - platform: status - name: "${friendly_name} Status" + name: "Status" # Touch Button - platform: gpio @@ -52,7 +52,7 @@ binary_sensor: mode: input: true pullup: true - name: "${friendly_name} Button" + name: "Button" disabled_by_default: true on_multi_click: - timing: @@ -67,14 +67,17 @@ binary_sensor: sensor: - platform: uptime - name: "${friendly_name} Uptime" - disabled_by_default: true + name: "Uptime Sensor" button: - platform: factory_reset - name: Restart with Factory Default Settings + name: "Reset" id: Reset + - platform: safe_mode + name: "Safe Mode" + internal: false + output: # Relay - platform: gpio @@ -89,7 +92,7 @@ output: light: - platform: status_led - name: "${friendly_name} Status LED" + name: "Status LED" disabled_by_default: true pin: number: GPIO0 @@ -97,7 +100,7 @@ light: # Relay - platform: binary - name: "${friendly_name} Light" + name: "Light" id: light1 output: relay1 restore_mode: ${light_restore_mode} @@ -108,7 +111,7 @@ light: # Button LED - platform: monochromatic - name: "${friendly_name} LED" + name: "LED" disabled_by_default: true id: led1 output: button_led1 @@ -117,9 +120,12 @@ light: text_sensor: - platform: wifi_info ip_address: - name: "${friendly_name} IP Address" - disabled_by_default: true + name: "IP Address" + ssid: + name: "Connected SSID" + mac_address: + name: "Mac Address" time: - platform: sntp - id: my_time + id: sntp_time diff --git a/athom-sw01.yaml b/athom-sw01.yaml index eb72b72d..0573b1ec 100644 --- a/athom-sw01.yaml +++ b/athom-sw01.yaml @@ -1,12 +1,12 @@ substitutions: - name: "athom-sw01" - friendly_name: "Athom SW01" - project_name: "athom.sw01" + device_name: "athom-1gang-switch" + project_name: "Athom Technology.1 Gang Switch" project_version: "1.1" light_restore_mode: RESTORE_DEFAULT_OFF esphome: - name: "${name}" + name: "${device_name}" + friendly_name: "" name_add_mac_suffix: true project: name: "${project_name}" @@ -42,7 +42,7 @@ dashboard_import: binary_sensor: - platform: status - name: "${friendly_name} Status" + name: "Status" # Touch Button - platform: gpio @@ -52,7 +52,7 @@ binary_sensor: mode: input: true pullup: true - name: "${friendly_name} Button" + name: "Button" disabled_by_default: true on_multi_click: - timing: @@ -67,14 +67,17 @@ binary_sensor: sensor: - platform: uptime - name: "${friendly_name} Uptime" - disabled_by_default: true + name: "Uptime Sensor" button: - platform: factory_reset - name: Restart with Factory Default Settings + name: "Reset" id: Reset + - platform: safe_mode + name: "Safe Mode" + internal: false + output: # Relay - platform: gpio @@ -89,7 +92,7 @@ output: light: - platform: status_led - name: "${friendly_name} Status LED" + name: "Status LED" disabled_by_default: true pin: number: GPIO0 @@ -97,7 +100,7 @@ light: # Relay - platform: binary - name: "${friendly_name} Light" + name: "Light" id: light1 output: relay1 restore_mode: ${light_restore_mode} @@ -108,7 +111,7 @@ light: # Button LED - platform: monochromatic - name: "${friendly_name} LED" + name: "LED" disabled_by_default: true id: led1 output: button_led1 @@ -117,9 +120,12 @@ light: text_sensor: - platform: wifi_info ip_address: - name: "${friendly_name} IP Address" - disabled_by_default: true + name: "IP Address" + ssid: + name: "Connected SSID" + mac_address: + name: "Mac Address" time: - platform: sntp - id: my_time + id: sntp_time diff --git a/athom-sw02-v2.yaml b/athom-sw02-v2.yaml index a194081c..7a6cb1d6 100644 --- a/athom-sw02-v2.yaml +++ b/athom-sw02-v2.yaml @@ -1,13 +1,13 @@ substitutions: - name: "athom-sw02-v2" - friendly_name: "Athom SW02 V2" - project_name: "athom.sw02-v2" + device_name: "athom-2gang-switch-v2" + project_name: "Athom Technology.2 Gang Switch V2" project_version: "1.1" light1_restore_mode: RESTORE_DEFAULT_OFF light2_restore_mode: RESTORE_DEFAULT_OFF esphome: - name: "${name}" + name: "${device_name}" + friendly_name: "" name_add_mac_suffix: true project: name: "${project_name}" @@ -43,7 +43,7 @@ dashboard_import: binary_sensor: - platform: status - name: "${friendly_name} Status" + name: "Status" # Touch Buttons - platform: gpio @@ -53,7 +53,7 @@ binary_sensor: mode: input: true pullup: true - name: "${friendly_name} Button 1" + name: "Button1" disabled_by_default: true on_multi_click: - timing: @@ -73,7 +73,7 @@ binary_sensor: mode: input: true pullup: true - name: "${friendly_name} Button 2" + name: "Button2" disabled_by_default: true on_click: max_length: 0.5s @@ -82,13 +82,17 @@ binary_sensor: sensor: - platform: uptime - name: "${friendly_name} Uptime Sensor" + name: "Uptime Sensor" button: - platform: factory_reset - name: Restart with Factory Default Settings + name: "Reset" id: Reset + - platform: safe_mode + name: "Safe Mode" + internal: false + output: # Relays - platform: gpio @@ -114,7 +118,7 @@ output: light: - platform: status_led - name: "${friendly_name} Wifi LED" + name: "Status LED" disabled_by_default: true pin: number: GPIO0 @@ -122,22 +126,20 @@ light: # Relays - platform: binary - name: "${friendly_name} Light 1" + name: "Light1" id: light1 output: relay1 restore_mode: ${light1_restore_mode} - on_turn_on: - light.turn_on: light3 on_turn_off: - light.turn_off: light3 + - platform: binary - name: "${friendly_name} Light 2" + name: "Light2" id: light2 output: relay2 restore_mode: ${light2_restore_mode} - - on_turn_on: - light.turn_on: light4 on_turn_off: @@ -145,13 +147,14 @@ light: # Button LEDs - platform: monochromatic - name: "${friendly_name} LED1" + name: "LED1" disabled_by_default: true id: light3 output: led1 default_transition_length: 500ms + - platform: monochromatic - name: "${friendly_name} LED2" + name: "LED2" disabled_by_default: true id: light4 output: led2 @@ -160,9 +163,12 @@ light: text_sensor: - platform: wifi_info ip_address: - name: "${friendly_name} IP Address" - disabled_by_default: true + name: "IP Address" + ssid: + name: "Connected SSID" + mac_address: + name: "Mac Address" time: - platform: sntp - id: my_time + id: sntp_time diff --git a/athom-sw02.yaml b/athom-sw02.yaml index 64fb7784..432fc595 100644 --- a/athom-sw02.yaml +++ b/athom-sw02.yaml @@ -1,13 +1,13 @@ substitutions: - name: "athom-sw02" - friendly_name: "Athom SW02" - project_name: "athom.sw02" + device_name: "athom-2gang-switch" + project_name: "Athom Technology.2 Gang Switch" project_version: "1.1" light1_restore_mode: RESTORE_DEFAULT_OFF light2_restore_mode: RESTORE_DEFAULT_OFF esphome: - name: "${name}" + name: "${device_name}" + friendly_name: "" name_add_mac_suffix: true project: name: "${project_name}" @@ -43,7 +43,7 @@ dashboard_import: binary_sensor: - platform: status - name: "${friendly_name} Status" + name: "Status" # Touch Buttons - platform: gpio @@ -53,7 +53,7 @@ binary_sensor: mode: input: true pullup: true - name: "${friendly_name} Button 1" + name: "Button1" disabled_by_default: true on_multi_click: - timing: @@ -65,6 +65,7 @@ binary_sensor: - ON for at least 4s then: - button.press: Reset + - platform: gpio pin: inverted: true @@ -72,7 +73,7 @@ binary_sensor: mode: input: true pullup: true - name: "${friendly_name} Button 2" + name: "Button2" disabled_by_default: true on_click: max_length: 0.5s @@ -81,14 +82,17 @@ binary_sensor: sensor: - platform: uptime - name: "${friendly_name} Uptime" - disabled_by_default: true + name: "Uptime Sensor" button: - platform: factory_reset - name: Restart with Factory Default Settings + name: "Reset" id: Reset + - platform: safe_mode + name: "Safe Mode" + internal: false + output: # Relays - platform: gpio @@ -110,7 +114,7 @@ output: light: - platform: status_led - name: "${friendly_name} Status LED" + name: "Status LED" disabled_by_default: true pin: number: GPIO0 @@ -118,7 +122,7 @@ light: # Relays - platform: binary - name: "${friendly_name} Light 1" + name: "Light1" id: light1 output: relay1 restore_mode: ${light1_restore_mode} @@ -126,8 +130,9 @@ light: - light.turn_on: light3 on_turn_off: - light.turn_off: light3 + - platform: binary - name: "${friendly_name} Light 2" + name: "Light2" id: light2 output: relay2 restore_mode: ${light2_restore_mode} @@ -138,13 +143,13 @@ light: # Button LEDs - platform: monochromatic - name: "${friendly_name} LED1" + name: "LED1" disabled_by_default: true id: light3 output: led1 default_transition_length: 500ms - platform: monochromatic - name: "${friendly_name} LED2" + name: "LED2" disabled_by_default: true id: light4 output: led2 @@ -153,9 +158,12 @@ light: text_sensor: - platform: wifi_info ip_address: - name: "${friendly_name} IP Address" - disabled_by_default: true + name: "IP Address" + ssid: + name: "Connected SSID" + mac_address: + name: "Mac Address" time: - platform: sntp - id: my_time + id: sntp_time diff --git a/athom-sw03.yaml b/athom-sw03.yaml index 3e871ca3..e18144ec 100644 --- a/athom-sw03.yaml +++ b/athom-sw03.yaml @@ -1,14 +1,14 @@ substitutions: - name: "athom-sw03" - friendly_name: "Athom SW03" - project_name: "athom.sw03" + device_name: "athom-3gang-switch" + project_name: "Athom Technology.3 Gang Switch" project_version: "1.1" light1_restore_mode: RESTORE_DEFAULT_OFF light2_restore_mode: RESTORE_DEFAULT_OFF light3_restore_mode: RESTORE_DEFAULT_OFF esphome: - name: "${name}" + name: "${device_name}" + friendly_name: "" name_add_mac_suffix: true project: name: "${project_name}" @@ -44,7 +44,7 @@ dashboard_import: binary_sensor: - platform: status - name: "${friendly_name} Status" + name: "Status" # Touch Buttons - platform: gpio @@ -54,7 +54,7 @@ binary_sensor: mode: input: true pullup: true - name: "${friendly_name} Button 1" + name: "Button1" disabled_by_default: true on_multi_click: - timing: @@ -74,12 +74,13 @@ binary_sensor: mode: input: true pullup: true - name: "${friendly_name} Button 2" + name: "Button2" disabled_by_default: true on_click: max_length: 0.5s then: - light.toggle: light2 + - platform: gpio pin: inverted: true @@ -87,7 +88,7 @@ binary_sensor: mode: input: true pullup: true - name: "${friendly_name} Button 3" + name: "Button3" disabled_by_default: true on_click: max_length: 0.5s @@ -96,14 +97,17 @@ binary_sensor: sensor: - platform: uptime - name: "${friendly_name} Uptime" - disabled_by_default: true + name: "Uptime Sensor" button: - platform: factory_reset - name: Restart with Factory Default Settings + name: "Reset" id: Reset + - platform: safe_mode + name: "Safe Mode" + internal: false + output: # Relays - platform: gpio @@ -132,7 +136,7 @@ output: light: - platform: status_led - name: "${friendly_name} Status LED" + name: "Status LED" disabled_by_default: true pin: number: GPIO0 @@ -140,7 +144,7 @@ light: # Relays - platform: binary - name: "${friendly_name} Light 1" + name: "Light1" id: light1 output: relay1 restore_mode: ${light1_restore_mode} @@ -148,8 +152,9 @@ light: - light.turn_on: led1 on_turn_off: - light.turn_off: led1 + - platform: binary - name: "${friendly_name} Light 2" + name: "Light2" id: light2 output: relay2 restore_mode: ${light2_restore_mode} @@ -157,8 +162,9 @@ light: - light.turn_on: led2 on_turn_off: - light.turn_off: led2 + - platform: binary - name: "${friendly_name} Light 3" + name: "Light3" id: light3 output: relay3 restore_mode: ${light3_restore_mode} @@ -169,31 +175,33 @@ light: # Button LEDs - platform: monochromatic - name: "${friendly_name} LED1" + name: "LED1" disabled_by_default: true id: led1 output: button_led1 default_transition_length: 500ms - platform: monochromatic - name: "${friendly_name} LED2" + name: "LED2" disabled_by_default: true id: led2 output: button_led2 default_transition_length: 500ms - platform: monochromatic - name: "${friendly_name} LED3" + name: "LED3" disabled_by_default: true id: led3 output: button_led3 default_transition_length: 500ms - text_sensor: - platform: wifi_info ip_address: - name: "${friendly_name} IP Address" - disabled_by_default: true + name: "IP Address" + ssid: + name: "Connected SSID" + mac_address: + name: "Mac Address" time: - platform: sntp - id: my_time + id: sntp_time diff --git a/athom-sw04.yaml b/athom-sw04.yaml index eca57bd5..8f2422b3 100644 --- a/athom-sw04.yaml +++ b/athom-sw04.yaml @@ -1,7 +1,6 @@ substitutions: - name: "athom-sw04" - friendly_name: "Athom SW04" - project_name: "athom.sw04" + device_name: "athom-4gang-switch" + project_name: "Athom Technology.4 Gang Switch" project_version: "1.1" light1_restore_mode: RESTORE_DEFAULT_OFF light2_restore_mode: RESTORE_DEFAULT_OFF @@ -9,7 +8,8 @@ substitutions: light4_restore_mode: RESTORE_DEFAULT_OFF esphome: - name: "${name}" + name: "${device_name}" + friendly_name: "" name_add_mac_suffix: true project: name: "${project_name}" @@ -45,14 +45,14 @@ dashboard_import: binary_sensor: - platform: status - name: "${friendly_name} Status" + name: "Status" # Touch Buttons - platform: gpio pin: inverted: true number: GPIO12 - name: "${friendly_name} Button 1" + name: "Button1" disabled_by_default: true on_multi_click: - timing: @@ -69,27 +69,29 @@ binary_sensor: pin: inverted: true number: GPIO3 - name: "${friendly_name} Button 2" + name: "Button2" disabled_by_default: true on_click: max_length: 0.5s then: - light.toggle: light2 + - platform: gpio pin: inverted: true number: GPIO5 - name: "${friendly_name} Button 3" + name: "Button3" disabled_by_default: true on_click: max_length: 0.5s then: - light.toggle: light3 + - platform: gpio pin: inverted: true number: GPIO16 - name: "${friendly_name} Button 4" + name: "Button4" disabled_by_default: true on_click: max_length: 0.5s @@ -98,11 +100,16 @@ binary_sensor: sensor: - platform: uptime - name: "${friendly_name} Uptime" + name: "Uptime Sensor" button: - platform: factory_reset - name: Restart with Factory Default Settings + name: "Reset" + id: Reset + + - platform: safe_mode + name: "Safe Mode" + internal: false id: Reset output: @@ -122,7 +129,7 @@ output: light: - platform: status_led - name: "${friendly_name} Status LED" + name: "Status LED" disabled_by_default: true pin: number: GPIO0 @@ -130,22 +137,22 @@ light: # Relays - platform: binary - name: "${friendly_name} Light 1" + name: "Light1" id: light1 output: relay1 restore_mode: ${light1_restore_mode} - platform: binary - name: "${friendly_name} Light 2" + name: "Light2" id: light2 output: relay2 restore_mode: ${light2_restore_mode} - platform: binary - name: "${friendly_name} Light 3" + name: "Light3" id: light3 output: relay3 restore_mode: ${light3_restore_mode} - platform: binary - name: "${friendly_name} Light 4" + name: "Light4" id: light4 output: relay4 restore_mode: ${light4_restore_mode} @@ -153,9 +160,12 @@ light: text_sensor: - platform: wifi_info ip_address: - name: "${friendly_name} IP Address" - disabled_by_default: true + name: "IP Address" + ssid: + name: "Connected SSID" + mac_address: + name: "Mac Address" time: - platform: sntp - id: my_time + id: sntp_time diff --git a/athom-wall-outlet.yaml b/athom-wall-outlet.yaml index 906e9bd7..117bd47a 100644 --- a/athom-wall-outlet.yaml +++ b/athom-wall-outlet.yaml @@ -1,12 +1,13 @@ substitutions: device_name: "athom-wall-outlet" - friendly_name: "Athom Wall Outlet" - project_name: "athom.wall-outlet" + # friendly_name: "Athom Wall Outlet" + project_name: "Athom Technology.Wall Outlet" project_version: "1.1" relay_restore_mode: RESTORE_DEFAULT_OFF esphome: name: "${device_name}" + friendly_name: "" name_add_mac_suffix: true project: name: "${project_name}" @@ -52,14 +53,14 @@ globals: binary_sensor: - platform: status - name: "${friendly_name} Status" + name: "Status" - platform: gpio pin: number: 5 mode: INPUT_PULLUP inverted: true - name: "${friendly_name} Power Button" + name: "Power Button" disabled_by_default: true on_multi_click: - timing: @@ -74,26 +75,26 @@ binary_sensor: sensor: - platform: uptime - name: "${friendly_name} Uptime Sensor" + name: "Uptime Sensor" - platform: cse7766 update_interval: 10s current: - name: "${friendly_name} Current" + name: "Current" # filters: # - lambda: if (x < 0.060) return 0.0; else return x; #For the chip will report less than 3w power when no load is connected voltage: - name: "${friendly_name} Voltage" + name: "Voltage" power: - name: "${friendly_name} Power" + name: "Power" id: power_sensor # filters: # - lambda: if (x < 3.0) return 0.0; else return x; #For the chip will report less than 3w power when no load is connected energy: - name: "${friendly_name} Energy" + name: "Energy" id: energy unit_of_measurement: kWh filters: @@ -108,7 +109,7 @@ sensor: previous_energy_value = current_energy_value; - platform: template - name: "${friendly_name} Total Energy" + name: "Total Energy" unit_of_measurement: kWh device_class: "energy" state_class: "total_increasing" @@ -119,7 +120,7 @@ sensor: update_interval: 10s - platform: total_daily_energy - name: "${friendly_name} Total Daily Energy" + name: "Total Daily Energy" restore: true power_id: power_sensor unit_of_measurement: kWh @@ -130,12 +131,16 @@ sensor: button: - platform: factory_reset - name: Restart with Factory Default Settings + name: "Reset" id: Reset + - platform: safe_mode + name: "Safe Mode" + internal: false + switch: - platform: gpio - name: "${friendly_name}" + name: "Wall Outlet" pin: GPIO12 id: relay restore_mode: ${relay_restore_mode} @@ -147,7 +152,7 @@ switch: light: - platform: status_led - name: "${friendly_name} Status LED" + name: "Status LED" id: red_led disabled_by_default: true pin: @@ -157,9 +162,12 @@ light: text_sensor: - platform: wifi_info ip_address: - name: "${friendly_name} IP Address" - disabled_by_default: true + name: "IP Address" + ssid: + name: "Connected SSID" + mac_address: + name: "Mac Address" time: - platform: sntp - id: my_time + id: sntp_time \ No newline at end of file From efc20343e5b27b6c47c6bd11d624910ad6b99d4c Mon Sep 17 00:00:00 2001 From: Aiden <37043404+tarontop@users.noreply.github.com> Date: Fri, 24 Mar 2023 17:50:00 +0800 Subject: [PATCH 03/18] Update athom-garage-door.yaml Fix spelling errors --- athom-garage-door.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/athom-garage-door.yaml b/athom-garage-door.yaml index 335f4460..b2b89ff7 100644 --- a/athom-garage-door.yaml +++ b/athom-garage-door.yaml @@ -1,6 +1,6 @@ substitutions: device_name: "athom-garage-door" - pproject_name: "Athom Technology.Garage Door Opener" + project_name: "Athom Technology.Garage Door Opener" project_version: "1.2" esphome: From f3c6f535fee3a4be007b8d51a22a057e9c0e0298 Mon Sep 17 00:00:00 2001 From: Aiden <37043404+tarontop@users.noreply.github.com> Date: Fri, 24 Mar 2023 17:51:37 +0800 Subject: [PATCH 04/18] Update athom-sw04.yaml Delete redundant ID --- athom-sw04.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/athom-sw04.yaml b/athom-sw04.yaml index 8f2422b3..3b8fea44 100644 --- a/athom-sw04.yaml +++ b/athom-sw04.yaml @@ -110,7 +110,6 @@ button: - platform: safe_mode name: "Safe Mode" internal: false - id: Reset output: # Relays From 72585692396e0564fd0835c92e18f143746fa770 Mon Sep 17 00:00:00 2001 From: Aiden <37043404+tarontop@users.noreply.github.com> Date: Fri, 24 Mar 2023 18:02:44 +0800 Subject: [PATCH 05/18] Create athom-ls-4p-4wire.yaml --- athom-ls-4p-4wire.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/athom-ls-4p-4wire.yaml b/athom-ls-4p-4wire.yaml index 471efc8c..6ae7d6c7 100644 --- a/athom-ls-4p-4wire.yaml +++ b/athom-ls-4p-4wire.yaml @@ -19,8 +19,6 @@ esphome: esp8266: board: esp8285 restore_from_flash: true - framework: - version: 2.7.4 api: From 2d5e9dabdb9897270b4e81eb1ff640a713693ea2 Mon Sep 17 00:00:00 2001 From: Aiden <37043404+tarontop@users.noreply.github.com> Date: Fri, 24 Mar 2023 18:09:13 +0800 Subject: [PATCH 06/18] Update athom-ls-4p-4wire.yaml --- athom-ls-4p-4wire.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/athom-ls-4p-4wire.yaml b/athom-ls-4p-4wire.yaml index 6ae7d6c7..990e74ae 100644 --- a/athom-ls-4p-4wire.yaml +++ b/athom-ls-4p-4wire.yaml @@ -19,7 +19,9 @@ esphome: esp8266: board: esp8285 restore_from_flash: true - + framework: + version: 2.7.4 + api: ota: From b64c0deb4a0a9e8d2ce44d9ce1c9da30da43f819 Mon Sep 17 00:00:00 2001 From: Aiden <891483489@qq.com> Date: Fri, 24 Mar 2023 18:30:05 +0800 Subject: [PATCH 07/18] Modify friendly_name --- athom-ls-4p-3wire.yaml | 31 +++++++++++++++++++------------ athom-ls-4p-4wire.yaml | 32 ++++++++++++++++++++------------ athom-ws2812b.yaml | 34 +++++++++++++++++++++++----------- 3 files changed, 62 insertions(+), 35 deletions(-) diff --git a/athom-ls-4p-3wire.yaml b/athom-ls-4p-3wire.yaml index dcaf1a64..c26dd4b4 100644 --- a/athom-ls-4p-3wire.yaml +++ b/athom-ls-4p-3wire.yaml @@ -1,7 +1,6 @@ substitutions: - name: "athom-ls-4p-3wire" - friendly_name: "Athom LED Controller" - project_name: "athom.ls-4p-3wire" + device_name: "athom-ls-4p-3wire" + project_name: "Athom Technology.LS 4P 3Wire" project_version: "1.1" button_toggle: "true" led_restore_mode: RESTORE_DEFAULT_OFF @@ -10,7 +9,8 @@ substitutions: led_chipset: WS2811 esphome: - name: "${name}" + name: "${device_name}" + friendly_name: "" name_add_mac_suffix: true project: name: "${project_name}" @@ -45,14 +45,14 @@ dashboard_import: binary_sensor: - platform: status - name: "${friendly_name} Status" + name: "Status" - platform: gpio pin: number: 0 mode: INPUT_PULLUP inverted: true - name: "${friendly_name} Power Button" + name: "Power Button" disabled_by_default: true on_multi_click: - timing: @@ -67,13 +67,17 @@ binary_sensor: sensor: - platform: uptime - name: "${friendly_name} Uptime" + name: "Uptime Sensor" button: - platform: factory_reset - name: Restart with Factory Default Settings + name: "Reset" id: Reset + - platform: safe_mode + name: "Safe Mode" + internal: false + power_supply: - id: relay pin: GPIO12 @@ -82,7 +86,7 @@ light: - platform: fastled_clockless pin: GPIO1 id: leds - name: "${friendly_name}" + name: "Light strip controller" power_supply: relay chipset: ${led_chipset} num_leds: ${number_of_leds} @@ -95,9 +99,12 @@ light: text_sensor: - platform: wifi_info ip_address: - name: "${friendly_name} IP Address" - disabled_by_default: true + name: "IP Address" + ssid: + name: "Connected SSID" + mac_address: + name: "Mac Address" time: - platform: sntp - id: my_time + id: sntp_time diff --git a/athom-ls-4p-4wire.yaml b/athom-ls-4p-4wire.yaml index 471efc8c..ae868508 100644 --- a/athom-ls-4p-4wire.yaml +++ b/athom-ls-4p-4wire.yaml @@ -1,7 +1,6 @@ substitutions: - name: "athom-ls-4p-4wire" - friendly_name: "Athom LED Controller" - project_name: "athom.ls-4p-4wire" + device_name: "athom-ls-4p-4wire" + project_name: "Athom Technology.LS 4P 4Wire" project_version: "1.1" button_toggle: "true" light_restore_mode: RESTORE_DEFAULT_OFF @@ -10,7 +9,8 @@ substitutions: led_rgb_order: GRB esphome: - name: "${name}" + name: "${device_name}" + friendly_name: "" name_add_mac_suffix: true project: name: "${project_name}" @@ -45,14 +45,14 @@ dashboard_import: binary_sensor: - platform: status - name: "${friendly_name} Status" + name: "Status" - platform: gpio pin: number: 0 mode: INPUT_PULLUP inverted: true - name: "${friendly_name} Power Button" + name: "Power Button" disabled_by_default: true on_multi_click: - timing: @@ -64,15 +64,20 @@ binary_sensor: - ON for at least 4s then: - button.press: Reset + sensor: - platform: uptime - name: "${friendly_name} Uptime" + name: "Uptime Sensor" button: - platform: factory_reset - name: Restart with Factory Default Settings + name: "Reset" id: Reset + - platform: safe_mode + name: "Safe Mode" + internal: false + power_supply: - id: relay pin: GPIO12 @@ -82,7 +87,7 @@ light: data_pin: GPIO1 clock_pin: GPIO3 id: leds - name: "${friendly_name}" + name: "Light strip controller" power_supply: relay chipset: ${led_chipset} num_leds: ${number_of_leds} @@ -95,9 +100,12 @@ light: text_sensor: - platform: wifi_info ip_address: - name: "${friendly_name} IP Address" - disabled_by_default: true + name: "IP Address" + ssid: + name: "Connected SSID" + mac_address: + name: "Mac Address" time: - platform: sntp - id: my_time + id: sntp_time diff --git a/athom-ws2812b.yaml b/athom-ws2812b.yaml index ecb2e01e..4359e501 100644 --- a/athom-ws2812b.yaml +++ b/athom-ws2812b.yaml @@ -1,7 +1,6 @@ substitutions: - name: "athom-ws2812b" - friendly_name: "Athom WS2812B" - project_name: "athom.ws2812b" + device_name: "athom-ws2812b" + project_name: "Athom Technology.WS2812B Controller" project_version: "1.1" button_toggle: "true" led_restore_mode: RESTORE_DEFAULT_OFF @@ -10,7 +9,8 @@ substitutions: led_chipset: WS2811 esphome: - name: "${name}" + name: "${device_name}" + friendly_name: "" name_add_mac_suffix: true project: name: "${project_name}" @@ -49,14 +49,14 @@ dashboard_import: binary_sensor: - platform: status - name: "${friendly_name} Status" + name: "Status" - platform: gpio pin: number: 0 mode: INPUT_PULLUP inverted: true - name: "${friendly_name} Power Button" + name: "Power Button" disabled_by_default: true on_multi_click: - timing: @@ -71,18 +71,22 @@ binary_sensor: sensor: - platform: uptime - name: "${friendly_name} Uptime" + name: "Uptime Sensor" button: - platform: factory_reset - name: Restart with Factory Default Settings + name: "Reset" id: Reset + - platform: safe_mode + name: "Safe Mode" + internal: false + light: - platform: fastled_clockless pin: GPIO1 id: leds - name: "${friendly_name}" + name: "WS2812B Controller" chipset: ${led_chipset} num_leds: ${number_of_leds} rgb_order: ${led_rgb_order} @@ -94,5 +98,13 @@ light: text_sensor: - platform: wifi_info ip_address: - name: "${friendly_name} IP Address" - disabled_by_default: true + name: "IP Address" + ssid: + name: "Connected SSID" + mac_address: + name: "Mac Address" + +time: + - platform: sntp + id: sntp_time + From ea7716ad6351a40bbc4ee9f954bb21fcb5ba4880 Mon Sep 17 00:00:00 2001 From: Aiden <37043404+tarontop@users.noreply.github.com> Date: Fri, 26 May 2023 20:46:27 +0800 Subject: [PATCH 08/18] add human presence sensor add human presence sensor --- athom-presence-sensor.yaml | 350 +++++++++++++++++++++++++++++++++++++ 1 file changed, 350 insertions(+) create mode 100644 athom-presence-sensor.yaml diff --git a/athom-presence-sensor.yaml b/athom-presence-sensor.yaml new file mode 100644 index 00000000..16bc2016 --- /dev/null +++ b/athom-presence-sensor.yaml @@ -0,0 +1,350 @@ +substitutions: + name: "athom-presence-sensor" + friendly_name: "presence sensor" + room: "" + device_description: "mmwave radar human presence sensor" + project_name: "Athom Technology.Presence Sensor" + project_version: "1.0" + +esphome: + name: "${name}" + friendly_name: "${friendly_name}" + name_add_mac_suffix: true + project: + name: "${project_name}" + version: "${project_version}" + +esp8266: + board: esp8285 + +# Enable logging +logger: + +api: + +ota: + +mdns: + disabled: false + +web_server: + port: 80 + +wifi: + ap: {} + +captive_portal: + +dashboard_import: + package_import_url: github://athom-tech/athom-configs/athom-presence-sensor.yaml + import_full_config: true + + +light: + - platform: status_led + name: "Status LED" + id: led + pin: GPIO16 + disabled_by_default: true + entity_category: config + +i2c: + sda: GPIO4 + scl: GPIO5 + scan: true + +uart: + tx_pin: GPIO15 + rx_pin: GPIO13 + baud_rate: 115200 + # debug: + # direction: BOTH + # dummy_receiver: true + # after: + # delimiter: "\n" + # sequence: + # - lambda: UARTDebug::log_string(direction, bytes); + + +binary_sensor: + - platform: status + name: "Status" + + - platform: gpio + pin: + number: GPIO0 + mode: INPUT_PULLUP + inverted: true + name: "Button" + disabled_by_default: true + on_multi_click: + - timing: + - ON for at least 4s + then: + - button.press: factory_reset_mmwave + - delay: 3s + - button.press: Reset + + - platform: gpio + pin: + number: GPIO12 + mode: + input: true + pullup: true + name: "Pir Sensor" + id: pir + filters: + - delayed_on: 50ms + - delayed_off: 10s + device_class: motion + on_press: + then: + - light.turn_on: led + + - platform: gpio + pin: + number: GPIO14 + mode: + input: true + pullup: true + name: "mmWave Sensor" + id: mmwave + filters: + - delayed_on: 50ms + device_class: motion + on_release: + then: + - light.turn_off: led + + + - platform: template + name: "Occupancy" + id: occupancy + device_class: occupancy + lambda: |- + if ( id(mmwave).state and id(pir).state) { + return true; + } + else if (id(mmwave).state == 0) { + return false; + } + else { + return id(occupancy).state; + } + +sensor: + - platform: uptime + name: "${friendly_name} Uptime Sensor" + + - platform: wifi_signal + name: "${friendly_name} WiFi Signal Sensor" + update_interval: 60s + + - platform: bh1750 + name: "Light Sensor" + address: 0x23 + update_interval: 10s + +switch: + - platform: template + name: "mmWave Status" + id: "mmwave_sensor" + disabled_by_default: true + entity_category: config + optimistic: true + restore_state: true + turn_on_action: + - uart.write: "sensorStart\r\n" + turn_off_action: + - uart.write: "sensorStop\r\n" + + + +number: + - platform: template + name: mmWave detection distance #Value range: 1.9 ~ 12m Default: 6 + id: Detection_Distance + entity_category: config + min_value: 1.9 + max_value: 12 + initial_value: 6 + optimistic: true + step: 0.1 + restore_value: true + unit_of_measurement: m + mode: slider + set_action: + - switch.turn_off: mmwave_sensor + - delay: 500ms + - uart.write: !lambda + std::string ranges = "setRange 1.8 " + to_string(id(Detection_Distance).state) + "\r\n"; + return std::vector(ranges.begin(), ranges.end()); + - delay: 500ms + - uart.write: "saveConfig\r\n" + - delay: 500ms + - switch.turn_on: mmwave_sensor + + + - platform: template + name: mmWave maintain sensitivity #Value range: 0 ~ 9 Default Maintain sensitivity: 7 Default Trigger sensitivity: 5 + id: Maintain_Sensitivity + entity_category: config + min_value: 0 + max_value: 9 + initial_value: 7 + optimistic: true + step: 1 + restore_value: true + mode: slider + set_action: + - switch.turn_off: mmwave_sensor + - delay: 500ms + - uart.write: !lambda + std::string ranges = "setSensitivity " + to_string(id(Maintain_Sensitivity).state) + " " + to_string(id(Trigger_Sensitivity).state) + "\r\n"; + return std::vector(ranges.begin(), ranges.end()); + - delay: 500ms + - uart.write: "saveConfig\r\n" + - delay: 500ms + - switch.turn_on: mmwave_sensor + + + - platform: template + name: mmWave tigger sensitivity #Value range: 0 ~ 9 Default Maintain sensitivity: 7 Default Trigger sensitivity: 5 + id: Trigger_Sensitivity + entity_category: config + min_value: 0 + max_value: 9 + initial_value: 5 + optimistic: true + step: 1 + restore_value: true + mode: slider + set_action: + - switch.turn_off: mmwave_sensor + - delay: 500ms + - uart.write: !lambda + std::string ranges = "setSensitivity " + to_string(id(Maintain_Sensitivity).state) + " " + to_string(id(Trigger_Sensitivity).state) + "\r\n"; + return std::vector(ranges.begin(), ranges.end()); + - delay: 500ms + - uart.write: "saveConfig\r\n" + - delay: 500ms + - switch.turn_on: mmwave_sensor + + + - platform: template + name: mmWave confirmation delay #Confirmation delay Value range: 0 ~ 100 default 0.050 seconds. + id: confirmation_delay + entity_category: config + min_value: 0.1 + max_value: 60 + initial_value: 0.1 + optimistic: true + step: 0.1 + restore_value: true + unit_of_measurement: seconds + mode: slider + set_action: + - switch.turn_off: mmwave_sensor + - delay: 500ms + - uart.write: !lambda |- + std::string mss = "setLatency " + to_string(id(confirmation_delay).state) + " " + to_string(id(disappear_delay).state) + "\r\n"; + return std::vector(mss.begin(), mss.end()); + - delay: 500ms + - uart.write: "saveConfig\r\n" + - delay: 500ms + - switch.turn_on: mmwave_sensor + + - platform: template + name: mmWave disappear delay #Fade-out delay Value range: 0.5 ~ 1500, default 15 seconds. + id: disappear_delay + entity_category: config + min_value: 1 + max_value: 300 + initial_value: 15 + optimistic: true + step: 1 + restore_value: true + unit_of_measurement: seconds + mode: auto + set_action: + - switch.turn_off: mmwave_sensor + - delay: 500ms + - uart.write: !lambda |- + std::string mss = "setLatency " + to_string(id(confirmation_delay).state) + " " + to_string(id(disappear_delay).state) + "\r\n"; + return std::vector(mss.begin(), mss.end()); + - delay: 500ms + - uart.write: "saveConfig\r\n" + - delay: 500ms + - switch.turn_on: mmwave_sensor + + + - platform: template + name: mmWave inhibit + id: SetInhibit + entity_category: config + min_value: 1 + max_value: 255 + initial_value: 1 + optimistic: true + step: 1 + restore_value: true + unit_of_measurement: seconds + mode: slider + set_action: + - switch.turn_off: mmwave_sensor + - delay: 500ms + - uart.write: !lambda + std::string ranges = "setInhibit " + to_string(id(SetInhibit).state) + "\r\n"; + return std::vector(ranges.begin(), ranges.end()); + - delay: 500ms + - uart.write: "saveConfig\r\n" + - delay: 500ms + - switch.turn_on: mmwave_sensor + +button: + - platform: factory_reset + name: Restart with Factory Default Settings + id: Reset + entity_category: config + internal: true + - platform: template + name: "Factory Reset mmWave" + id: "factory_reset_mmwave" + entity_category: config + on_press: + - switch.turn_off: mmwave_sensor + - delay: 500ms + - uart.write: "resetCfg\r\n" + - delay: 1s + - switch.turn_on: mmwave_sensor + - button.press: Reset + + - platform: restart + name: Restart_esp + id: restart_esp + entity_category: config + internal: true + - platform: template + name: "Restart_mmWave" + id: "restart_mmwave" + entity_category: config + internal: true + on_press: + - uart.write: "resetSystem\r\n" + + - platform: template + name: Restart device + entity_category: config + on_press: + - button.press: restart_mmwave + - button.press: restart_esp + +text_sensor: + - platform: wifi_info + ip_address: + name: "IP Address" + disabled_by_default: true + +time: + - platform: sntp + id: my_time \ No newline at end of file From c5886218b2d9dc52a25cc28be82ec980bcaee11a Mon Sep 17 00:00:00 2001 From: Aiden <37043404+tarontop@users.noreply.github.com> Date: Fri, 26 May 2023 21:12:16 +0800 Subject: [PATCH 09/18] Update athom-presence-sensor.yaml --- athom-presence-sensor.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/athom-presence-sensor.yaml b/athom-presence-sensor.yaml index 16bc2016..f1fd8812 100644 --- a/athom-presence-sensor.yaml +++ b/athom-presence-sensor.yaml @@ -37,7 +37,6 @@ captive_portal: dashboard_import: package_import_url: github://athom-tech/athom-configs/athom-presence-sensor.yaml - import_full_config: true light: @@ -347,4 +346,4 @@ text_sensor: time: - platform: sntp - id: my_time \ No newline at end of file + id: my_time From 8751553b247f4dda69517eda975b068e838a43bd Mon Sep 17 00:00:00 2001 From: Aiden <37043404+tarontop@users.noreply.github.com> Date: Sat, 27 May 2023 11:37:00 +0800 Subject: [PATCH 10/18] Update athom-presence-sensor.yaml --- athom-presence-sensor.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/athom-presence-sensor.yaml b/athom-presence-sensor.yaml index f1fd8812..5b91f628 100644 --- a/athom-presence-sensor.yaml +++ b/athom-presence-sensor.yaml @@ -1,6 +1,6 @@ substitutions: name: "athom-presence-sensor" - friendly_name: "presence sensor" + friendly_name: "presence_sensor" room: "" device_description: "mmwave radar human presence sensor" project_name: "Athom Technology.Presence Sensor" @@ -142,7 +142,7 @@ sensor: - platform: bh1750 name: "Light Sensor" address: 0x23 - update_interval: 10s + update_interval: 5s switch: - platform: template From 8487aace8166aaa2d281e923e4e41d6eb0c11c28 Mon Sep 17 00:00:00 2001 From: Aiden <37043404+tarontop@users.noreply.github.com> Date: Sat, 27 May 2023 16:54:13 +0800 Subject: [PATCH 11/18] Update athom-presence-sensor.yaml --- athom-presence-sensor.yaml | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/athom-presence-sensor.yaml b/athom-presence-sensor.yaml index 5b91f628..832891e7 100644 --- a/athom-presence-sensor.yaml +++ b/athom-presence-sensor.yaml @@ -1,6 +1,6 @@ substitutions: name: "athom-presence-sensor" - friendly_name: "presence_sensor" + friendly_name: "presence sensor" room: "" device_description: "mmwave radar human presence sensor" project_name: "Athom Technology.Presence Sensor" @@ -37,6 +37,7 @@ captive_portal: dashboard_import: package_import_url: github://athom-tech/athom-configs/athom-presence-sensor.yaml + import_full_config: true light: @@ -133,22 +134,22 @@ binary_sensor: sensor: - platform: uptime - name: "${friendly_name} Uptime Sensor" + name: "Uptime Sensor" - platform: wifi_signal - name: "${friendly_name} WiFi Signal Sensor" + name: "WiFi Signal Sensor" update_interval: 60s - platform: bh1750 name: "Light Sensor" address: 0x23 - update_interval: 5s + update_interval: 10s switch: - platform: template name: "mmWave Status" id: "mmwave_sensor" - disabled_by_default: true + internal: true entity_category: config optimistic: true restore_state: true @@ -307,8 +308,8 @@ button: entity_category: config internal: true - platform: template - name: "Factory Reset mmWave" - id: "factory_reset_mmwave" + name: "Reset device" + id: "factory_reset_device" entity_category: config on_press: - switch.turn_off: mmwave_sensor @@ -342,7 +343,10 @@ text_sensor: - platform: wifi_info ip_address: name: "IP Address" - disabled_by_default: true + ssid: + name: "Connected SSID" + mac_address: + name: "Mac Address" time: - platform: sntp From cee1b292869059dc9d6989fa73e40e117c5055fe Mon Sep 17 00:00:00 2001 From: Aiden <37043404+tarontop@users.noreply.github.com> Date: Sat, 27 May 2023 17:25:51 +0800 Subject: [PATCH 12/18] Update athom-presence-sensor.yaml --- athom-presence-sensor.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/athom-presence-sensor.yaml b/athom-presence-sensor.yaml index 832891e7..a65ca477 100644 --- a/athom-presence-sensor.yaml +++ b/athom-presence-sensor.yaml @@ -87,7 +87,7 @@ binary_sensor: - platform: gpio pin: - number: GPIO12 + number: GPIO14 mode: input: true pullup: true @@ -103,7 +103,7 @@ binary_sensor: - platform: gpio pin: - number: GPIO14 + number: GPIO12 mode: input: true pullup: true From ea2b1b3c269b3be1d134939fe4f4d22df5903465 Mon Sep 17 00:00:00 2001 From: Aiden <37043404+tarontop@users.noreply.github.com> Date: Sat, 27 May 2023 18:51:08 +0800 Subject: [PATCH 13/18] Update athom-presence-sensor.yaml --- athom-presence-sensor.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/athom-presence-sensor.yaml b/athom-presence-sensor.yaml index a65ca477..e5448adf 100644 --- a/athom-presence-sensor.yaml +++ b/athom-presence-sensor.yaml @@ -37,7 +37,6 @@ captive_portal: dashboard_import: package_import_url: github://athom-tech/athom-configs/athom-presence-sensor.yaml - import_full_config: true light: @@ -143,7 +142,7 @@ sensor: - platform: bh1750 name: "Light Sensor" address: 0x23 - update_interval: 10s + update_interval: 5s switch: - platform: template From bf15ea30a6834239c88dd289dc90fcd8a099b1a4 Mon Sep 17 00:00:00 2001 From: Aiden <37043404+tarontop@users.noreply.github.com> Date: Sat, 27 May 2023 18:57:45 +0800 Subject: [PATCH 14/18] Update athom-presence-sensor.yaml --- athom-presence-sensor.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/athom-presence-sensor.yaml b/athom-presence-sensor.yaml index e5448adf..af78c2ac 100644 --- a/athom-presence-sensor.yaml +++ b/athom-presence-sensor.yaml @@ -80,9 +80,7 @@ binary_sensor: - timing: - ON for at least 4s then: - - button.press: factory_reset_mmwave - - delay: 3s - - button.press: Reset + - button.press: factory_reset_device - platform: gpio pin: From 319f009fcceb5d347b7ccb53cc941c8566554b89 Mon Sep 17 00:00:00 2001 From: Aiden <37043404+tarontop@users.noreply.github.com> Date: Sat, 27 May 2023 19:50:44 +0800 Subject: [PATCH 15/18] Delete athom-presence-sensor.yaml --- athom-presence-sensor.yaml | 350 ------------------------------------- 1 file changed, 350 deletions(-) delete mode 100644 athom-presence-sensor.yaml diff --git a/athom-presence-sensor.yaml b/athom-presence-sensor.yaml deleted file mode 100644 index af78c2ac..00000000 --- a/athom-presence-sensor.yaml +++ /dev/null @@ -1,350 +0,0 @@ -substitutions: - name: "athom-presence-sensor" - friendly_name: "presence sensor" - room: "" - device_description: "mmwave radar human presence sensor" - project_name: "Athom Technology.Presence Sensor" - project_version: "1.0" - -esphome: - name: "${name}" - friendly_name: "${friendly_name}" - name_add_mac_suffix: true - project: - name: "${project_name}" - version: "${project_version}" - -esp8266: - board: esp8285 - -# Enable logging -logger: - -api: - -ota: - -mdns: - disabled: false - -web_server: - port: 80 - -wifi: - ap: {} - -captive_portal: - -dashboard_import: - package_import_url: github://athom-tech/athom-configs/athom-presence-sensor.yaml - - -light: - - platform: status_led - name: "Status LED" - id: led - pin: GPIO16 - disabled_by_default: true - entity_category: config - -i2c: - sda: GPIO4 - scl: GPIO5 - scan: true - -uart: - tx_pin: GPIO15 - rx_pin: GPIO13 - baud_rate: 115200 - # debug: - # direction: BOTH - # dummy_receiver: true - # after: - # delimiter: "\n" - # sequence: - # - lambda: UARTDebug::log_string(direction, bytes); - - -binary_sensor: - - platform: status - name: "Status" - - - platform: gpio - pin: - number: GPIO0 - mode: INPUT_PULLUP - inverted: true - name: "Button" - disabled_by_default: true - on_multi_click: - - timing: - - ON for at least 4s - then: - - button.press: factory_reset_device - - - platform: gpio - pin: - number: GPIO14 - mode: - input: true - pullup: true - name: "Pir Sensor" - id: pir - filters: - - delayed_on: 50ms - - delayed_off: 10s - device_class: motion - on_press: - then: - - light.turn_on: led - - - platform: gpio - pin: - number: GPIO12 - mode: - input: true - pullup: true - name: "mmWave Sensor" - id: mmwave - filters: - - delayed_on: 50ms - device_class: motion - on_release: - then: - - light.turn_off: led - - - - platform: template - name: "Occupancy" - id: occupancy - device_class: occupancy - lambda: |- - if ( id(mmwave).state and id(pir).state) { - return true; - } - else if (id(mmwave).state == 0) { - return false; - } - else { - return id(occupancy).state; - } - -sensor: - - platform: uptime - name: "Uptime Sensor" - - - platform: wifi_signal - name: "WiFi Signal Sensor" - update_interval: 60s - - - platform: bh1750 - name: "Light Sensor" - address: 0x23 - update_interval: 5s - -switch: - - platform: template - name: "mmWave Status" - id: "mmwave_sensor" - internal: true - entity_category: config - optimistic: true - restore_state: true - turn_on_action: - - uart.write: "sensorStart\r\n" - turn_off_action: - - uart.write: "sensorStop\r\n" - - - -number: - - platform: template - name: mmWave detection distance #Value range: 1.9 ~ 12m Default: 6 - id: Detection_Distance - entity_category: config - min_value: 1.9 - max_value: 12 - initial_value: 6 - optimistic: true - step: 0.1 - restore_value: true - unit_of_measurement: m - mode: slider - set_action: - - switch.turn_off: mmwave_sensor - - delay: 500ms - - uart.write: !lambda - std::string ranges = "setRange 1.8 " + to_string(id(Detection_Distance).state) + "\r\n"; - return std::vector(ranges.begin(), ranges.end()); - - delay: 500ms - - uart.write: "saveConfig\r\n" - - delay: 500ms - - switch.turn_on: mmwave_sensor - - - - platform: template - name: mmWave maintain sensitivity #Value range: 0 ~ 9 Default Maintain sensitivity: 7 Default Trigger sensitivity: 5 - id: Maintain_Sensitivity - entity_category: config - min_value: 0 - max_value: 9 - initial_value: 7 - optimistic: true - step: 1 - restore_value: true - mode: slider - set_action: - - switch.turn_off: mmwave_sensor - - delay: 500ms - - uart.write: !lambda - std::string ranges = "setSensitivity " + to_string(id(Maintain_Sensitivity).state) + " " + to_string(id(Trigger_Sensitivity).state) + "\r\n"; - return std::vector(ranges.begin(), ranges.end()); - - delay: 500ms - - uart.write: "saveConfig\r\n" - - delay: 500ms - - switch.turn_on: mmwave_sensor - - - - platform: template - name: mmWave tigger sensitivity #Value range: 0 ~ 9 Default Maintain sensitivity: 7 Default Trigger sensitivity: 5 - id: Trigger_Sensitivity - entity_category: config - min_value: 0 - max_value: 9 - initial_value: 5 - optimistic: true - step: 1 - restore_value: true - mode: slider - set_action: - - switch.turn_off: mmwave_sensor - - delay: 500ms - - uart.write: !lambda - std::string ranges = "setSensitivity " + to_string(id(Maintain_Sensitivity).state) + " " + to_string(id(Trigger_Sensitivity).state) + "\r\n"; - return std::vector(ranges.begin(), ranges.end()); - - delay: 500ms - - uart.write: "saveConfig\r\n" - - delay: 500ms - - switch.turn_on: mmwave_sensor - - - - platform: template - name: mmWave confirmation delay #Confirmation delay Value range: 0 ~ 100 default 0.050 seconds. - id: confirmation_delay - entity_category: config - min_value: 0.1 - max_value: 60 - initial_value: 0.1 - optimistic: true - step: 0.1 - restore_value: true - unit_of_measurement: seconds - mode: slider - set_action: - - switch.turn_off: mmwave_sensor - - delay: 500ms - - uart.write: !lambda |- - std::string mss = "setLatency " + to_string(id(confirmation_delay).state) + " " + to_string(id(disappear_delay).state) + "\r\n"; - return std::vector(mss.begin(), mss.end()); - - delay: 500ms - - uart.write: "saveConfig\r\n" - - delay: 500ms - - switch.turn_on: mmwave_sensor - - - platform: template - name: mmWave disappear delay #Fade-out delay Value range: 0.5 ~ 1500, default 15 seconds. - id: disappear_delay - entity_category: config - min_value: 1 - max_value: 300 - initial_value: 15 - optimistic: true - step: 1 - restore_value: true - unit_of_measurement: seconds - mode: auto - set_action: - - switch.turn_off: mmwave_sensor - - delay: 500ms - - uart.write: !lambda |- - std::string mss = "setLatency " + to_string(id(confirmation_delay).state) + " " + to_string(id(disappear_delay).state) + "\r\n"; - return std::vector(mss.begin(), mss.end()); - - delay: 500ms - - uart.write: "saveConfig\r\n" - - delay: 500ms - - switch.turn_on: mmwave_sensor - - - - platform: template - name: mmWave inhibit - id: SetInhibit - entity_category: config - min_value: 1 - max_value: 255 - initial_value: 1 - optimistic: true - step: 1 - restore_value: true - unit_of_measurement: seconds - mode: slider - set_action: - - switch.turn_off: mmwave_sensor - - delay: 500ms - - uart.write: !lambda - std::string ranges = "setInhibit " + to_string(id(SetInhibit).state) + "\r\n"; - return std::vector(ranges.begin(), ranges.end()); - - delay: 500ms - - uart.write: "saveConfig\r\n" - - delay: 500ms - - switch.turn_on: mmwave_sensor - -button: - - platform: factory_reset - name: Restart with Factory Default Settings - id: Reset - entity_category: config - internal: true - - platform: template - name: "Reset device" - id: "factory_reset_device" - entity_category: config - on_press: - - switch.turn_off: mmwave_sensor - - delay: 500ms - - uart.write: "resetCfg\r\n" - - delay: 1s - - switch.turn_on: mmwave_sensor - - button.press: Reset - - - platform: restart - name: Restart_esp - id: restart_esp - entity_category: config - internal: true - - platform: template - name: "Restart_mmWave" - id: "restart_mmwave" - entity_category: config - internal: true - on_press: - - uart.write: "resetSystem\r\n" - - - platform: template - name: Restart device - entity_category: config - on_press: - - button.press: restart_mmwave - - button.press: restart_esp - -text_sensor: - - platform: wifi_info - ip_address: - name: "IP Address" - ssid: - name: "Connected SSID" - mac_address: - name: "Mac Address" - -time: - - platform: sntp - id: my_time From 2db8232fad8453022a365a2e79619ee8c7698b76 Mon Sep 17 00:00:00 2001 From: Aiden <37043404+tarontop@users.noreply.github.com> Date: Sat, 27 May 2023 19:51:16 +0800 Subject: [PATCH 16/18] Add files via upload --- athom-presence-sensor.yaml | 349 +++++++++++++++++++++++++++++++++++++ 1 file changed, 349 insertions(+) create mode 100644 athom-presence-sensor.yaml diff --git a/athom-presence-sensor.yaml b/athom-presence-sensor.yaml new file mode 100644 index 00000000..22876d48 --- /dev/null +++ b/athom-presence-sensor.yaml @@ -0,0 +1,349 @@ +substitutions: + name: "athom-presence-sensor" + friendly_name: "presence sensor" + room: "" + device_description: "mmwave radar human presence sensor" + project_name: "Athom Technology.Presence Sensor" + project_version: "1.0" + +esphome: + name: "${name}" + friendly_name: "${friendly_name}" + name_add_mac_suffix: true + project: + name: "${project_name}" + version: "${project_version}" + +esp8266: + board: esp8285 + +# Enable logging +logger: + +api: + +ota: + +mdns: + disabled: false + +web_server: + port: 80 + +wifi: + ap: {} + +captive_portal: + +dashboard_import: + package_import_url: github://tarontop/athom-configs/athom-presence-sensor.yaml + +light: + - platform: status_led + name: "Status LED" + id: led + pin: GPIO16 + disabled_by_default: true + entity_category: config + +i2c: + sda: GPIO4 + scl: GPIO5 + scan: true + +uart: + tx_pin: GPIO15 + rx_pin: GPIO13 + baud_rate: 115200 + # debug: + # direction: BOTH + # dummy_receiver: true + # after: + # delimiter: "\n" + # sequence: + # - lambda: UARTDebug::log_string(direction, bytes); + + +binary_sensor: + - platform: status + name: "Status" + + - platform: gpio + pin: + number: GPIO0 + mode: INPUT_PULLUP + inverted: true + name: "Button" + disabled_by_default: true + on_multi_click: + - timing: + - ON for at least 4s + then: + - button.press: factory_reset_device + + - platform: gpio + pin: + number: GPIO14 + mode: + input: true + pullup: true + name: "Pir Sensor" + id: pir + filters: + - delayed_on: 50ms + - delayed_off: 10s + device_class: motion + on_press: + then: + - light.turn_on: led + + - platform: gpio + pin: + number: GPIO12 + mode: + input: true + pullup: true + name: "mmWave Sensor" + id: mmwave + filters: + - delayed_on: 50ms + device_class: motion + on_release: + then: + - light.turn_off: led + + + - platform: template + name: "Occupancy" + id: occupancy + device_class: occupancy + lambda: |- + if ( id(mmwave).state and id(pir).state) { + return true; + } + else if (id(mmwave).state == 0) { + return false; + } + else { + return id(occupancy).state; + } + +sensor: + - platform: uptime + name: "Uptime Sensor" + + - platform: wifi_signal + name: "WiFi Signal Sensor" + update_interval: 60s + + - platform: bh1750 + name: "Light Sensor" + address: 0x23 + update_interval: 5s + +switch: + - platform: template + name: "mmWave Status" + id: "mmwave_sensor" + internal: true + entity_category: config + optimistic: true + restore_state: true + turn_on_action: + - uart.write: "sensorStart\r\n" + turn_off_action: + - uart.write: "sensorStop\r\n" + + + +number: + - platform: template + name: mmWave detection distance #Value range: 1.9 ~ 12m Default: 6 + id: Detection_Distance + entity_category: config + min_value: 1.9 + max_value: 12 + initial_value: 6 + optimistic: true + step: 0.1 + restore_value: true + unit_of_measurement: m + mode: slider + set_action: + - switch.turn_off: mmwave_sensor + - delay: 500ms + - uart.write: !lambda + std::string ranges = "setRange 1.8 " + to_string(id(Detection_Distance).state) + "\r\n"; + return std::vector(ranges.begin(), ranges.end()); + - delay: 500ms + - uart.write: "saveConfig\r\n" + - delay: 500ms + - switch.turn_on: mmwave_sensor + + + - platform: template + name: mmWave maintain sensitivity #Value range: 0 ~ 9 Default Maintain sensitivity: 7 Default Trigger sensitivity: 5 + id: Maintain_Sensitivity + entity_category: config + min_value: 0 + max_value: 9 + initial_value: 7 + optimistic: true + step: 1 + restore_value: true + mode: slider + set_action: + - switch.turn_off: mmwave_sensor + - delay: 500ms + - uart.write: !lambda + std::string ranges = "setSensitivity " + to_string(id(Maintain_Sensitivity).state) + " " + to_string(id(Trigger_Sensitivity).state) + "\r\n"; + return std::vector(ranges.begin(), ranges.end()); + - delay: 500ms + - uart.write: "saveConfig\r\n" + - delay: 500ms + - switch.turn_on: mmwave_sensor + + + - platform: template + name: mmWave tigger sensitivity #Value range: 0 ~ 9 Default Maintain sensitivity: 7 Default Trigger sensitivity: 5 + id: Trigger_Sensitivity + entity_category: config + min_value: 0 + max_value: 9 + initial_value: 5 + optimistic: true + step: 1 + restore_value: true + mode: slider + set_action: + - switch.turn_off: mmwave_sensor + - delay: 500ms + - uart.write: !lambda + std::string ranges = "setSensitivity " + to_string(id(Maintain_Sensitivity).state) + " " + to_string(id(Trigger_Sensitivity).state) + "\r\n"; + return std::vector(ranges.begin(), ranges.end()); + - delay: 500ms + - uart.write: "saveConfig\r\n" + - delay: 500ms + - switch.turn_on: mmwave_sensor + + + - platform: template + name: mmWave confirmation delay #Confirmation delay Value range: 0 ~ 100 default 0.050 seconds. + id: confirmation_delay + entity_category: config + min_value: 0.1 + max_value: 60 + initial_value: 0.1 + optimistic: true + step: 0.1 + restore_value: true + unit_of_measurement: seconds + mode: slider + set_action: + - switch.turn_off: mmwave_sensor + - delay: 500ms + - uart.write: !lambda |- + std::string mss = "setLatency " + to_string(id(confirmation_delay).state) + " " + to_string(id(disappear_delay).state) + "\r\n"; + return std::vector(mss.begin(), mss.end()); + - delay: 500ms + - uart.write: "saveConfig\r\n" + - delay: 500ms + - switch.turn_on: mmwave_sensor + + - platform: template + name: mmWave disappear delay #Fade-out delay Value range: 0.5 ~ 1500, default 15 seconds. + id: disappear_delay + entity_category: config + min_value: 1 + max_value: 300 + initial_value: 15 + optimistic: true + step: 1 + restore_value: true + unit_of_measurement: seconds + mode: auto + set_action: + - switch.turn_off: mmwave_sensor + - delay: 500ms + - uart.write: !lambda |- + std::string mss = "setLatency " + to_string(id(confirmation_delay).state) + " " + to_string(id(disappear_delay).state) + "\r\n"; + return std::vector(mss.begin(), mss.end()); + - delay: 500ms + - uart.write: "saveConfig\r\n" + - delay: 500ms + - switch.turn_on: mmwave_sensor + + + - platform: template + name: mmWave inhibit + id: SetInhibit + entity_category: config + min_value: 1 + max_value: 255 + initial_value: 1 + optimistic: true + step: 1 + restore_value: true + unit_of_measurement: seconds + mode: slider + set_action: + - switch.turn_off: mmwave_sensor + - delay: 500ms + - uart.write: !lambda + std::string ranges = "setInhibit " + to_string(id(SetInhibit).state) + "\r\n"; + return std::vector(ranges.begin(), ranges.end()); + - delay: 500ms + - uart.write: "saveConfig\r\n" + - delay: 500ms + - switch.turn_on: mmwave_sensor + +button: + - platform: factory_reset + name: Restart with Factory Default Settings + id: Reset + entity_category: config + internal: true + - platform: template + name: "Reset device" + id: "factory_reset_device" + entity_category: config + on_press: + - switch.turn_off: mmwave_sensor + - delay: 500ms + - uart.write: "resetCfg\r\n" + - delay: 1s + - switch.turn_on: mmwave_sensor + - button.press: Reset + + - platform: restart + name: Restart_esp + id: restart_esp + entity_category: config + internal: true + - platform: template + name: "Restart_mmWave" + id: "restart_mmwave" + entity_category: config + internal: true + on_press: + - uart.write: "resetSystem\r\n" + + - platform: template + name: Restart device + entity_category: config + on_press: + - button.press: restart_mmwave + - button.press: restart_esp + +text_sensor: + - platform: wifi_info + ip_address: + name: "IP Address" + ssid: + name: "Connected SSID" + mac_address: + name: "Mac Address" + +time: + - platform: sntp + id: my_time \ No newline at end of file From 10ab29bafea4d2774dbf32b68323818d95308432 Mon Sep 17 00:00:00 2001 From: Aiden <37043404+tarontop@users.noreply.github.com> Date: Mon, 29 May 2023 14:25:48 +0800 Subject: [PATCH 17/18] Update athom-presence-sensor.yaml --- athom-presence-sensor.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/athom-presence-sensor.yaml b/athom-presence-sensor.yaml index 22876d48..7c2b85b7 100644 --- a/athom-presence-sensor.yaml +++ b/athom-presence-sensor.yaml @@ -333,6 +333,7 @@ button: entity_category: config on_press: - button.press: restart_mmwave + - delay: 1s - button.press: restart_esp text_sensor: @@ -346,4 +347,4 @@ text_sensor: time: - platform: sntp - id: my_time \ No newline at end of file + id: my_time From 4f70577cc9542014a3480e4e3ea99832af6aef9c Mon Sep 17 00:00:00 2001 From: Aiden <37043404+tarontop@users.noreply.github.com> Date: Mon, 29 May 2023 14:36:02 +0800 Subject: [PATCH 18/18] Update athom-presence-sensor.yaml --- athom-presence-sensor.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/athom-presence-sensor.yaml b/athom-presence-sensor.yaml index 7c2b85b7..d61d0223 100644 --- a/athom-presence-sensor.yaml +++ b/athom-presence-sensor.yaml @@ -298,6 +298,10 @@ number: - switch.turn_on: mmwave_sensor button: + - platform: safe_mode + name: "Safe Mode" + internal: false + - platform: factory_reset name: Restart with Factory Default Settings id: Reset