summaryrefslogtreecommitdiffstats
path: root/makefu/2configs/bureautomation/automation/nachtlicht.nix
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2020-11-18 20:50:43 +0100
committermakefu <github@syntax-fehler.de>2020-11-18 20:51:14 +0100
commita54974412751c98dec78b5e3977afc4a97aadea9 (patch)
treea096472a2c762f04a67a795a922f26259517dd7a /makefu/2configs/bureautomation/automation/nachtlicht.nix
parentf66309f0289c76dc9797573a73acbad186f4e380 (diff)
ma bureautomation: move to 20.09 style imports
Diffstat (limited to 'makefu/2configs/bureautomation/automation/nachtlicht.nix')
-rw-r--r--makefu/2configs/bureautomation/automation/nachtlicht.nix71
1 files changed, 37 insertions, 34 deletions
diff --git a/makefu/2configs/bureautomation/automation/nachtlicht.nix b/makefu/2configs/bureautomation/automation/nachtlicht.nix
index ec6fa20c..ade89418 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" ];
+ };
+ }
+ ];
+}