From 71ab7f941cb0fc20af55dd6a2778c56f401a4bb0 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Tue, 22 Aug 2017 08:02:09 +0200 Subject: [PATCH] Add night mode example --- source/_components/frontend.markdown | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/source/_components/frontend.markdown b/source/_components/frontend.markdown index d04a20945e3..34e9021ea3b 100644 --- a/source/_components/frontend.markdown +++ b/source/_components/frontend.markdown @@ -43,6 +43,8 @@ There are 2 themes-related services: Example in automation: +Set a theme at the startup of Home Assistant: + ```yaml automation: - alias: 'Set theme at startup' @@ -55,6 +57,22 @@ automation: data: name: happy ``` + +To enable "night mode": + +```yaml +automation: + - alias: 'Set dark theme for the night' + initial_state: True + trigger: + - platform: time + at: '21:00' + action: + - service: frontend.set_theme + data: + name: darkred +``` + ### {% linkable_title Manual Theme Selection %} 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.