Update README.md

This commit is contained in:
2026-01-12 10:10:14 -08:00
parent 90826e4a49
commit 85a6968bcc

View File

@@ -1,9 +1,8 @@
# HomeAssistant SunriseAlarm
# Home-Assistant Sunrise Alarm
_Turn your smart lights into a natural alarm clock_
This project is made up of two blueprints
- `sunrise-simulation.yaml`: This script turns any compatible light (or group of lights) into a softsunrise / sunset alarm. It gradually ramps the brightness and the colour temperature over a userdefined period.
- `sunrise-simulation.yaml`: This script turns any compatible light (or group of lights) into a soft-sunrise / sunset alarm. It gradually ramps the brightness and the colour temperature over a user-defined period.
- `sunrise-alarm.yaml`: Thin wrapper that calls the simulation script when the alarm occurs (or some configured time before/after).
---
@@ -11,43 +10,43 @@ This project is made up of two blueprints
| Component | Purpose | What it does |
|-----------|---------|--------------|
| **sunrisesimulation** (script) | The “engine” that gradually lights up (or down) your bulbs | Uses a `repeat` loop to turn the selected lights on/off and slowly increase/decrease brightness over a configurable time span. The brightness and color curves can be configured to create more natural-looking sunrises. |
| **sunrisealarm** (automation) | The “scheduler” that calls the simulation at a chosen time | Triggers the script at *AlarmTime Offset* (e.g. 30min before the clock). An `input_boolean` lets you switch the alarm on/off. |
| **sunrise-simulation** (script) | The “engine” that gradually lights up (or down) your bulbs | Uses a `repeat` loop to turn the selected lights on/off and slowly increase/decrease brightness over a configurable time span. The brightness and color curves can be configured to create more natural-looking sunrises. |
| **sunrise-alarm** (automation) | The “scheduler” that calls the simulation at a chosen time | Triggers the script at *Alarm Time - Offset* (e.g. 30min before the clock). An `input_boolean` lets you switch the alarm on/off. |
> [!NOTE]
> **Why two separate blueprints?**
> The simulation can be reused in any scenario (e.g. a “morning routine” or a “sunsetin30min” routine). The alarm automation is a thin wrapper that turns that simulation into a timed alarm.
> The simulation can be reused in any scenario (e.g. a “morning routine” or a “sunset-in-30-min” routine). The alarm automation is a thin wrapper that turns that simulation into a timed alarm.
---
## Installation
### sunrisesimulation
### sunrise-simulation
1. **Import the sunrise script blueprint**
<div>
<a href="https://my.home-assistant.io/redirect/blueprint_import/?blueprint_url=https://git.jaroszew.ski/patrick/ha-sunrise-alarm/raw/branch/main/sunrise-simulation.yaml">
<img src="https://my.home-assistant.io/badges/blueprint_import.svg" alt="Import sunrisesimulation">
<img src="https://my.home-assistant.io/badges/blueprint_import.svg" alt="Import sunrise-simulation">
</a>
</div>
2. **Create a script from the blueprint**
* In the “Create new script” dialog, name it **`sunrise-simulation`** (you can give any name you like).
* Youll be asked for a handful of variables see section3.1 for the defaults and meaning.
* Click **Create** HomeAssistant will add a script entity called `script.sunrise-simulation` (or whatever name you gave it).
* You'll be asked for a handful of variables - see section 3.1 for the defaults and meaning.
* Click **Create** - Home-Assistant will add a script entity called `script.sunrise-simulation` (or whatever name you gave it).
---
### sunrisealarm
### sunrise-alarm
1. **Import the alarm automation blueprint**
<div>
<a href="https://my.home-assistant.io/redirect/blueprint_import/?blueprint_url=https://git.jaroszew.ski/patrick/ha-sunrise-alarm/raw/branch/main/sunrise-alarm.yaml">
<img src="https://my.home-assistant.io/badges/blueprint_import.svg" alt="Import sunrisealarm">
<img src="https://my.home-assistant.io/badges/blueprint_import.svg" alt="Import sunrise-alarm">
</a>
</div>
@@ -56,17 +55,17 @@ This project is made up of two blueprints
* Pick an `input_datetime` that represents the clock you want to use as the alarm.
* Pick an `input_boolean` that toggles the alarm on or off.
* Choose an `offest_duration` for how long before/after to start the sunrise arc relative to the alarm time. You'll usually want this to be the same as `duration` defined in the previous script, this time _negative_, so that the peak (end) of the arc aligns with the alarm time.
* Choose the `sunrisesimulation` script you created in the previous step for the `alarm_script` field.
* Save you now have a readytorun alarm!
* Choose the `sunrise-simulation` script you created in the previous step for the `alarm_script` field.
* Save - you now have a ready-to-run alarm!
> **Tip** If you want a *sunset* alarm, simply copy the `sunrisesimulation` script (or create a new script from the blueprint if you want to define a different arc) and reverse it by setting direction with the `reversed` flag set to `true`. You'll also want to create a new automation that calls it with a negative `offset_duration`.
> **Tip** If you want a *sunset* alarm, simply copy the `sunrise-simulation` script (or create a new script from the blueprint if you want to define a different arc) and reverse it by setting direction with the `reversed` flag set to `true`. You'll also want to create a new automation that calls it with a negative `offset_duration`.
---
## Configurable variables
### sunrisesimulation script variables
### sunrise-simulation script variables
| Variable | Type | Default | Description |
|----------|------|---------|-------------|
@@ -81,7 +80,7 @@ This project is made up of two blueprints
| `curve_type` | string | `sigmoid` | `linear`, `parabolic` (quadratic), or `sigmoid` (an S-curve). As we don't perceive light intensity linearly, `sigmoid` or `parabolic` make for a more natural curve.
###sunrisealarm automation variables
### sunrise-alarm automation variables
| Variable | Type | Default | Description |
|----------|------|---------|-------------|
@@ -92,9 +91,9 @@ This project is made up of two blueprints
The automation uses the following logic:
1. `AlarmTime Offset` fires the automation.
2. If `AlarmEnabled` is `on`, it calls the sunrise script.
3. If `AlarmEnabled` is `off`, nothing happens.
1. `Alarm Time - Offset` fires the automation.
2. If `Alarm Enabled` is `on`, it calls the sunrise script.
3. If `Alarm Enabled` is `off`, nothing happens.
> [!WARNING]
> You may not be able to set negative duration values via the user interface. If so, you'll need to edit the YAML directly.