First Door Sensor to still show as activated until on Dashboard until second Door Sensor Triggered

I have two Door Sensors - One on the front of my mailbox and the other on the back door of the mailbox. What I would like to achieve is when the first Door Sensor is triggered (when mail is delivered) This stays active (Yellow Icon) on the dashboard. Until the second Door Sensor is triggered, changing the status back to inactive (Blue Icon) on the dashboard for Sensor 1. Indicating the waiting mail has been collected.

In short sensor 1 stays showing active in the dashboard, until sensor 2 is triggered. Resetting the status of sensor 1.

I am using Sonoff SNZB- 04 Door Sensors. I can get the open/close status on the dashboard for sensor 1, but this clears (returns Blue) as soon as sensor 1 closes. I can’t figure out how to incorporate Sensor 2 into this to make it work as I would like.

Rather than manipulating the output of your sensors, you could create an binary sensor helper called “Mail”. Then create an automation that turns Mail on when the front door opens and off when the back door opens.

1 Like

A trigger-based template sensor would work well here. Something like:

template:
  - trigger:
      - platform: state
        entity_id: binary_sensor.mailbox_front_door
        to: "on"
        id: "on"
      - platform: state
        entity_id: binary_sensor.mailbox_back_door
        to: "on"
        id: "off"
    binary_sensor:
      name: mailbox_full
      state: "{{ trigger.id }}"    
1 Like