#Best way to for multiple contact sensors to be one logical door device? (+more entities)

1 messages · Page 1 of 1 (latest)

muted yew
#

I have an outside door with a contact sensor. Lately the door hasn’t been shutting all the way (stuck slightly open, hello drafts and bugs), but it’s closed enough that the sensor sees it as closed.

I've just placed a second contact sensor where it will not see the door as closed when it’s stuck. (This is great because it can unambiguously detect stuckness by comparing the two sensors, don’t have to think about “open too long” or anything.)

I’m aware that groups and template sensors can give me each individual piece I’m looking for, but I’m not sure the best way to get this looking like a single device (for dashboards, template sensors, etc)

Spec:

  • Single door device with multiple entities
  • Door shows open when EITHER sensor is open, closed when BOTH sensors are closed
  • Door has entity for stuckness (not/stuck)

Logically, the door can never be BOTH closed and stuck—stuck can only occur if the door is open

For the stuckness entity, I’m thinking just a template/binary/problem sensor, to show OK when “Fully Closed”?

Appreciate any thoughts/insight, thanks in advance 🙏

manic lotus
#

You could use a 3D printed distance buffer so it only detects when it's really closed or move the magnet. Depends a bit on your specific device.

edgy knoll
#

Hide the original sensor, add template for stuckness to the second?
Second sensor should already only show closed when fully closed

stray fractal
muted yew
#

OK @stray fractal , thanks for confirming that part. Going with what @edgy knoll said, it makes sense to keep the new sensor as the "real" door, and if I do this I can just forgo the Group integration entirely, because there's no real way for this to ever get into the wrong state

modern star
# muted yew I have an outside door with a contact sensor. Lately the door hasn’t been shutti...

I have a wooden front door with an outer security mesh door. This is my sensor.

    - name: "front_door_combined"
      unique_id: xxxxxxxxxxxxxxxxxxxxxxxxxxx
      state: >
        {% if states('binary_sensor.front_door') == 'on' and  states('binary_sensor.front_security_door') == 'on' %}Both_Open
        {% elif states('binary_sensor.front_door') == 'on' %}Inner_Partial
        {% elif states('binary_sensor.front_security_door') == 'on' %}Outer_Partial
        {% else %}Closed
        {% endif %}
      attributes:
        front_door: "{{ states('binary_sensor.front_door') }}"
        security_door: "{{states('binary_sensor.front_security_door')}}"```
#

The way I understand what you need this is how i'd do it.

    - name: "front_door_stuckness"
      unique_id: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
      state: >
        {% if states('binary_sensor.front_door') == 'on' and  states('binary_sensor.front_door_stuck') == 'on' %}Open
        {% elif states('binary_sensor.front_door_stuck') == 'on' %}Stuck!
        {% else %}Closed
        {% endif %}```
#

Also I intend to adopt 'stuckness' into daily usage.

muted yew