From f97d5189e9c76f73761b881d1223a46f3b7fbcea Mon Sep 17 00:00:00 2001 From: Bob Igo Date: Tue, 13 Feb 2018 11:10:53 -0500 Subject: [PATCH] Provide an example of how to make a 'when dark' condition by ORing sunrise and sunset conditions. (#4652) See issue#12308 at https://github.com/home-assistant/home-assistant/issues/12308 --- source/_docs/scripts/conditions.markdown | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/source/_docs/scripts/conditions.markdown b/source/_docs/scripts/conditions.markdown index 167b2737649..d2dc0638d80 100644 --- a/source/_docs/scripts/conditions.markdown +++ b/source/_docs/scripts/conditions.markdown @@ -114,6 +114,16 @@ condition: after_offset: "-1:00:00" ``` +```yaml +condition: + condition: or # 'when dark' condition: either after sunset or before sunrise + conditions: + - condition: sun + after: sunset + - condition: sun + before: sunrise +``` + Here is a truth table to clarify the parameters with and without offset: | command | night | at sunrise | daytime | at sunset |