Skip to content

Commit 5e33316

Browse files
committed
Add night mode example
1 parent 2ab7969 commit 5e33316

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

source/_components/frontend.markdown

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ There are 2 themes-related services:
4343

4444
Example in automation:
4545

46+
Set a theme at the startup of Home Assistant:
47+
4648
```yaml
4749
automation:
4850
- alias: 'Set theme at startup'
@@ -55,6 +57,22 @@ automation:
5557
data:
5658
name: happy
5759
```
60+
61+
To enable "night mode":
62+
63+
```yaml
64+
automation:
65+
- alias: 'Set dark theme for the night'
66+
initial_state: True
67+
trigger:
68+
- platform: time
69+
at: '21:00'
70+
action:
71+
- service: frontend.set_theme
72+
data:
73+
name: darkred
74+
```
75+
5876
### {% linkable_title Manual Theme Selection %}
5977

6078
When themes are enabled in the `configuration.yaml` file, a new option will show up in the Configuration panel under `configuration.yaml` called "Set a theme." You can then choose any installed theme from the dropdown list and it will be applied immediately.

0 commit comments

Comments
 (0)