From 24c89f3190e0b112e465bb02d928200c0fc80880 Mon Sep 17 00:00:00 2001 From: Mario Lang Date: Sat, 22 Mar 2025 20:05:27 +0000 Subject: [PATCH] feat: initial commit --- .devcontainer/devcontainer.json | 12 ++++++++++++ .editorconfig | 12 ++++++++++++ .gitignore | 2 ++ .vscode/settings.json | 6 ++++++ README.md | 25 +++++++++++++++++++++++++ secrets.yaml.template | 5 +++++ 6 files changed, 62 insertions(+) create mode 100644 .devcontainer/devcontainer.json create mode 100644 .editorconfig create mode 100644 .gitignore create mode 100644 .vscode/settings.json create mode 100644 README.md create mode 100644 secrets.yaml.template diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..8967d61 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,12 @@ +{ + "image": "ghcr.io/esphome/esphome", + "customizations": { + "vscode": { + "extensions": [ + "EditorConfig.EditorConfig", + "ESPHome.esphome-vscode", + "redhat.vscode-yaml" + ] + } + } +} diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..5d47c21 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,12 @@ +# EditorConfig is awesome: https://EditorConfig.org + +# top-most EditorConfig file +root = true + +[*] +indent_style = space +indent_size = 2 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7aa82eb --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.esphome +secrets.yaml \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..7e23d54 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,6 @@ +{ + "files.associations": { + "secrets*.yaml": "yaml", + "*.yaml": "esphome" + } +} diff --git a/README.md b/README.md new file mode 100644 index 0000000..6162da1 --- /dev/null +++ b/README.md @@ -0,0 +1,25 @@ +# ESPHome Device Configurations + +This repo contains YAML configurations and scripts for ESPHome devices. Each device has its own YAML file (e.g., `device1.yaml`, `device2.yaml`). + +## Installation +1. Clone this repo +2. Open in VS Code and reopen in Dev Container when prompted. +3. Adjust YAML files as needed. + +## Secrets +Create a `secrets.yaml` file to store Wi-Fi and OTA secrets. This ensures the OTA password is consistent across builds: +```yaml +wifi_ssid: "your-ssid" +wifi_password: "your-password" +ota_password: "your-ota-password" +``` + +## Usage +- Prepare device for first use via [esphome web flasher](https://web.esphome.io) +- Connect device to wifi +- Compile & upload config via ota and ip address of the device: + ```bash + esphome run device.yaml --device x.x.x.x + ``` + diff --git a/secrets.yaml.template b/secrets.yaml.template new file mode 100644 index 0000000..40c1578 --- /dev/null +++ b/secrets.yaml.template @@ -0,0 +1,5 @@ +# Wi-Fi SSID and password +wifi_ssid: +wifi_password: +# Over-the-air update secret, must be the same for all users who compile esphome configs +ota_password: