Clarify docs and make example yamls consistent. (#12)

This commit is contained in:
Victor Chang
2025-12-27 14:12:36 -08:00
committed by GitHub
parent dd177d5a6f
commit be19f4e0b5
4 changed files with 35 additions and 16 deletions

View File

@@ -41,10 +41,11 @@ api:
key: "M3d8zXcnwM4Uo2fRybLjFUNVs+mnlC1XbEfnlvUNI2c="
```
- Just a security measure. Its a shared secret between your device and Home Assistant.
- This key is a shared secret between your device and Home Assistant.
- Ensures all ESPHome API traffic (state updates, commands, etc.) is encrypted and authenticated.
- Without it, someone on your LAN could spoof commands to the device.
- To generate one manually:
- The [official documentation](https://esphome.io/components/api/#configuration-variables) can generate a key. Find it under "If you need a key, you can use the key below; it is randomly generated by your browser each time this page loads:"
- Or, to generate one manually:
```
python3 -c "import base64, os; print(base64.b64encode(os.urandom(32)).decode())"
@@ -57,12 +58,13 @@ python3 -c "import base64, os; print(base64.b64encode(os.urandom(32)).decode())"
Looks like this in the YAML:
```
ota:
platform: esphome
password: "blah"
```
- Just a security measure. Its a shared secret between your device and Home Assistant.
- Used only when flashing new firmware over Wi-Fi (OTA updates).
- This password is a shared secret between your device and ESPHome.
- Other instances of ESPHome would need to know this password in order to update your device with a new firmware.
- Prevents anyone on your LAN from pushing firmware to the device without authorization.
- ESPHome generates one the first time if you dont set it yourself.
- The `password:` is optional, but `ota:` is **required** if you want the ability to deploy firmware updates wirelessly.
---