Hi!
I’m building battery powered sensors that should wake up, turn on power output for the sensors, take reading, publish to MQTT, turn off power to the sensor and then deep sleep.
While it does read the sensor eventually and post to MQTT, it still seems to be trying to read it too early ignoring the on_boot priority.
on_boot:
priority: 800
then:
- output.turn_on: dht_sensor_power
- component.update: dht_sensor
- output.turn_off: dht_sensor_power
output:
- platform: gpio
pin: GPIO03
inverted: True
id: dht_sensor_power
sensor:
- id: dht_sensor
platform: dht
model: AM2302
pin: GPIO02
update_interval: 1s
temperature:
name: "Temperature"
id: ${name}_temperature
humidity:
name: "Humidity"
id: ${name}_humidity
In logs I get:
[14:00:06][I][app:029]: Running through setup()...
[14:00:06][I][wifi:313]: WiFi Connecting to 'XXX'...
[14:00:06][W][dht:174]: Requesting data from DHT failed!
[14:00:06][W][dht:060]: Invalid readings! Please check your wiring (pull-up resistor, pin number).
[14:00:06][W][component:157]: Component dht.sensor set Warning flag: unspecified
[14:00:06][W][component:157]: Component wifi set Warning flag: associating to network
[14:00:07][W][component:170]: Component dht.sensor cleared Warning flag
[14:00:08][I][wifi:617]: WiFi Connected!
[14:00:08][W][component:157]: Component mqtt set Warning flag: unspecified
[14:00:08][I][mqtt:250]: Connecting to MQTT...
[14:00:08][W][component:170]: Component wifi cleared Warning flag
[14:00:08][W][component:170]: Component mqtt cleared Warning flag
[14:00:08][I][mqtt:291]: MQTT Connected!
[14:00:08][I][app:062]: setup() finished successfully!
[14:00:08][I][app:100]: ESPHome version 2024.11.3 compiled on Dec 10 2024, 13:57:34
[14:00:08][I][app:102]: Project esphome.web version dev
[14:00:08][I][deep_sleep:060]: Beginning Deep Sleep
[14:00:08][I][deep_sleep:062]: Sleeping for 9000000us
[14:00:08][W][wifi_esp8266:513]: Event: Disconnected ssid...