Hi everyone
I was hoping someone could point me in the right direction for something I am trying so achieve:
My sliding gate motor has a status LED output which I am measuring with an ESP that is configured with ESP Home. It provides pulses of 4.5 V which I run throug a voltage divider to bring it down to a safe voltage to use as a digital input on the ESP.
The output of the motor controller changes based on the status of the gate as follows:
- Continuous pulsing at about 1 pulse per second means the gate is busy opening
- Continuous pulsing at about 2 pulses per second means the gate is busy closing
- Intermittent flashes of 2 pulses every 2 seconds means the mains power is off - it goes: flash-flash-off, flash-flash-off, repeat
- Intermittent flashes of 3 pulses every 2 seconds means the battery is low (flash-flash-flash-off, repeat)
- No pulses means the gate is fully closed
- Continuous on means the gate is fully open
I have tried using the pulse meter to get numbers 1 and 2 to work but as soon as the gate starts to move the frequency of pulses that is reported fluctuates, starting at a high value and then briefly stabilizing just before the gate stops moving. My guess is that the sensor averages the pulses/min and only gets more accurate after receiving a large-ish number if pulses.
5 and 6 I can detect using a binary sensor with an on_off_delay filter that only shows a 1 or 0 once the pulses stop.
What Iâm trying to achieve is have one entity to show me the status of the gate at any given time based on conditions 1-6 above.
Any advice will be greatly appreciated.