summaryrefslogtreecommitdiffstats
path: root/makefu/2configs/bureautomation/automation/bureau-shutdown.nix
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2019-03-06 16:42:27 +0100
committermakefu <github@syntax-fehler.de>2019-03-06 16:42:27 +0100
commit9c702551abbf5c486d9dac3becc4d5e998511a52 (patch)
tree6b8aacd5ead80d213fe8588fca1fe491d18f7110 /makefu/2configs/bureautomation/automation/bureau-shutdown.nix
parentfb1d5f4addd1b3b564248b1359253bf788b1c08a (diff)
ma bureautomation: split into files
Diffstat (limited to 'makefu/2configs/bureautomation/automation/bureau-shutdown.nix')
-rw-r--r--makefu/2configs/bureautomation/automation/bureau-shutdown.nix55
1 files changed, 55 insertions, 0 deletions
diff --git a/makefu/2configs/bureautomation/automation/bureau-shutdown.nix b/makefu/2configs/bureautomation/automation/bureau-shutdown.nix
new file mode 100644
index 00000000..9e657430
--- /dev/null
+++ b/makefu/2configs/bureautomation/automation/bureau-shutdown.nix
@@ -0,0 +1,55 @@
+[
+ { alias = "Turn on Fernseher on movement";
+ trigger = {
+ platform = "state";
+ entity_id = "binary_sensor.motion";
+ to = "on";
+ };
+ action = {
+ service = "homeassistant.turn_on";
+ entity_id = [
+ "switch.fernseher"
+ "switch.feuer"
+ ];
+ };
+ }
+ { alias = "Turn off Fernseher 10 minutes after last movement";
+ trigger = [
+ { # trigger when movement was detected at the time
+ platform = "state";
+ entity_id = "binary_sensor.motion";
+ to = "off";
+ for.minutes = 10;
+ }
+ { # trigger at 20:00 no matter what
+ # to avoid 'everybody left before 18:00:00'
+ platform = "time";
+ at = "18:00:00";
+ }
+ ];
+ action = {
+ service = "homeassistant.turn_off";
+ entity_id = [
+ "switch.fernseher"
+ "switch.feuer"
+ "light.status_felix"
+ ];
+ };
+ condition =
+ { condition = "and";
+ conditions = [
+ {
+ condition = "time";
+ before = "06:30:00"; #only turn off between 6:30 and 18:00
+ after = "18:00:00";
+ # weekday = [ "mon" "tue" "wed" "thu" "fri" ];
+ }
+ {
+ condition = "state";
+ entity_id = "binary_sensor.motion";
+ state = "off";
+ }
+ ];
+ };
+ }
+]