Open Blinds Automatically When an Alexa Alarm Goes Off
- Andrea Leandri
- Jul 2
- 4 min read
Skill level: Beginner to Intermediate | Time to complete: 20-30 minutes
What you'll build: An automation that opens a room's blinds automatically the moment an Alexa morning alarm fires. The alarm sounds, the blinds rise, and the room does the rest.
The Idea
Alexa alarms are great for waking people up. Blinds opening to let in morning light are even better. Combined, they make for a genuinely pleasant start to the day.
The clever part is how it detects the alarm. Alexa exposes a sensor to Home Assistant called sensor.YOUR_ECHO_DEVICE_next_alarm, holding the timestamp of the next scheduled alarm on that specific Echo. The automation compares that timestamp to the current time every second, and the moment they match, it fires. This means the blinds open at exactly the alarm time - not a minute before, not a minute after.
Two conditions keep it sensible: it only runs before 11:00 (so a forgotten alarm later in the day doesn't open blinds at noon), and it only opens blinds that weren't already closed by the temperature-based blinds automation on this site.
How the Alarm Sensor Works
When you set an alarm on an Alexa device, the Alexa Media Player integration creates a sensor named sensor.XXXXXX_s_echo_dot_next_alarm. The value is an ISO 8601 timestamp representing when the next alarm fires. If no alarm is set, it shows unknown or unavailable.
The trigger template compares this value to now() every time it evaluates:
{{
states('sensor.XXXXXX_s_echo_dot_next_alarm') not in ['unknown', 'unavailable', '']
and as_timestamp(states('sensor.XXXXXX_s_echo_dot_next_alarm'), 0) | int
== now().timestamp() | int
}}not in ['unknown', 'unavailable', ''] skips evaluation if no alarm is set. | int on both sides converts timestamps to whole seconds, giving a clean one-second match window. Without this, floating-point timestamps would almost never match exactly.
Step 1: Find Your Echo's Alarm Sensor
Developer Tools → States → search next_alarm. You should see one sensor per Echo device. Set an alarm on the Echo now to confirm the sensor populates with a real timestamp. If it still shows unknown, check that Alexa Media Player is connected and consider setting scan_interval: 10 for that sensor in configuration.yaml as covered in the File Editor guide on this site.
Step 2: Create the Automation
Settings → Automations & Scenes → Create Automation → Edit in YAML:
alias: "XXXXXX's blinds - open at morning alarm"
description: |
Opens the blinds when the Alexa morning alarm fires on the bedroom Echo.
Only runs before 11:00 and only if blinds were not automatically closed
by the temperature automation.
triggers:
- trigger: template
value_template: |
{{
states('sensor.XXXXXX_s_echo_dot_next_alarm') not in ['unknown', 'unavailable', '']
and as_timestamp(states('sensor.XXXXXX_s_echo_dot_next_alarm'), 0) | int
== now().timestamp() | int
}}
conditions:
# Only open blinds for morning alarms
- condition: template
value_template: |
{{ now().hour < 11 }}
# Only open if temperature automation hasn't closed them for heat reasons
- condition: state
entity_id: input_select.XXXXXX_blinds_auto_activated # your input_select
state:
- "No"
actions:
# Brief delay - lets the alarm actually start before the blinds begin moving
- delay:
seconds: 10
# Open the blinds
- action: cover.open_cover
target:
entity_id:
- cover.YOUR_LEFT_BLIND # replace with your blind entities
- cover.YOUR_RIGHT_BLIND
# Say good morning through the bedroom Echo
- action: notify.send_message
target:
entity_id: notify.XXXXXX_s_echo_dot_speak # your Echo speak entity
data:
message: "Good morning."
mode: singleCustomise It
Change the morning cut-off hour by adjusting now().hour < 11. Personalise the greeting with live data:
message: >
Good morning. It is {{ now().strftime('%-H:%M') }}.
Outside it is {{ states('sensor.temperature_0d') | round(1) }} degrees today.If you have not set up the temperature-based blinds automation and do not have the input_select helper, simply remove that condition entirely. For multiple rooms, duplicate the automation and replace the alarm sensor entity, blind entities, input_select, and Echo speak entity for each room.
Test It
Set an Alexa alarm 2-3 minutes from now. Go to Developer Tools → States and confirm the next_alarm sensor shows the correct timestamp. Wait for the alarm time and check that the blinds open. After it runs, check Settings → Automations → your automation → Traces to confirm the template trigger evaluated correctly.
Troubleshooting
Blinds don't open at alarm time: Check the next_alarm sensor in Developer Tools - if it shows unknown, the sensor isn't populating. Confirm Alexa Media Player is connected and the alarm is set on the correct Echo device.
Sensor populates but trigger never fires: The scan_interval may be too slow - set scan_interval: 10 for that sensor in configuration.yaml as covered in the File Editor guide on this site.
Automation fires but blinds were closed by temperature automation: The input_select condition is working correctly - it skips opening when the temperature automation has closed the blinds for heat reasons.
Echo doesn't speak the good morning message: Confirm the notify.XXXXXX_s_echo_dot_speak entity exists in Developer Tools. Test it manually in Developer Tools → Services first.
Guide written by a Home Assistant enthusiast in Utrecht. The best alarm is the one that opens the curtains for you.



Comments