From 1f7c437c3e81a8c8b2820d2eda6961b3cb379a53 Mon Sep 17 00:00:00 2001 From: Nicolas Bachschwell Date: Wed, 8 Oct 2025 10:13:10 +0200 Subject: [PATCH] This adds: - A general folder for documantation configs - A documantation for general esphome devices with functionallity too small for it's own file. - Removed the powersave mode NONE on garage doors. --- 5gModemPower.yaml | 50 ++++++++++++++++++++++++++++++++++++++++++ docs/GENERAL_DEVICE.md | 49 +++++++++++++++++++++++++++++++++++++++++ garage1.yaml | 2 +- 3 files changed, 100 insertions(+), 1 deletion(-) create mode 100644 5gModemPower.yaml create mode 100644 docs/GENERAL_DEVICE.md diff --git a/5gModemPower.yaml b/5gModemPower.yaml new file mode 100644 index 0000000..bd3845d --- /dev/null +++ b/5gModemPower.yaml @@ -0,0 +1,50 @@ +esphome: + name: modempower + +esp8266: + board: sonoff_basic + +wifi: + ssid: !secret wifi_ssid + password: !secret wifi_password + fast_connect: true + ap: + ssid: modempower_rescue + password: !secret rescue_ap_password + +captive_portal: + +api: + encryption: + key: !secret k5gModem + +ota: + - platform: esphome + password: !secret p5gModem + +logger: + +binary_sensor: + - platform: gpio + pin: + number: GPIO0 + mode: + input: true + pullup: true + inverted: true + name: "5G Modem Power Button" + on_press: + - switch.toggle: relay + +switch: + - platform: gpio + name: "5G Modem Power Relay" + pin: GPIO12 + restore_mode: ALWAYS_ON + id: relay + +status_led: + pin: + number: GPIO13 + inverted: yes + diff --git a/docs/GENERAL_DEVICE.md b/docs/GENERAL_DEVICE.md new file mode 100644 index 0000000..29380b3 --- /dev/null +++ b/docs/GENERAL_DEVICE.md @@ -0,0 +1,49 @@ +# What is this: +This is the general documentation for esphome configs deemed too short to deserve their own documantation. Stuff like the 5gModem, the sonoffStecker or the nbs-light-room are just too short for me to believe it necessary. + +So, let's get through the basics of any esphome config developed by me. + +# General configs +Before I start, I should mention what I consider to be general configurations: modules like esphome, esp8266 or esp32, as well as wifi, logger, ota are all part of that. Nearly all of them require all of them (with exception to esp8266 and esp32 as they are mutually exclusive). + +## esphome +The `esphome` defines general points, and is required by any esphome config to function. Weirdly, in the last few years this has become a mere holder for `name` and maybe `version`. + +For `name` I recommand something that actually give the device a name that is clear what it does. +For `version` when used, I recommand using semantic versioning that makes sense. But if you actually use it or not is up to you. + +## esp8266/esp32 +The `esp8266` or `esp32` has a special point about only being their to define the actually board being used. +Most common boards for esp8266 that we use is the `nodemcuv2`. While for the esp32 it is the `wemos_d1_mini32` also sometimes referenced as `esp32dev`. + +A special note about `esp32` is that they have multiple frameworks that are supported. This is defined as `esp32.framework.type`: +- arduino +- esp-idf + +## wifi +The wifi part is not confusing at all. Normally we use `ssid`, `password` and `fast_connect`. You will see that there is also a captive_portal defined at times should the esp somehow fail to connect to the wifi at all. This captive portal and it's own wifi that it will open in such an event can be used to rescue the device without having to manually flash it again. + +SSID is the wifis name, while password is, well, its password. `fast_connect` just means that the esp will NOT attempt to verify that the network exists by scanning for it. This is important if you need to connect to a hidden wifi. + +## logger +We actually keep this empty. Just having it around is enough. + +## api +The api just defines the encryption key for the esphome native api used by esphome and home assistant. + +## ota +Ahh, the usual over the air update component. +The platform used is the normal esphome platform used by the esphome cli as well as the esphome builder in HomeAssistant from there we define a password. Just to be sure. + +## status_led +The status led is specific to each esp device. but I use it usually to detect if a device is connected to the wifi or not. + +# More device specific configuration +This is the section for more device specific configuration options that might be important + +## 5gModemPower +This is a normal sonoff power relay. It has a pin defined for the relay. A pin defined for the actual button should you need to press it directly on the device and that's about it. + +The relay that controls the power is controlled by an gpio pin (Number 12) and starts out as always on. + +There is a binary sensor included for the button on the actual device. This is an inverted pullup pin on gpio 0, pressing it toggles the relay. \ No newline at end of file diff --git a/garage1.yaml b/garage1.yaml index a9e202d..8d2467e 100644 --- a/garage1.yaml +++ b/garage1.yaml @@ -1,5 +1,6 @@ substitutions: garageSide: sy # sy, wo + version: "2.1.3" esphome: name: garage${garageSide} @@ -28,7 +29,6 @@ api: wifi: ssid: !secret wifi_ssid password: !secret wifi_password - power_save_mode: none fast_connect: true logger: #level: VERY_VERBOSE