Hi There ,
I have a D1 Mini connected to a Ultrasonic distance measurement in my oil tank to check my oil level. as the tank is at a distance from the house I need it to run on batteries.
I have a following yaml
esphome:
name: test
platform: ESP8266
board: d1_mini
wifi:
ssid: "XXXXXXX"
password: "XXXXXXXXX"
mqtt:
broker: 192.168.1.XX
username: XX
password: XX
# Enable logging
logger:
# Enable Home Assistant API
#api:
# password: "1234"
ota:
password: "1234"
binary_sensor:
- platform: status
name: US Status
sensor:
- platform: ultrasonic
trigger_pin: D1
echo_pin: D2
update_interval: 5s
name: "Ultrasonic Sensor"
id: us01
deep_sleep:
run_duration: 40s
sleep_duration: 60s
Log reads
[12:08:09][C][wifi:372]: WiFi:
[12:08:09][C][wifi:254]: SSID: [redacted]
[12:08:09][C][wifi:255]: IP Address: 192.168.1.11
[12:08:09][C][wifi:257]: BSSID: [redacted]
[12:08:09][C][wifi:258]: Hostname: ‘test’
[12:08:09][C][wifi:262]: Signal strength: -49 dB ▂▄▆█
[12:08:09][C][wifi:263]: Channel: 4
[12:08:09][C][wifi:264]: Subnet: 255.255.255.0
[12:08:09][C][wifi:265]: Gateway: 192.168.1.1
[12:08:09][C][wifi:266]: DNS1: 192.168.1.1
[12:08:09][C][wifi:267]: DNS2: 0.0.0.0
[12:08:09][C][logger:137]: Logger:
[12:08:09][C][logger:138]: Level: DEBUG
[12:08:09][C][logger:139]: Log Baud Rate: 115200
[12:08:09][C][logger:140]: Hardware UART: UART0
[12:08:09][C][status:034]: Status Binary Sensor ‘US Status’
[12:08:09][C][status:034]: Device Class: ‘connectivity’
[12:08:09][C][ultrasonic.sensor:035]: Ultrasonic Sensor ‘Ultrasonic Sensor’
[12:08:09][C][ultrasonic.sensor:035]: Unit of Measurement: ‘m’
[12:08:09][C][ultrasonic.sensor:035]: Accuracy Decimals: 2
[12:08:09][C][ultrasonic.sensor:035]: Icon: ‘mdi:arrow-expand-vertical’
[12:08:09][C][ultrasonic.sensor:036]: Echo Pin: GPIO4 (Mode: INPUT)
[12:08:09][C][ultrasonic.sensor:037]: Trigger Pin: GPIO5 (Mode: OUTPUT)
[12:08:09][C][ultrasonic.sensor:038]: Pulse time: 10 µs
[12:08:09][C][ultrasonic.sensor:039]: Timeout: 11661 µs
[12:08:09][C][ultrasonic.sensor:040]: Update Interval: 5.0s
[12:08:09][C][ota:029]: Over-The-Air Updates:
[12:08:09][C][ota:030]: Address: test.local:8266
[12:08:09][C][ota:032]: Using Password.
[12:08:09][C][mqtt:051]: MQTT:
[12:08:09][C][mqtt:053]: Server Address: 192.168.1.XX:1883 (192.168.1.XX)
[12:08:09][C][mqtt:054]: Username: [redacted]
[12:08:09][C][mqtt:055]: Client ID: [redacted]
[12:08:09][C][mqtt:057]: Discovery prefix: ‘homeassistant’
[12:08:09][C][mqtt:058]: Discovery retain: YES
[12:08:09][C][mqtt:060]: Topic Prefix: ‘test’
[12:08:09][C][mqtt:062]: Log Topic: ‘test/debug’
[12:08:09][C][mqtt:065]: Availability: ‘test/status’
[12:08:09][C][mqtt.binary_sensor:018]: MQTT Binary Sensor ‘US Status’:
[12:08:09][C][mqtt.binary_sensor:019]: State Topic: ‘test/status’
[12:08:09][C][mqtt.sensor:024]: MQTT Sensor ‘Ultrasonic Sensor’:
[12:08:09][C][mqtt.sensor:028]: State Topic: ‘test/sensor/ultrasonic_sensor/state’
[12:08:09][C][deep_sleep:020]: Setting up Deep Sleep…
[12:08:09][C][deep_sleep:023]: Sleep Duration: 60000 ms
[12:08:09][C][deep_sleep:026]: Run Duration: 40000 ms
[12:08:11][D][sensor:092]: ‘Ultrasonic Sensor’: Sending state 0.04768 m with 2 decimals of accuracy
[12:08:11][D][ultrasonic.sensor:030]: ‘Ultrasonic Sensor’ - Got distance: 0.05 m
[12:08:11][D][sensor:092]: ‘Ultrasonic Sensor’: Sending state 0.04768 m with 2 decimals of accuracy
[12:08:16][D][sensor:092]: ‘Ultrasonic Sensor’: Sending state 0.04305 m with 2 decimals of accuracy
[12:08:16][D][ultrasonic.sensor:030]: ‘Ultrasonic Sensor’ - Got distance: 0.04 m
[12:08:16][D][sensor:092]: ‘Ultrasonic Sensor’: Sending state 0.04305 m with 2 decimals of accuracy
[12:08:21][D][sensor:092]: ‘Ultrasonic Sensor’: Sending state 0.04305 m with 2 decimals of accuracy
[12:08:21][D][ultrasonic.sensor:030]: ‘Ultrasonic Sensor’ - Got distance: 0.04 m
[12:08:21][D][sensor:092]: ‘Ultrasonic Sensor’: Sending state 0.04305 m with 2 decimals of accuracy
[12:08:26][D][sensor:092]: ‘Ultrasonic Sensor’: Sending state 0.04270 m with 2 decimals of accuracy
[12:08:26][D][ultrasonic.sensor:030]: ‘Ultrasonic Sensor’ - Got distance: 0.04 m
[12:08:26][D][sensor:092]: ‘Ultrasonic Sensor’: Sending state 0.04270 m with 2 decimals of accuracy
[12:08:31][D][sensor:092]: ‘Ultrasonic Sensor’: Sending state 0.04305 m with 2 decimals of accuracy
[12:08:31][D][ultrasonic.sensor:030]: ‘Ultrasonic Sensor’ - Got distance: 0.04 m
[12:08:31][D][sensor:092]: ‘Ultrasonic Sensor’: Sending state 0.04305 m with 2 decimals of accuracy
[12:08:36][D][sensor:092]: ‘Ultrasonic Sensor’: Sending state 0.04305 m with 2 decimals of accuracy
[12:08:36][D][ultrasonic.sensor:030]: ‘Ultrasonic Sensor’ - Got distance: 0.04 m
[12:08:36][D][sensor:092]: ‘Ultrasonic Sensor’: Sending state 0.04305 m with 2 decimals of accuracy
[12:08:41][D][sensor:092]: ‘Ultrasonic Sensor’: Sending state 0.04305 m with 2 decimals of accuracy
[12:08:41][D][ultrasonic.sensor:030]: ‘Ultrasonic Sensor’ - Got distance: 0.04 m
[12:08:41][D][sensor:092]: ‘Ultrasonic Sensor’: Sending state 0.04305 m with 2 decimals of accuracy
[12:08:46][D][sensor:092]: ‘Ultrasonic Sensor’: Sending state 0.04305 m with 2 decimals of accuracy
[12:08:46][D][ultrasonic.sensor:030]: ‘Ultrasonic Sensor’ - Got distance: 0.04 m
[12:08:46][D][sensor:092]: ‘Ultrasonic Sensor’: Sending state 0.04305 m with 2 decimals of accuracy
[12:08:49][I][deep_sleep:067]: Beginning Deep Sleep
problem is that after entering Deep sleep it does not wake up
D1 mini RST is connected to GPIO16
anything I am not getting right ???
Thank you in advance