From a54974412751c98dec78b5e3977afc4a97aadea9 Mon Sep 17 00:00:00 2001 From: makefu Date: Wed, 18 Nov 2020 20:50:43 +0100 Subject: ma bureautomation: move to 20.09 style imports --- .../bureautomation/automation/nachtlicht.nix | 71 +++++++++++----------- 1 file changed, 37 insertions(+), 34 deletions(-) (limited to 'makefu/2configs/bureautomation/automation/nachtlicht.nix') diff --git a/makefu/2configs/bureautomation/automation/nachtlicht.nix b/makefu/2configs/bureautomation/automation/nachtlicht.nix index ec6fa20c7..ade89418d 100644 --- a/makefu/2configs/bureautomation/automation/nachtlicht.nix +++ b/makefu/2configs/bureautomation/automation/nachtlicht.nix @@ -1,35 +1,38 @@ -[ - # TODO: trigger if it is before dusk and somebody arives but nachtlichter are - # off from last day - # TODO: do not have nachtlicht turned on at night - { - alias = "Turn on Nachtlicht at dusk"; # when it gets dim - trigger = - { platform = "numeric_state"; - entity_id = "sun.sun"; - value_template = "{{ state.attributes.elevation }}"; - below = 10; +{ + services.home-assistant.config.automation = + [ + # TODO: trigger if it is before dusk and somebody arives but nachtlichter are + # off from last day + # TODO: do not have nachtlicht turned on at night + { + alias = "Turn on Nachtlicht at dusk"; # when it gets dim + trigger = + { platform = "numeric_state"; + entity_id = "sun.sun"; + value_template = "{{ state.attributes.elevation }}"; + below = 10; - }; - action = - { service = "homeassistant.turn_on"; - entity_id = [ "group.nachtlicht" ]; - }; - } - { - alias = "Turn off Nachtlicht at dawn"; - trigger = - { platform = "sun"; - event = "sunrise"; - offset = "01:30:00"; # on dawn - }; - # TODO: when somebody is still in the buero - # condition = - #{ - #}; - action = - { service = "homeassistant.turn_off"; - entity_id = [ "group.nachtlicht" ]; - }; - } -] + }; + action = + { service = "homeassistant.turn_on"; + entity_id = [ "group.nachtlicht" ]; + }; + } + { + alias = "Turn off Nachtlicht at dawn"; + trigger = + { platform = "sun"; + event = "sunrise"; + offset = "01:30:00"; # on dawn + }; + # TODO: when somebody is still in the buero + # condition = + #{ + #}; + action = + { service = "homeassistant.turn_off"; + entity_id = [ "group.nachtlicht" ]; + }; + } + ]; +} -- cgit v1.2.3