Trigger: Sunset/Sunrise
This trigger will fire at sunrise or sunset for the chosen location. The exact sunrise and sunset times are calculated based on your configured location and automatically adjust throughout the year.
Options
- Sunrise/Sunset: Choose whether to trigger at sunrise or sunset
- Time Adjustment: Configure when the trigger fires relative to the actual sunrise/sunset time:
- Trigger at exact time: Fire exactly at sunrise/sunset
- Trigger in advance: Fire before sunrise/sunset by a specified amount (up to 23 hours and 59 minutes)
- Trigger after delay: Fire after sunrise/sunset by a specified amount (up to 23 hours and 59 minutes)
- Use Alarm Clock Mode: When enabled, ensures the trigger fires reliably even in Doze mode (recommended for time-critical actions)
- Location: Set the location used to calculate sunrise/sunset times (configured via MacroDroid settings)
Configuration
On first use, you will be prompted to set a location for sunrise/sunset calculations. This location is shared across all Sunset/Sunrise triggers and can be changed later in MacroDroid settings.
The trigger automatically reschedules itself when:
- The device's time zone changes
- The system time is manually adjusted
- The previous scheduled trigger fires
Examples
Triggers Sunset/Sunrise: Sunrise (-30m)
Actions Set Volume - Media: 3 Speak Text: Good morning, the sun will rise in 30 minutes
Constraints Day of Week: Monday, Tuesday, Wednesday, Thursday, Friday
Wake up routine that triggers 30 minutes before sunrise on weekdays.
Triggers Sunset/Sunrise: Sunset
Actions Send Intent: Turn on outdoor lights (to third party app) Set Brightness: 50%
Automatically turn on outdoor lights at sunset.
Notes
- The location for sunrise/sunset calculations must be set before using this trigger. The location can be changed later in MacroDroid settings.
- Times are calculated using the official sunrise/sunset times (when the sun's upper edge touches the horizon).
- The trigger responds to timezone changes and will automatically reschedule.
- This trigger requires the Schedule Exact Alarms permission on Android 12 and above.
- The time adjustment can be useful for triggering actions during twilight periods (e.g., 30 minutes before sunset for "golden hour" photography alerts).
See Also