Conditional Card settings

Hello automators,

I’m having issues thinking on a way of having a conditional card in my dashboard.

I currently have a motion sensor in my mailbox.

I would like to have a conditional card showing that I have mail only for the next 8hours of the detection of motion in the mailbox.

I am open for suggestions as this does not work

condition: state
entity: binary_sensor.mail_dome_occupancy
state: "on"
for:
  hours: 8
  minutes: 0
  seconds: 0

I would think you’d need to flip the sensor status with an automation after the 8 hr period has expired.

This would only become true after the motion sensor had been in a constant state of detection for 8 hours.

Perhaps the easiest approach would be to have an automation trigger on motion detected by this sensor that starts an 8 hour timer. Then your condition card is just if the timer is running.

conditions:
  - condition: state
    entity: timer.your_timer
    state: active