Hi,
I am working on a gate sensor using simple magnetic sensor with one wire connected to GPIO and the other one to ground - it works great with connected to power. But the whole point of that thing is to be running of a battery monitoring garden gate.
The config is simple:
binary_sensor:
#Reed sensor
- platform: gpio
pin:
number: 18
mode: INPUT_PULLUP
name: "Garden Gate"
device_class: door
deep_sleep:
id: deep_sleep_gate
run_duration: 180s
sleep_duration: 10min
wakeup_pin:
number: 18
mqtt:
broker: ip_address
username: mqtt_user
password: mqtt_password
please ignore the run and sleep duration times as they are set for testing.
The main issue is that without mqtt it takes about 20-25 seconds for the device to wake up and report the status.
That is why I have added MQTT - that is much more responsive and within 5 seconds after wakeup it reports the door open - however when it goes to sleep the “Garden Gate” sensor status is being reported by mqtt as unavailable. Is there a way to change that so it reports the last known status?
Thanks