Missing pulse detector/watchdog/deadman's switch

Hi,

I’m new to ESPHome and am having fun making my Wayne Dalton ProDrive garage door opener smart. However, I can’t figure out how to deal with the electric eye sensor. The sensor input is low when the beam is broken and pulses high for 1ms every 5ms when intact. I’ve been trying binary_sensor with every combination of inverted:true/false and delayed_on/off/on_off, and the experimental results don’t make any sense to me. Is there a better way to do this? I really don’t want the sensor reporting status every pulse and filling up the log.

binary_sensor:
  - platform: gpio
    pin:
      number: D6
      mode: INPUT
      inverted: true
    name: "Beam Pulse"
    internal: true
    filters:
      - delayed_on: 10ms

Have a play with the Duty Cycle sensor. You can then use the values it presents (probably zero and some other value) as tests to determine the state.

Maybe a delta filter could be the go.

Or keep it simple with an automation using on_value_range:

1 Like

duty_cycle with delta works pretty well! I was worried that since the input flat lined that the duty cycle wouldn’t work, but it does. I still get tons of log messages. I assume I can get rid of these by turning off debug, but I’m not ready to turn off debug since I’m still debugging. These messages cause the messages I care about to scroll off. Is there a way to disable debug on this particular sensor?

[15:23:33][D][duty_cycle:041]: 'Garage Electric Eye' Got duty cycle=21.8%
[15:23:33][D][duty_cycle:041]: 'Garage Electric Eye' Got duty cycle=21.2%
[15:23:34][D][duty_cycle:041]: 'Garage Electric Eye' Got duty cycle=0.0%
[15:23:34][D][sensor:093]: 'Garage Electric Eye': Sending state 0.00000 % with 1 decimals of accuracy
[15:23:34][D][duty_cycle:041]: 'Garage Electric Eye' Got duty cycle=0.0%
[15:23:34][D][sensor:093]: 'Garage Electric Eye': Sending state 0.00000 % with 1 decimals of accuracy
[15:23:34][D][duty_cycle:041]: 'Garage Electric Eye' Got duty cycle=10.3%
[15:23:34][D][sensor:093]: 'Garage Electric Eye': Sending state 10.27111 % with 1 decimals of accuracy
[15:23:34][D][duty_cycle:041]: 'Garage Electric Eye' Got duty cycle=21.6%
[15:23:34][D][sensor:093]: 'Garage Electric Eye': Sending state 21.55715 % with 1 decimals of accuracy
[15:23:34][D][duty_cycle:041]: 'Garage Electric Eye' Got duty cycle=22.1%

Read the bit about logger tags:

Something like this will at least get rid of the duty_cycle: lines:

logger:
  level: DEBUG # or VERBOSE may be fine
  logs:
    duty_cycle: ERROR
1 Like