Fabian-Schmidt / esphome-truma_inetbox

ESPHome component to remote control Truma CP Plus Heater
GNU General Public License v3.0
37 stars 7 forks source link

Place hotspot credentials separately? (like wifi SSID and PW) Maybe in secrets.yaml? #10

Closed 7wells closed 1 year ago

7wells commented 1 year ago

Hi Fabian,

Is it possible placing the hotspot credentials separately? (like the Wifi SSID and PW in /config/esphome/secrets.yaml)

When searching for secrets.yaml, I stumbled over this: https://github.com/Fabian-Schmidt/esphome-truma_inetbox/blob/e3f2ca70dce1666319bea9a7b6781a6f80b5ad62/.gitignore

Did you have something like it already in mind? I'm still not fully understanding how Git etc. works, whether this is some leftover or really means something for the code. Thanks for your patience with me. 😊

@snipah Do you have something like it in use?

Fabian-Schmidt commented 1 year ago

You can put your secret either direclty in line in the config. Or you if have multiple devices or want to share the config you can put the in a seperate secrets.yaml file. Example secrets.yaml

wifi_ssid: "My AP"
wifi_password: "My key"
wifi_ap_ssid: "Fallback Hotspot"
wifi_ap_password: "Password"

And in the normal yaml I can use them like this:

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  ap:
    ssid: !secret wifi_ap_ssid
    password: !secret wifi_ap_password

All of this is normal ESP Home stuff.

snipah commented 1 year ago

@snipah Do you have something like it in use?

I do not use a fallback hotspot.