Alerts Help

Please look at this and tell me what I'm doing wrong.

I have an automation setup that notifies me when a package is delivered but it's only one time per lid opening. I'm trying to make an alert that repeats every few minutes.

This is in the alerts.yaml in Studio Code Server

package_box:
  name: Package box is open
  message: lid open
  done_message: clear_notification
  entity_id: gate_package_box_door_1
  state: "on"
  repeat: 3
  can_acknowledge: true
  skip_first: false
  notifiers:
    - SM-N960U
  data:
    tag: package-```

Shouldnt it be:

entity_id: sensor.gate_package_box_door_1

And is the sensor 'on' all the time? Or just once.
If the latter is the case then set a template binary sensor to 'on' as soon as the door has opened once.
Make the notification actionable so you can set the binary sensor off as soon as you emptied the box.

It is on just once per lid opening. I'm using this as the sensor: Smart WiFi Garage Door Opener Remote Controller, Smartphone App Control, Compatible with Alexa, Google Assistant and IFTTT, No Hub Required - Amazon.com

I added "sensor." in the entity_id as you said to. I get the id by going to the device and clicking the gear icon then copy the id, is that the way to do it ?

Yes, but you need to make sure you pick up the domain part. The best way to do it is to use the little "copy" button at the right hand side of the box that looks like two pieces of paper:

image

Most door/window sensors are going to have binary_sensor as their domain.

Understood, thanks

I got it working, I did the copy entity and I changed the notifiers for the cell phone app. Now it works !! Note that I got tired of walking out to the package box and lifting the lid so to test, I used the den lantern ID.

Thanks for the help !!

package_box:
  name: package box is open
  message: lid open
  done_message: clear_notification
  entity_id: light.den_lantern_light
  state: "on"
  repeat: 3
  can_acknowledge: true
  skip_first: false
  notifiers:
    - mobile_app_sm_n960u

You can set the state directly in Developer tools when testing. This will be reverted to the real device state when the device next checks in. Useful if you don't wanna keep walking back & forth :wink: