From ab763398dbaa5bd88419da72f29e913ec3ded46b Mon Sep 17 00:00:00 2001 From: Aiden <891483489@qq.com> Date: Wed, 22 Mar 2023 16:05:01 +0800 Subject: [PATCH] remove friendly_name --- athom-smart-plug-v2.yaml | 36 ++++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/athom-smart-plug-v2.yaml b/athom-smart-plug-v2.yaml index 205fc5b..2a2f618 100644 --- a/athom-smart-plug-v2.yaml +++ b/athom-smart-plug-v2.yaml @@ -1,12 +1,13 @@ substitutions: device_name: "athom-smart-plug-v2" - friendly_name: "Athom Smart Plug V2" + alias_name: "Athom Plug" project_name: "athom.smart-plug-v2" 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,27 +75,27 @@ 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: @@ -109,7 +110,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" @@ -120,7 +121,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 @@ -131,19 +132,19 @@ sensor: button: - platform: factory_reset - name: Restart with Factory Default Settings + name: "Reset" id: Reset switch: - platform: gpio - name: "${friendly_name}" + name: "${alias_name}" pin: GPIO12 id: relay restore_mode: ${relay_restore_mode} light: - platform: status_led - name: "${friendly_name} Status LED" + name: "Status LED" id: blue_led disabled_by_default: true pin: @@ -153,9 +154,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