I’ve got a Wemos D1 Mini running ESPHome that I use to monitor the temperature in my server cabinet via a DHT22 and then set the PWM fan speed for 2 x 80mm fans.
The problem I’m facing is that the entities keep becoming unavailable in Home Assistant - see logs from the last 4 hours below.
server-rack-fans Server Rack Intake Fan turned on
07:46:41 - 1 minute ago
server-rack-fans Server Rack Exhaust Fan turned on
07:46:41 - 1 minute ago
server-rack-fans Server Rack Intake Fan became unavailable
07:46:38 - 2 minutes ago
server-rack-fans Server Rack Exhaust Fan became unavailable
07:46:38 - 2 minutes ago
server-rack-fans Server Rack Intake Fan turned on
07:45:36 - 3 minutes ago
server-rack-fans Server Rack Exhaust Fan turned on
07:45:36 - 3 minutes ago
server-rack-fans Server Rack Intake Fan became unavailable
07:45:33 - 3 minutes ago
server-rack-fans Server Rack Exhaust Fan became unavailable
07:45:33 - 3 minutes ago
server-rack-fans Server Rack Intake Fan turned on
06:32:39 - 1 hour ago
server-rack-fans Server Rack Exhaust Fan turned on
06:32:38 - 1 hour ago
server-rack-fans Server Rack Intake Fan became unavailable
06:32:35 - 1 hour ago
server-rack-fans Server Rack Exhaust Fan became unavailable
06:32:35 - 1 hour ago
server-rack-fans Server Rack Intake Fan turned on
05:20:52 - 2 hours ago
server-rack-fans Server Rack Exhaust Fan turned on
05:20:52 - 2 hours ago
server-rack-fans Server Rack Intake Fan became unavailable
05:20:49 - 2 hours ago
server-rack-fans Server Rack Exhaust Fan became unavailable
05:20:49 - 2 hours ago
server-rack-fans Server Rack Intake Fan turned on
05:01:15 - 3 hours ago
server-rack-fans Server Rack Exhaust Fan turned on
05:01:15 - 3 hours ago
server-rack-fans Server Rack Intake Fan became unavailable
05:01:12 - 3 hours ago
server-rack-fans Server Rack Exhaust Fan became unavailable
05:01:12 - 3 hours ago
server-rack-fans Server Rack Intake Fan turned on
04:18:43 - 3 hours ago
server-rack-fans Server Rack Exhaust Fan turned on
04:18:43 - 3 hours ago
server-rack-fans Server Rack Intake Fan became unavailable
04:18:39 - 3 hours ago
server-rack-fans Server Rack Exhaust Fan became unavailable
04:18:39 - 3 hours ago
server-rack-fans Server Rack Intake Fan turned on
04:09:51 - 4 hours ago
server-rack-fans Server Rack Exhaust Fan turned on
04:09:51 - 4 hours ago
server-rack-fans Server Rack Intake Fan became unavailable
04:09:47 - 4 hours ago
server-rack-fans Server Rack Exhaust Fan became unavailable
04:09:47 - 4 hours ago
server-rack-fans Server Rack Intake Fan turned on
03:39:47 - 4 hours ago
My initial thought is that it is a WiFi related issue but HA reports the signal strength as -55db which seems fine. I have locked it to the nearest Unifi AP and set a static IP on the device. FWIW, unifi says the WiFi experience is excellent for the device with no drops.
Signal strength: -55 dB
Here’s the esphome.yaml for the device in question.
esphome:
name: server-rack-fans
friendly_name: server-rack-fans
esp8266:
board: d1_mini
# Enable logging
logger:
# Enable Home Assistant API
api:
encryption:
key: [key]
ota:
- platform: esphome
password: [password]
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
manual_ip:
static_ip: 192.168.10.199
gateway: 192.168.10.1
dns1: 192.168.10.2
subnet: 255.255.255.0
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Server-Rack-Fans"
password: "HGDx7P2Yf6hb"
captive_portal:
output:
- platform: esp8266_pwm
pin: D5
frequency: 20000 Hz
id: exhaust_fan_pwm
- platform: esp8266_pwm
pin: D7
frequency: 20000 Hz
id: intake_fan_pwm
fan:
- platform: speed
id: exhaust_fan
output: exhaust_fan_pwm
name: "Server Rack Exhaust Fan"
speed_count: 100
restore_mode: ALWAYS_ON
- platform: speed
id: intake_fan
output: intake_fan_pwm
name: "Server Rack Intake Fan"
speed_count: 100
restore_mode: ALWAYS_ON
sensor:
- platform: dht
pin: D1
model: DHT22
humidity:
name: "Server Rack Humidity"
temperature:
name: "Server Rack Temperature"
on_value_range:
- below: 26.0
then:
- fan.turn_off: intake_fan
- fan.turn_off: exhaust_fan
- above: 26.0
below: 31.0
then:
- fan.turn_on:
id: intake_fan
speed: 55
- fan.turn_on:
id: exhaust_fan
speed: 45
- above: 31.0
then:
- fan.turn_on:
id: intake_fan
speed: 100
- fan.turn_on:
id: exhaust_fan
speed: 100
- platform: pulse_counter
pin:
number: D6
mode:
input: true
pullup: true
name: "Server Rack Exhaust Fan Speed"
id: exhaust_fan_pulse
unit_of_measurement: 'RPM'
accuracy_decimals: 0
filters:
- multiply: 0.5
count_mode:
rising_edge: INCREMENT
falling_edge: DISABLE
- platform: pulse_counter
pin:
number: D2
mode:
input: true
pullup: true
name: "Server Rack Intake Fan Speed"
id: intake_fan_pulse
unit_of_measurement: 'RPM'
accuracy_decimals: 0
filters:
- multiply: 0.5
count_mode:
rising_edge: INCREMENT
falling_edge: DISABLE
I have tried two Wemos D1 mini’s and now it is running on a Wemos D1 mini pro but the issue persists. Any help/feedback would be greatly appreciated.