How to set alert to send notifications at certain times day?

Hello! I need to set up a motion detector in back room and have it send notifications once an hour if any motion is detected. The thing is, I’d like to have it do so after business hours since people go through there quite a bit. All I have now is this section in my configuration.yaml :

    name: Back Room Motion
    entity_id: motion.detector
    state: 'on'
    skip_first: false
    repeat: 60
    message: "Motion detected in Back Room"
      - notify.myemail

Is there a good way to achieve this with alert or should I play around with automations?

Alerts don’t work like this. Your notification will only be sent once motion is detected, it will not be repeated.
The alert will be repeated as long as motion.detector is ‘on’. But the motion.detector changes back to ‘off’ once there is no more motion, so the alert will not be repeated.

May I ask why you want a repeating notification every hour when there was motion?

There are people who work a little after closing time and frequently pass through that area, so I thought that having the notification only be once an hour.

I don’t understand. What is the use case for this? Do you want every hour to receive a notification if there was motion within the last hour?

Sorry that I wasn’t clear, but yes, that is exactly what I’m aiming for. I’d like to have this setup so I can know if there is anyone in that back room after hours, since there is some sensitive equipment back there.

I think you can do it two ways…

either with an automation…

  • I use this right now to get alerts that my garage door is open. you can set a time condition to only have it run at certain times.

…or with a template sensor in the alert instead of your motion detector

  • you could use the motion detector to change the state of a template sensor but only during certain times. I’ve never used it or even tried it but I can imagine it shouldn’t be too hard.

But you don’t need a repeating notification right?
You simply want a notification when there is motion after normal business hours, correct? Then I would go with an automation that only runs after business hours and sends a notification if there is motion.

Yeah, I think that I’ll stick with this solution. Thank you!