Skip to content

Commit 6985e13

Browse files
committed
Casper Glow: add examples
Add examples and blueprints to documentation.
1 parent e0f173f commit 6985e13

4 files changed

Lines changed: 252 additions & 0 deletions

File tree

source/_integrations/casper_glow.markdown

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,95 @@ The **Casper Glow** {% term integration %} provides the following entities.
8282
- **Dimming time**
8383
- **Description**: Configures how long the dimming sequence lasts before the light turns off. You can choose between 15, 30, 45, 60, or 90 minutes. The new dimming time takes effect the next time the light is turned on.
8484

85+
## Examples
86+
87+
### Bedtime routine
88+
89+
Start a dimming sequence at a set time each night. This blueprint lets you pick your bedtime and how long the light takes to dim, so your Glow is ready when you are.
90+
91+
{% my blueprint_import badge blueprint_url="https://www.home-assistant.io/blueprints/integrations/casper_glow_bedtime_routine.yaml" %}
92+
93+
{% details "Example YAML" %}
94+
95+
```yaml
96+
triggers:
97+
- trigger: time
98+
at: "22:00:00"
99+
actions:
100+
- action: select.select_option
101+
target:
102+
entity_id: select.jar_dimming_time
103+
data:
104+
option: "30"
105+
- action: light.turn_on
106+
target:
107+
entity_id: light.jar
108+
```
109+
{% enddetails %}
110+
111+
### Pause on motion
112+
113+
Keep the light from dimming while you're still up. This blueprint pauses the dimming sequence whenever motion is detected, so the light holds its brightness until you settle in.
114+
115+
{% my blueprint_import badge blueprint_url="https://www.home-assistant.io/blueprints/integrations/casper_glow_pause_on_motion.yaml" %}
116+
117+
{% details "Example YAML" %}
118+
```yaml
119+
triggers:
120+
- trigger: state
121+
entity_id: binary_sensor.bedroom_motion
122+
to: "on"
123+
conditions:
124+
- condition: state
125+
entity_id: light.jar
126+
state: "on"
127+
actions:
128+
- action: casper_glow.pause
129+
target:
130+
entity_id: light.jar
131+
```
132+
{% enddetails %}
133+
134+
### Turn on and hold at nightlight level
135+
136+
Turn on the Glow and let it dim down to a soft nightlight, then hold it there. This blueprint starts the dimming sequence and automatically pauses it when a set number of minutes remain, leaving a gentle glow in the room through the night.
137+
138+
{% my blueprint_import badge blueprint_url="https://www.home-assistant.io/blueprints/integrations/casper_glow_turn_on_pause_nightlight.yaml" %}
139+
140+
{% details "Example YAML" %}
141+
{% raw %}
142+
```yaml
143+
triggers:
144+
- trigger: time
145+
at: "22:00:00"
146+
actions:
147+
- action: select.select_option
148+
target:
149+
entity_id: select.jar_dimming_time
150+
data:
151+
option: "30"
152+
- action: light.turn_on
153+
target:
154+
entity_id: light.jar
155+
- wait_for_trigger:
156+
- trigger: template
157+
value_template: >-
158+
{% set end = states('sensor.jar_dimming_end_time') | as_datetime %}
159+
{% if end is not none %}
160+
{{ ((end - now()).total_seconds() / 60) | round(0) <= 10 }}
161+
{% else %}
162+
false
163+
{% endif %}
164+
timeout:
165+
minutes: 30
166+
continue_on_timeout: false
167+
- action: button.press
168+
target:
169+
entity_id: button.jar_pause
170+
```
171+
{% endraw %}
172+
{% enddetails %}
173+
85174
## Data updates
86175
87176
The **Casper Glow** {% term integration %} detects the device through passive Bluetooth advertisements. All state updates are retrieved by actively {% term polling %} the device every 30 seconds — for example, to detect changes made directly on the light or through the Casper app.
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
blueprint:
2+
name: "Bedtime Casper Glow routine"
3+
description: "Turns on the Casper Glow at a set time with a configured dimming duration for bedtime."
4+
domain: automation
5+
input:
6+
bedtime:
7+
name: Bedtime
8+
selector:
9+
time:
10+
glow_device:
11+
name: Casper Glow
12+
selector:
13+
device:
14+
filter:
15+
- integration: casper_glow
16+
dimming_minutes:
17+
name: Dimming duration
18+
default: "30"
19+
selector:
20+
select:
21+
options:
22+
- "15"
23+
- "30"
24+
- "45"
25+
- "60"
26+
- "90"
27+
variables:
28+
glow_device: !input glow_device
29+
triggers:
30+
- trigger: time
31+
at: !input bedtime
32+
actions:
33+
- action: select.select_option
34+
target:
35+
entity_id: >
36+
{{ device_entities(glow_device)
37+
| select('match', 'select\\..*')
38+
| first }}
39+
data:
40+
option: !input dimming_minutes
41+
- action: light.turn_on
42+
target:
43+
entity_id: >
44+
{{ device_entities(glow_device)
45+
| select('match', 'light\\..*')
46+
| first }}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
blueprint:
2+
name: "Pause Casper Glow on motion"
3+
description: "Pauses the Casper Glow dimming sequence when motion is detected in the room."
4+
domain: automation
5+
input:
6+
motion_sensor:
7+
name: Motion sensor
8+
selector:
9+
entity:
10+
domain: binary_sensor
11+
device_class: motion
12+
glow_light:
13+
name: Casper Glow light
14+
selector:
15+
entity:
16+
filter:
17+
integration: casper_glow
18+
domain: light
19+
variables:
20+
glow_light: !input glow_light
21+
pause_button: >
22+
{{ device_entities(device_id(glow_light))
23+
| select('match', 'button\\.')
24+
| select('search', 'pause')
25+
| first }}
26+
triggers:
27+
- trigger: state
28+
entity_id: !input motion_sensor
29+
to: "on"
30+
conditions:
31+
- condition: state
32+
entity_id: !input glow_light
33+
state: "on"
34+
actions:
35+
- action: button.press
36+
target:
37+
entity_id: "{{ pause_button }}"
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
blueprint:
2+
name: "Turn on Casper Glow and pause at nightlight level"
3+
description: "Turns on the Casper Glow at a set time, then pauses the dimming sequence when a specified number of minutes remain, holding the light at a dim nightlight level. Requires the Dimming End Time sensor to be enabled."
4+
domain: automation
5+
input:
6+
bedtime:
7+
name: Turn-on time
8+
selector:
9+
time:
10+
glow_device:
11+
name: Casper Glow
12+
selector:
13+
device:
14+
filter:
15+
- integration: casper_glow
16+
dimming_minutes:
17+
name: Dimming duration
18+
default: "15"
19+
selector:
20+
select:
21+
options:
22+
- "15"
23+
- "30"
24+
- "45"
25+
- "60"
26+
- "90"
27+
pause_at_remaining:
28+
name: Pause when this many minutes remain
29+
default: 10
30+
selector:
31+
number:
32+
min: 1
33+
max: 89
34+
unit_of_measurement: min
35+
mode: restart
36+
variables:
37+
glow_device: !input glow_device
38+
dimming_minutes: !input dimming_minutes
39+
pause_at_remaining: !input pause_at_remaining
40+
light_entity: >
41+
{{ device_entities(glow_device) | select('match', 'light\\.') | first }}
42+
select_entity: >
43+
{{ device_entities(glow_device) | select('match', 'select\\.') | first }}
44+
pause_button: >
45+
{{ device_entities(glow_device)
46+
| select('match', 'button\\.')
47+
| select('search', 'pause')
48+
| first }}
49+
sensor_entity: >
50+
{{ device_entities(glow_device)
51+
| select('match', 'sensor\\.')
52+
| select('search', 'dimming_end_time')
53+
| first }}
54+
triggers:
55+
- trigger: time
56+
at: !input bedtime
57+
actions:
58+
- action: select.select_option
59+
target:
60+
entity_id: "{{ select_entity }}"
61+
data:
62+
option: !input dimming_minutes
63+
- action: light.turn_on
64+
target:
65+
entity_id: "{{ light_entity }}"
66+
- wait_for_trigger:
67+
- trigger: template
68+
value_template: >-
69+
{% set end = states(sensor_entity) | as_datetime %}
70+
{% if end is not none %}
71+
{{ ((end - now()).total_seconds() / 60) | round(0) <= pause_at_remaining | int }}
72+
{% else %}
73+
false
74+
{% endif %}
75+
timeout:
76+
minutes: "{{ dimming_minutes | int }}"
77+
continue_on_timeout: false
78+
- action: button.press
79+
target:
80+
entity_id: "{{ pause_button }}"

0 commit comments

Comments
 (0)