Hi guys,
I have an ESP32 controlling a fan to control humidity in a nook in my house below/behind some cupboards. Together with a DHT22 I can keep an eye on what the environment does, and -for now by “hand”, through HA- control the fan speed.
However, when ESPHome reboots, it does not start the fan by itself. So, I thought, by adding an “on_boot” I might be able to accomplish this. However, it does not work. Does anyone know what I’m doing wrong here? This is the yaml:
esphome:
name: keukenkast
on_boot:
priority: 600
then:
- fan.turn_on: keukenkast_fan
- output.turn_on: ventilation_fan_pwm
- output.set_level:
id: ventilation_fan_pwm
level: "40%"
esp32:
board: esp32dev
framework:
type: arduino
# Enable logging
logger:
# Enable Home Assistant API
api:
encryption:
key: !secret ha_api_key
time:
- platform: homeassistant
id: homeassistant_time
ota:
password: "15563c9726f0e93ea26369287287e534"
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
domain: ".intern.vanhalderen.net"
use_address: 192.168.0.5
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Keukenkast Fallback Hotspot"
password: !secret esp_ap_password
text_sensor:
- platform: version
name: ESPHome Keukenkast ESPHome Version
- platform: wifi_info
ip_address:
name: ESPHome Keukenkast IP
ssid:
name: ESPHome Keukenkast SSID
bssid:
name: ESPHome Keukenkast BSSID
sensor:
- platform: dht
pin: GPIO21
temperature:
name: "Keukenkast Temperature"
id: keukenkast_temperature
accuracy_decimals: 1
humidity:
name: "Keukenkast Humidity"
id: keukenkast_humidity
accuracy_decimals: 1
update_interval: 30s
- platform: uptime
name: ESPHome Keukenkast Uptime
- platform: wifi_signal
name: ESPHome Keukenkast WiFi Signal
update_interval: 60s
output:
- platform: ledc
pin: GPIO27
id: ventilation_fan_pwm
fan:
- platform: speed
output: ventilation_fan_pwm
name: "Keukenkast Ventilatie"
id: keukenkast_fan
switch:
- platform: restart
name: "ESPHome Keukenkast Restart"
mqtt:
broker: kermit.intern.vanhalderen.net
username: !secret mqtt_username
password: !secret mqtt_password
client_id: esphome_keukenkast
Someone got an idea? Thanks in advance!
Patrick