From 9bfa1cd8e153729c0d2407594725210c112db3fd Mon Sep 17 00:00:00 2001 From: Aronne Brivio Date: Sat, 12 Oct 2024 17:49:41 +0200 Subject: [PATCH] feat: review esp8266-01 configuration and use as Master Sword switch instead of a smat plug --- entities/lights.yaml | 2 +- esphome/{master-sword.yaml => esp8266-01.yaml} | 18 ++++++++++-------- secrets.fake.yaml | 8 ++++++-- 3 files changed, 17 insertions(+), 11 deletions(-) rename esphome/{master-sword.yaml => esp8266-01.yaml} (56%) diff --git a/entities/lights.yaml b/entities/lights.yaml index 001955f1..68587fa8 100644 --- a/entities/lights.yaml +++ b/entities/lights.yaml @@ -1,7 +1,7 @@ # Master Sword - platform: switch name: "Spada Suprema" - entity_id: switch.smart_plug_1 + entity_id: switch.esp8266_01_relay # Piantana Sala - platform: group name: "Piantana Sala" diff --git a/esphome/master-sword.yaml b/esphome/esp8266-01.yaml similarity index 56% rename from esphome/master-sword.yaml rename to esphome/esp8266-01.yaml index d1faddda..b1fcf603 100644 --- a/esphome/master-sword.yaml +++ b/esphome/esp8266-01.yaml @@ -1,6 +1,8 @@ +substitutions: + name: "esp8266-01" + esphome: - name: "master-sword" - friendly_name: "Master Sword" + name: ${name} esp8266: board: esp01_1m @@ -11,11 +13,11 @@ logger: # Enable Home Assistant API api: encryption: - key: "qxnithwbnZKvfr29axNOVg3j51zlZB0R0jW7jOlGGCg=" + key: !secret esp8266-01.api.encryption_key ota: - platform: esphome - password: "fbdc6f4c4599fe98ffc506b39ce48e04" + password: !secret esp8266-01.ota.password wifi: ssid: !secret wifi.ssid @@ -23,12 +25,12 @@ wifi: # Enable fallback hotspot (captive portal) in case wifi connection fails ap: - ssid: "master-sword" - password: "bmChb8dr3hdO" + ssid: ${name} + password: !secret esp8266-01.wifi.ap.password captive_portal: switch: - platform: gpio - pin: 14 - id: master_sword + pin: GPIO14 + name: ${name}-relay diff --git a/secrets.fake.yaml b/secrets.fake.yaml index ebc907a4..915de324 100644 --- a/secrets.fake.yaml +++ b/secrets.fake.yaml @@ -68,5 +68,9 @@ google_assistant.client_email: "home-assistant-integration@ga-project-id-0000.ia google_assistant.client_id: "00000000000000000000" google_assistant.client_x509_cert_url: "https://www.googleapis.com/0000000000000000" -wifi.ssid: Vodafone-C02190017 -wifi.password: 4Xe4YNnkyykF33AZ +wifi.ssid: ssid +wifi.password: password + +esp8266-01.api.encryption_key: encryption_key +esp8266-01.ota.password: ota_password +esp8266-01.wifi.ap.password: ap_password