We are working on a pet door design. I’d like to include two closing obstacle sensors. One for a current based threshold sensor and another for an IR beam sensor.
Is there an easy way to have both sensors? Do I somehow have to have a binary sensor that ORs the two values together?
Personally I’d export the sensors separately and use a group in HA to combine them. But you could do the same in the esp using a template binary sensor:
My preference is to do things on the ESPHome side where possible.
binary_sensor:
#Someone is sitting? Sit dection using a multi-pronged approach.
- platform: template
id: someone_is_sitting
name: Someone Is Sitting
icon: "mdi:seat-recline-normal"
#Motion is detected, ToF is in range, keyboard drawer is open, desk height is in range
lambda: |-
return
id(desky_motion_detected_processed).state &&
id(desky_tof_seems_occupied).state &&
id(desky_keyboard_drawer_endstop).state &&
(id(desky_current_sit_stand_position).state == "Sitting")
;