Hi guys, I’m trying to create a secret file on esphome YAML but when I try to run the code it gives me this:
PS C:\Coding\Home Assistant\Water Temp\Test> esphome run test.yml
INFO Reading configuration test.yml...
Failed config
WifiSsid: [source secrets.yaml:2]
Component not found: WifiSsid.
!secret WifiSsid
WifiPassword: [source secrets.yaml:3]
Component not found: WifiPassword.
!secret WifiPassword
PhoneNumber: [source secrets.yaml:6]
Component not found: PhoneNumber.
!secret PhoneNumber
this is my code:
<<: !include secrets.yaml
esphome:
name: hot-lake
platform: ESP32
board: esp32dev
# Enable logging
logger:
baud_rate: 0
level: VERBOSE
# Enable Home Assistant API
api:
password: ""
ota:
password: ""
wifi:
ssid: !secret WifiSsid
password: !secret WifiPassword
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Hot-Water-Lake-Esp32"
password: "iAZP1T0BOxke"
captive_portal:
# defining sensors:
# relay:
switch:
- platform: gpio
name: "Relay"
id: relay_1
pin: GPIO26
# sim:
uart:
baud_rate: 9600
tx_pin: GPIO1
rx_pin: GPIO3
sim800l:
# dallas temperature sensor:
dallas:
- pin: GPIO32
# conditions:
sensor:
- platform: dallas
address: 0x2e0319a27968ac28
name: "Water Temperature ESP32"
on_value_range:
- below: 24.0
then:
- sim800l.send_sms:
recipient: !secret PhoneNumber
message: Cold
- above: 32.0
then:
- sim800l.send_sms:
recipient: !secret PhoneNumber
message: Hot
binary_sensor:
- platform: sim800l
registered:
name: "Sim800L Registered"
- platform: gpio
pin: GPIO25
name: "Button"
on_press:
then:
- sim800l.send_sms:
recipient: !secret PhoneNumber
message: Hot
# deep_sleep:
# run_duration: 2min
# sleep_duration: 58min
this is my secrets file:
# wifi password and ssid
WifiSsid: XXX
WifiPassword: XXX
# phone number
PhoneNumber: '+XXX'
Does anybody have an idea how to solve it?
Thanks for the help