Fanspeed max on boot

I’ve managed to get fan rpm controll and rpm signal working. However I can’t seem to get it to run at max speed on boot (100%)?

esphome:
  name: esphome-web-e4a407
  friendly_name: rackmonitor
  min_version: 2025.5.0
  name_add_mac_suffix: false

  on_boot:
    priority: 800  # run after Wi-Fi, but before HA connection
    then:
      - fan.turn_on:
          id: fan1_control
          speed: 100
      - fan.turn_on:
          id: fan2_control
          speed: 100
      - fan.turn_on:
          id: fan3_control
          speed: 100
      - fan.turn_on:
          id: fan4_control
          speed: 100


esp8266:
  board: d1_mini

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "ohhey"

# Enable OTA updates
ota:
  - platform: esphome
    password: "someword"

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  ap:
    ssid: "Rack-Controller Fallback Hotspot"
    password: "something"

output:
  - platform: esp8266_pwm
    id: fan_pwm1
    pin: D0
    frequency: 25000 Hz

  - platform: esp8266_pwm
    id: fan_pwm2
    pin: D2
    frequency: 25000 Hz

  - platform: esp8266_pwm
    id: fan_pwm3
    pin: D3
    frequency: 25000 Hz

  - platform: esp8266_pwm
    id: fan_pwm4
    pin: D4
    frequency: 25000 Hz

fan:
  - platform: speed
    output: fan_pwm1
    name: "Rack fan"
    id: fan1_control
    speed_count: 100
    restore_mode: ALWAYS_ON  # Ensures fan starts at full speed on boot

  - platform: speed
    output: fan_pwm2
    name: "Alpha Node"
    id: fan2_control
    speed_count: 100
    restore_mode: ALWAYS_ON

  - platform: speed
    output: fan_pwm3
    name: "Beta Node"
    id: fan3_control
    speed_count: 100
    restore_mode: ALWAYS_ON

  - platform: speed
    output: fan_pwm4
    name: "Charlie Node"
    id: fan4_control
    speed_count: 100
    restore_mode: ALWAYS_ON

sensor:
  - platform: dht
    model: DHT11
    pin: D8
    temperature:
      name: "Rack Temperature"
    humidity:
      name: "Rack Humidity"
    update_interval: 30s

  # RPM Sensors
  - platform: pulse_counter
    pin:
      number: D7
      mode: INPUT_PULLUP
    name: "Charlie RPM"
    update_interval: 10s
    unit_of_measurement: "RPM"
    internal_filter: 10us
    filters:
      - multiply: 0.5
      - round: 0

  - platform: pulse_counter
    pin:
      number: D6
      mode: INPUT_PULLUP
    name: "Beta RPM"
    update_interval: 10s
    unit_of_measurement: "RPM"
    internal_filter: 10us
    filters:
      - multiply: 0.5
      - round: 0

  - platform: pulse_counter
    pin:
      number: D5
      mode: INPUT_PULLUP
    name: "Alpha RPM"
    update_interval: 10s
    unit_of_measurement: "RPM"
    internal_filter: 10us
    filters:
      - multiply: 0.5
      - round: 0

  - platform: pulse_counter
    pin:
      number: D1
      mode: INPUT_PULLUP
    name: "Rack RPM"
    update_interval: 10s
    unit_of_measurement: "RPM"
    internal_filter: 10us
    filters:
      - multiply: 0.5
      - round: 0

Whenever I reboot the ESP the fans shows as on but the RPM is 0%.

Have you tried changing the priority to something lower so it initiates a bit later? Just thinking the PWM outputs are software on the 8266 platform so 800 might be too early as that is where the hardware is initialised. You could try -100 see if makes a difference then work back up to 800.

1 Like

Thank you! Worked out great!