summaryrefslogtreecommitdiffstats
path: root/makefu/2configs/bureautomation/automation
diff options
context:
space:
mode:
authorlassulus <lassulus@lassul.us>2019-04-08 17:13:47 +0200
committerlassulus <lassulus@lassul.us>2019-04-08 17:13:47 +0200
commit8df36824c35e0573c966b355264816dbef63a05b (patch)
tree2e757d9146b1e22c5f3e1c8426bd2ad8fc099dfd /makefu/2configs/bureautomation/automation
parent9e7729def580d83bc439985616f8c5d7162bcd48 (diff)
parent2f53271af0fda00bdc452c2bc5e569f064f562f6 (diff)
Merge remote-tracking branch 'gum/master'
Diffstat (limited to 'makefu/2configs/bureautomation/automation')
-rw-r--r--makefu/2configs/bureautomation/automation/10h_timer.nix13
-rw-r--r--makefu/2configs/bureautomation/automation/bureau-shutdown.nix49
-rw-r--r--makefu/2configs/bureautomation/automation/nachtlicht.nix4
3 files changed, 42 insertions, 24 deletions
diff --git a/makefu/2configs/bureautomation/automation/10h_timer.nix b/makefu/2configs/bureautomation/automation/10h_timer.nix
index a311d468c..dd747114e 100644
--- a/makefu/2configs/bureautomation/automation/10h_timer.nix
+++ b/makefu/2configs/bureautomation/automation/10h_timer.nix
@@ -2,8 +2,9 @@
{ alias = "start Felix 10h";
trigger = {
platform = "state";
- entity_id = "binary_sensor.redbutton";
- to = "on";
+ entity_id = [ "device_tracker.felix_phone" "device_tracker.felix_laptop" ];
+ from = "not_home";
+ to = "home";
};
condition = {
condition = "and";
@@ -127,7 +128,13 @@
};
action =
[
- # TODO: Pushbullet
+ {
+ service = "notify.telegrambot";
+ data = {
+ title = "Zu lange Felix!";
+ message = "Du bist schon 10 Stunden auf Arbeit, geh jetzt gefälligst nach Hause!";
+ };
+ }
{
service = "homeassistant.turn_on";
entity_id = [
diff --git a/makefu/2configs/bureautomation/automation/bureau-shutdown.nix b/makefu/2configs/bureautomation/automation/bureau-shutdown.nix
index 9e6574300..c632a9e69 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";
+ entity_id = "group.team";
+ from = "not_home";
+ to = "home";
};
action = {
service = "homeassistant.turn_on";
@@ -13,28 +14,38 @@
];
};
}
- { 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;
+ 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";
}
];
- 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 = [
@@ -44,10 +55,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";
}
];
};
diff --git a/makefu/2configs/bureautomation/automation/nachtlicht.nix b/makefu/2configs/bureautomation/automation/nachtlicht.nix
index 066e9b06c..2becd4a39 100644
--- a/makefu/2configs/bureautomation/automation/nachtlicht.nix
+++ b/makefu/2configs/bureautomation/automation/nachtlicht.nix
@@ -9,7 +9,7 @@
action =
{
service = "homeassistant.turn_off";
- entity_id = [ "switch.nachtlicht" ];
+ entity_id = [ "group.nachtlicht" ];
};
}
@@ -37,7 +37,7 @@
action =
{
service = "homeassistant.turn_on";
- entity_id = [ "switch.nachtlicht" ];
+ entity_id = [ "group.nachtlicht" ];
};
}
]