Configuring a Conditional Card

I have a Hue motion sensor in my letterbox, and it correctly detects motion and the binary_sensor.mailbox_pir_motion goes from off to on for ~15 seconds (then back to off) within HA.

I would like to …

  1. create a Conditional Card within my Lovelace dashboard when it is activated for the first time each day informing me that “Mail has been delivered”
  2. make the same Conditional Card disappear when it is activated for the second time each day (ie when the mail has been removed)
  3. create a HA “alert” the first time it is activated each day which would come through to my iPhone / Apple Watch.

I do have a couple of other Conditional Cards which work fine, but I can’t work out how to do this one. Any hints or tips would be gratefully received.


i would try:

1 Like

Thanks @tomdudu38 ; at the risk of asking too much, might you give me a bit of a steer as to how I would do that? Would it be within a Conditional Card, an Automation, Scene or Script - or something else? Whilst I do have a load of devices, entities & automations, I have tended to stick with the GUI set up so far … but am always game to learn more. :grinning:


  • create a dummy number ----->( configuration/ helpers in UI)
  • automation1:
    pir_motion -----> set number value (+1) & send alerte
#how to set a number +1
{{states('number.dummynumber')  | int +1 }}

  • automation2:
    number = 2 -------> set number to 0
  • card: condition: number =1 (conditonnal card)

Thank you SO much @tomdudu38 - with your help I have been able to do just what I wanted :grinning:. Thank you so much for taking the time to show me how!