I have this automation for my doorbell.
The script.doorbell
is firing fine, but it seems like when pressing the physical button attached the binary sensor it stays in state on
for 30% of my tests.
EDIT: I use the LILYGO® TTGO T-Camera ESP32 WROVER, which has a physical button soldered to the PCB, to which I have soldered wires to extend the switch to my physical doorbell button on the wall.
When short-cutting the wires the effect of pushing the button, both on the PCB and on my wall, is triggered. This works great. Somehow the state of the binary_sensor.doorbell_button
gets stuck in its on
state once in awhile.
How can I prevent that? Can I set the value to off
at the end of the automation?
Also it seems I must push the physical button for quite a long time, like push, hold, let go (fractional seconds of course) and not as one would expect; push, let go.
Would the new mode: single
have something to do here?
automation:
- alias: Doorbell
trigger:
- platform: state
entity_id: binary_sensor.doorbell_button
to: 'on'
mode: single
action:
- service: script.doorbell
- service: notify.notify
data:
title: Main door
message: Who rang?
data:
attachment:
content-type: jpeg
push:
category: camera
entity_id: camera.ringeapparat_camera
- delay: ## the delay of 10 seconds, prevents this automation from being ran more often than only once every 10 seconds.
seconds: 10