Trigger automation 10 minutes before sensor.sunrise_time sensor

I need help setting up this simple automation where I’ll get a notification 10 minutes before sunrise time sensor. Since this sensor keeps changing everyday I need a template for this automation. What’s the best way to achieve this?

1 Like
alias: Notify before sunrise
  description: ''
  trigger:
  - platform: sun
    event: sunrise
    offset: '-10'

should do…

1 Like

Thank you so much! I was using Sunset sensor as an example. I don’t think this will work for sensor state, is there any way to do this for sensor state instead of event? Thanks in advance.

What kind of sensor state do you want to use it for, do you have an example?

I’d be surprised if you managed to get it going for, e.g. a door sensor for the state ‘open’ :grin:

haha it was actually prayer time sensor. Since Ramadan was coming up so I was thinking of setting up an automation where I’ll be getting notificatons 5-10 minutes before starting fast and breaking up fast. There’s a default prayer time integration in HA that consists of 5 different sensors for example ‘sensor.fajr_prayer’