My front gates have SCS Sentinel Opengate motor on them. I fed a signal that normally opens an electric lock to a Shelly input (configured as a detached switch). That signal on the Shelly goes “on” for 2 seconds only when the gate is opening so it can serve as a way to monitor open/closed state.
I had everything working (cover template with open/close states based on a derivative sensor) on a Raspberry Pi docker until the docker just disappeared for the sd card. Probably some corruption. I have been struggling to get is back up and running for days on my new proxmox mini-pc now. Anyway: I need a binary sensor that stays on even after the 2 second input pulse has vanished.
This works:
template:
- trigger:
- platform: state
entity_id: binary_sensor.shegategarage_input
to: "on"
binary_sensor:
name: gategaragestate
state: "on"
But I need this to refresh at every motor movement, however this does not work:
template:
- trigger:
- platform: state
entity_id: switch.shegategarage
to: "off"
binary_sensor:
name: gategaragestate
state: >
{% if is_state("binary_sensor.shegategarage_input", "on") %}
"on"
{% else %}
"off"
{% endif %}
BTW: The shegategarage switch is on for 1 second only, as the gate is triggered by pulses. The trigger is set on the off slope of the pulse, as after that second delay the lock open signal (read as shegategarageinput) is still high.
The image shows that when shegategarage goes off, shegategarage_input is still on for 1 sec, so it should evaluate to “on”.