From df60cdea0a5beb2df8046bc85b8789862ee8c040 Mon Sep 17 00:00:00 2001 From: makefu Date: Thu, 4 Apr 2019 09:50:16 +0200 Subject: ma bureautomation: remove faulty motion detector --- .../bureautomation/automation/bureau-shutdown.nix | 27 +++++++++++----------- 1 file changed, 14 insertions(+), 13 deletions(-) (limited to 'makefu/2configs/bureautomation/automation/bureau-shutdown.nix') diff --git a/makefu/2configs/bureautomation/automation/bureau-shutdown.nix b/makefu/2configs/bureautomation/automation/bureau-shutdown.nix index 9e657430..1def5f3a 100644 --- a/makefu/2configs/bureautomation/automation/bureau-shutdown.nix +++ b/makefu/2configs/bureautomation/automation/bureau-shutdown.nix @@ -1,9 +1,10 @@ [ - { alias = "Turn on Fernseher on movement"; + { alias = "Turn on Fernseher on group home"; trigger = { - platform = "state"; - entity_id = "binary_sensor.motion"; - to = "on"; + condition = "state"; + entity_id = "group.team"; + from = "not_home"; + to = "home"; }; action = { service = "homeassistant.turn_on"; @@ -13,15 +14,15 @@ ]; }; } - { alias = "Turn off Fernseher 10 minutes after last movement"; + { alias = "Turn off Fernseher after last in group left"; trigger = [ { # trigger when movement was detected at the time - platform = "state"; - entity_id = "binary_sensor.motion"; - to = "off"; - for.minutes = 10; + condition = "state"; + entity_id = "group.team"; + from = "home"; + to = "not_home"; } - { # trigger at 20:00 no matter what + { # trigger at 18:00 no matter what # to avoid 'everybody left before 18:00:00' platform = "time"; at = "18:00:00"; @@ -44,10 +45,10 @@ after = "18:00:00"; # weekday = [ "mon" "tue" "wed" "thu" "fri" ]; } - { + { # if anybody is still there condition = "state"; - entity_id = "binary_sensor.motion"; - state = "off"; + entity_id = "group.team"; + state = "not_home"; } ]; }; -- cgit v1.2.3 From 521ddfb835fe430c70312a16466086dcaaef6dc1 Mon Sep 17 00:00:00 2001 From: makefu Date: Thu, 4 Apr 2019 22:53:57 +0200 Subject: ma bureautomation: fix automation config --- makefu/2configs/bureautomation/automation/bureau-shutdown.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'makefu/2configs/bureautomation/automation/bureau-shutdown.nix') diff --git a/makefu/2configs/bureautomation/automation/bureau-shutdown.nix b/makefu/2configs/bureautomation/automation/bureau-shutdown.nix index 1def5f3a..28c65721 100644 --- a/makefu/2configs/bureautomation/automation/bureau-shutdown.nix +++ b/makefu/2configs/bureautomation/automation/bureau-shutdown.nix @@ -1,7 +1,7 @@ [ { alias = "Turn on Fernseher on group home"; trigger = { - condition = "state"; + platform = "state"; entity_id = "group.team"; from = "not_home"; to = "home"; @@ -17,7 +17,7 @@ { alias = "Turn off Fernseher after last in group left"; trigger = [ { # trigger when movement was detected at the time - condition = "state"; + platform = "state"; entity_id = "group.team"; from = "home"; to = "not_home"; -- cgit v1.2.3 From 8172c6074419d9148fcab7b798e87f3168930bd7 Mon Sep 17 00:00:00 2001 From: makefu Date: Fri, 5 Apr 2019 01:44:29 +0200 Subject: bureautomation: enable telegram bot --- .../bureautomation/automation/bureau-shutdown.nix | 26 +++++++++++++++------- 1 file changed, 18 insertions(+), 8 deletions(-) (limited to 'makefu/2configs/bureautomation/automation/bureau-shutdown.nix') diff --git a/makefu/2configs/bureautomation/automation/bureau-shutdown.nix b/makefu/2configs/bureautomation/automation/bureau-shutdown.nix index 28c65721..c632a9e6 100644 --- a/makefu/2configs/bureautomation/automation/bureau-shutdown.nix +++ b/makefu/2configs/bureautomation/automation/bureau-shutdown.nix @@ -28,14 +28,24 @@ at = "18:00:00"; } ]; - action = { - service = "homeassistant.turn_off"; - entity_id = [ - "switch.fernseher" - "switch.feuer" - "light.status_felix" - ]; - }; + action = [ + { + service = "homeassistant.turn_off"; + entity_id = [ + "switch.fernseher" + "switch.feuer" + "light.status_felix" + "light.status_daniel" + ]; + } + { + service = "notify.telegrambot"; + data = { + title = "Bureau Shutdown"; + message = "All devices are turned off due to {{ trigger.platform }} - {{ trigger }}"; + }; + } + ]; condition = { condition = "and"; conditions = [ -- cgit v1.2.3