The following validates without error
- fan.turn_on:
speed: LOW
id: weed_fan
Complete listing
esphome:
name: test_fan
platform: ESP32
board: esp-wrover-kit
wifi:
ssid: "TESTSSID"
password: "strongpassword"
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Test Fan Fallback Hotspot"
password: "92Ll0OCu5Zpn"
captive_portal:
# Enable logging
logger:
# Enable Home Assistant API
api:
password: "strongotapassword"
ota:
password: "strongotapassword"
i2c:
sda: GPIO21
scl: GPIO22
scan: True
sensor:
- platform: bme280
temperature:
name: "Weedbox Temperature"
id: weed_temperature
oversampling: 16x
pressure:
name: "Weedbox Pressure"
id: weed_pressure
humidity:
name: "Weedbox Humidity"
id: weed_humidity
filters:
offset: -0
on_value_range:
- below: 30
then:
- fan.turn_off: weed_fan
- above: 30.1
below: 30.5
then:
- fan.turn_on:
speed: LOW
id: weed_fan
- above: 30.6
below: 31
then:
- fan.turn_on:
speed: MEDIUM
id: weed_fan
- above: 31.1
then:
- fan.turn_on:
speed: HIGH
id: weed_fan
address: 0x76
update_interval: 60s
- platform: wifi_signal
name: "Weedbox Wifi Signal"
id: weedbox_wifi_signal
update_interval: 60s
force_update: false
unit_of_measurement: dB
icon: mdi:wifi
accuracy_decimals: 0
- platform: uptime
name: "Weedbox Uptime"
id: weed_uptime
filters:
lambda: return x / 3600;
output:
- platform: ledc
pin: GPIO19
id: weed_pwm
fan:
- platform: speed
output: weed_pwm
name: "Weed Fan"
id: weed_fan
speed:
low: 0.33
medium: 0.66
high: 1
binary_sensor:
- platform: status
name: "Weedbox Status"
text_sensor:
- platform: wifi_info
mac_address:
name: "Weedbox Mac Address"
icon: mdi:network
switch:
- platform: restart
name: "Weedbox Restart"
display:
- platform: lcd_pcf8574
dimensions: 16x2
address: 0x27
lambda: |-
it.printf(0, 0, "T:%.1f", id(weed_temperature).state);
it.printf(8, 0, "H:%.1f", id(weed_humidity).state);
it.printf(0, 1, "U:%.1f", id(weed_uptime).state);
it.printf(8, 1, "F:%.0f", id(weed_fan).state);