gregoinc
(Mark)
January 28, 2023, 10:52am
1
Had taken me a while but managed to get a DHT22/AM2302 working on my Sonoff TH10. Has worked perfectly for weeks. After the upgrade to EspHome 2022.12.8 tonight I see this…
This is really frustrating… and not the first time something has imploded after an EspHome update.
I am almost at the stage now where I feel I need to backup all the binaries on my ESP32’s before upgrading. I took a backup before the upgrade, and restored it, but that doesn’t seem to work.
I can only assume there is something I need to change in the code? Ideas greatly appreciated.
tom_l
January 28, 2023, 11:00am
2
Show your DHT sensor config.
gregoinc
(Mark)
January 28, 2023, 11:14am
3
Here you go…
substitutions:
off_hour: '3'
esphome:
name: outside-lights
platform: ESP8266
board: esp01_1m
on_boot:
- wait_until:
condition: api.connected
- delay: 2s
- if:
condition:
and:
- sun.is_below_horizon:
- lambda: |-
auto hour = id(ha_time).now().hour;
return hour > 12 || hour < ${off_hour};
then:
- light.turn_on:
id: outside_lights
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable logging
logger:
# Enable Home Assistant API
api:
ota:
binary_sensor:
- platform: gpio
pin:
number: GPIO0
mode: INPUT_PULLUP
inverted: True
name: "Button"
- platform: status
name: "Outside Light Controller Status"
output:
- platform: gpio
id: relay
pin: GPIO12
# Register the blue LED as a dimmable output ....
- platform: esp8266_pwm
id: blue_led
pin: GPIO13
inverted: True
light:
# ... and then make a light out of it.
- platform: monochromatic
name: "Outside Light Controller Blue LED"
output: blue_led
- platform: binary
name: "Outside Lights"
id: outside_lights
output: relay
sensor:
- platform: dht
model: am2302
pin: GPIO14
temperature:
name: "Sonoff Outside Temperature"
humidity:
name: "Sonoff Outside Humidity"
update_interval: 30s
time:
platform: homeassistant
timezone: !secret timezone
id: ha_time
on_time:
- hours: ${off_hour}
minutes: 0
seconds: 0
then:
- light.turn_off:
id: outside_lights
sun:
latitude: !secret latitude
longitude: !secret longitude
on_sunset:
- elevation: -10°
then:
- light.turn_on:
id: outside_lights
switch:
- platform: restart
name: "Outside Lights Restart"
Hasn’t changed in a long time.
tom_l
January 28, 2023, 11:34am
4
Ok, I was looking to see if you had the model defined (auto can be problematic). You do so that’s not it.
gregoinc:
model: am2302
You could try specifying DHT22 and see if that changes anything.
gregoinc
(Mark)
January 28, 2023, 11:44am
5
Tried DHT22 as part of troubleshooting… but no good. Opened a ticket on github, so will see what advice comes back.
1 Like
tom_l
January 28, 2023, 11:46am
6
I usually don’t bother updating my ESPHome devices unless there is a new feature I want.
1 Like