summaryrefslogtreecommitdiffstats
path: root/makefu/2configs/bureautomation/multi
diff options
context:
space:
mode:
Diffstat (limited to 'makefu/2configs/bureautomation/multi')
-rw-r--r--makefu/2configs/bureautomation/multi/10h_timers.nix16
-rw-r--r--makefu/2configs/bureautomation/multi/README.md3
-rw-r--r--makefu/2configs/bureautomation/multi/aramark.nix21
-rw-r--r--makefu/2configs/bureautomation/multi/daily-standup.nix83
-rw-r--r--makefu/2configs/bureautomation/multi/frosch.nix158
-rw-r--r--makefu/2configs/bureautomation/multi/matrix.nix106
-rw-r--r--makefu/2configs/bureautomation/multi/mittagessen.nix93
7 files changed, 248 insertions, 232 deletions
diff --git a/makefu/2configs/bureautomation/multi/10h_timers.nix b/makefu/2configs/bureautomation/multi/10h_timers.nix
index a30fb28b0..6edcde4b0 100644
--- a/makefu/2configs/bureautomation/multi/10h_timers.nix
+++ b/makefu/2configs/bureautomation/multi/10h_timers.nix
@@ -198,11 +198,13 @@ let
];
in
{
- timer =lib.fold lib.recursiveUpdate {}
- (map tmr_10h persons);
- automation = (lib.flatten (map automation_10h persons));
- script = lib.fold lib.recursiveUpdate {} (
- (map announce_user persons) ++
- (map zu_lange_user persons)
- );
+ services.home-assistant.config = {
+ timer =lib.fold lib.recursiveUpdate {}
+ (map tmr_10h persons);
+ automation = (lib.flatten (map automation_10h persons));
+ script = lib.fold lib.recursiveUpdate {} (
+ (map announce_user persons) ++
+ (map zu_lange_user persons)
+ );
+ };
}
diff --git a/makefu/2configs/bureautomation/multi/README.md b/makefu/2configs/bureautomation/multi/README.md
deleted file mode 100644
index baad87fda..000000000
--- a/makefu/2configs/bureautomation/multi/README.md
+++ /dev/null
@@ -1,3 +0,0 @@
-# Combination Folder
-files return a dictionary of different types used in home-assistant instead of
-a single thing.
diff --git a/makefu/2configs/bureautomation/multi/aramark.nix b/makefu/2configs/bureautomation/multi/aramark.nix
index ebe2cde81..45fadb082 100644
--- a/makefu/2configs/bureautomation/multi/aramark.nix
+++ b/makefu/2configs/bureautomation/multi/aramark.nix
@@ -12,13 +12,16 @@ let
((aramark "${menue}/price" "${menue} Preis") // { unit_of_measurement = "€"; })
];
in
-{
- sensor = (aramark_menue "Menü 1")
- ++ (aramark_menue "Menü 2")
- ++ (aramark_menue "Mercato")
- ++ (aramark_menue "Aktion");
- binary_sensor =
- [
- ((aramark "pommes" "Pommes" ) // { payload_on = "True"; payload_off = "False"; })
- ];
+ {
+ services.home-assistant.config =
+ {
+ sensor = (aramark_menue "Menü 1")
+ ++ (aramark_menue "Menü 2")
+ ++ (aramark_menue "Mercato")
+ ++ (aramark_menue "Aktion");
+ binary_sensor =
+ [
+ ((aramark "pommes" "Pommes" ) // { payload_on = "True"; payload_off = "False"; })
+ ];
+ };
}
diff --git a/makefu/2configs/bureautomation/multi/daily-standup.nix b/makefu/2configs/bureautomation/multi/daily-standup.nix
index 38fb22c1a..063def1ef 100644
--- a/makefu/2configs/bureautomation/multi/daily-standup.nix
+++ b/makefu/2configs/bureautomation/multi/daily-standup.nix
@@ -1,4 +1,4 @@
-{ lib }:
+{lib, ... }:
let
random_daily_text = ''{{ [
"Es ist so weit, es ist Standup Zeit!",
@@ -9,46 +9,49 @@ let
"Morgens, halb elf in Deutschland - das Standupchen" ] | random }}'';
in {
- script =
- { "random_daily" = {
- alias = "Random Daily Introduction";
+ services.home-assistant.config =
+ {
+ script =
+ { "random_daily" = {
+ alias = "Random Daily Introduction";
- sequence = [
- { service = "media_player.play_media";
- data = {
- entity_id = "media_player.mpd";
- media_content_type = "playlist";
- media_content_id = "ansage";
- };
- }
- { delay.seconds = 5; }
- { service = "tts.google_say";
- entity_id = "media_player.mpd";
- data_template = {
- message = random_daily_text;
- language = "de";
- };
- }
- ];
- };
- };
- automation = [
- {
- alias = "Daily Standup";
- trigger = {
- platform = "time";
- at = "10:35:00";
+ sequence = [
+ { service = "media_player.play_media";
+ data = {
+ entity_id = "media_player.mpd";
+ media_content_type = "playlist";
+ media_content_id = "ansage";
+ };
+ }
+ { delay.seconds = 5; }
+ { service = "tts.google_say";
+ entity_id = "media_player.mpd";
+ data_template = {
+ message = random_daily_text;
+ language = "de";
+ };
+ }
+ ];
};
- action =
- [
- { service = "homeassistant.turn_on";
- entity_id = [
- "script.blitz_10s"
- "script.random_daily"
- ];
- }
- ];
+ };
+ automation = [
+ {
+ alias = "Daily Standup";
+ trigger = {
+ platform = "time";
+ at = "10:35:00";
+ };
+ action =
+ [
+ { service = "homeassistant.turn_on";
+ entity_id = [
+ "script.blitz_10s"
+ "script.random_daily"
+ ];
+ }
+ ];
- }
- ];
+ }
+ ];
+ };
}
diff --git a/makefu/2configs/bureautomation/multi/frosch.nix b/makefu/2configs/bureautomation/multi/frosch.nix
index 816539d46..61606d4eb 100644
--- a/makefu/2configs/bureautomation/multi/frosch.nix
+++ b/makefu/2configs/bureautomation/multi/frosch.nix
@@ -1,4 +1,4 @@
-{ lib }:
+{lib, ... }:
# needs: binary_sensor.pommes
# notify.matrix_notify
let
@@ -17,83 +17,87 @@ let
"Der Weltmarktpreis von Pommes ist durch verschiedene Weltkrisen leider so hoch, dass Aramark den Verkaufspreis verdoppeln musste.",
"Vorfreude, schönste Freude, Freude bei Aramark. Pommes in die Schale rein, alle Kunden werden glücklich sein.",
"In 15 Minuten ist es wieder so weit, es ist Pommes Zeit!"] | random }}'';
-in {
- sensor = [
- { platform = "mqtt";
- name = "frosch brightness";
- device_class = "illuminance";
- state_topic = "/bam/frosch/sensor/brightness/state";
- availability_topic = "/bam/frosch/status";
- payload_available = "online";
- payload_not_available = "offline";
- }
- ];
- binary_sensor = [
- { platform = "mqtt";
- name = "frosch auge";
- state_topic = "/bam/frosch/binary_sensor/froschauge/state";
- availability_topic = "/bam/frosch/status";
- payload_available = "online";
- payload_not_available = "offline";
- }
- ];
- switch = [
- { platform = "mqtt";
- name = "frosch blasen";
- state_topic = "/bam/frosch/switch/blasen/state";
- command_topic = "/bam/frosch/switch/blasen/command";
- availability_topic = "/bam/frosch/status";
- payload_available = "online";
- payload_not_available = "offline";
- }
- ];
- light = [];
- automation = [
- { alias = "Pommeszeit";
- trigger = {
- platform = "time";
- at = "11:00:00";
+in
+{
+ services.home-assistant.config =
+ {
+ sensor = [
+ { platform = "mqtt";
+ name = "frosch brightness";
+ device_class = "illuminance";
+ state_topic = "/bam/frosch/sensor/brightness/state";
+ availability_topic = "/bam/frosch/status";
+ payload_available = "online";
+ payload_not_available = "offline";
+ }
+ ];
+ binary_sensor = [
+ { platform = "mqtt";
+ name = "frosch auge";
+ state_topic = "/bam/frosch/binary_sensor/froschauge/state";
+ availability_topic = "/bam/frosch/status";
+ payload_available = "online";
+ payload_not_available = "offline";
+ }
+ ];
+ switch = [
+ { platform = "mqtt";
+ name = "frosch blasen";
+ state_topic = "/bam/frosch/switch/blasen/state";
+ command_topic = "/bam/frosch/switch/blasen/command";
+ availability_topic = "/bam/frosch/status";
+ payload_available = "online";
+ payload_not_available = "offline";
+ }
+ ];
+ light = [];
+ automation = [
+ { alias = "Pommeszeit";
+ trigger = {
+ platform = "time";
+ at = "11:00:00";
+ };
+ condition = {
+ condition = "state";
+ entity_id = "binary_sensor.pommes"; # from multi/aramark.nix
+ state = "on";
+ };
+ action = [
+ { service = "homeassistant.turn_on";
+ entity_id = [
+ "script.pommes_announce"
+ "script.seifenblasen_30s" # from script/multi_blink.nix
+ ];
+ }
+ ];
+ }
+ ];
+ script = {
+ pommes_announce = {
+ alias = "Random Pommes announce";
+ sequence = [
+ {
+ service = "media_player.play_media";
+ data = {
+ entity_id = "media_player.mpd";
+ media_content_type = "playlist";
+ media_content_id = "ansage";
+ };
+ }
+ { delay.seconds = 5; }
+ {
+ service = "tts.google_say";
+ entity_id = "media_player.mpd";
+ data_template = {
+ message = random_pommes;
+ language = "de";
+ };
+ }
+ { service = "notify.matrix_notify";
+ data_template.message = random_pommes;
+ }
+ ];
};
- condition = {
- condition = "state";
- entity_id = "binary_sensor.pommes"; # from multi/aramark.nix
- state = "on";
- };
- action = [
- { service = "homeassistant.turn_on";
- entity_id = [
- "script.pommes_announce"
- "script.seifenblasen_30s" # from script/multi_blink.nix
- ];
- }
- ];
- }
- ];
- script = {
- pommes_announce = {
- alias = "Random Pommes announce";
- sequence = [
- {
- service = "media_player.play_media";
- data = {
- entity_id = "media_player.mpd";
- media_content_type = "playlist";
- media_content_id = "ansage";
- };
- }
- { delay.seconds = 5; }
- {
- service = "tts.google_say";
- entity_id = "media_player.mpd";
- data_template = {
- message = random_pommes;
- language = "de";
- };
- }
- { service = "notify.matrix_notify";
- data_template.message = random_pommes;
- }
- ];
};
};
}
diff --git a/makefu/2configs/bureautomation/multi/matrix.nix b/makefu/2configs/bureautomation/multi/matrix.nix
index 4fcfe8da4..b9b8fc4e8 100644
--- a/makefu/2configs/bureautomation/multi/matrix.nix
+++ b/makefu/2configs/bureautomation/multi/matrix.nix
@@ -8,58 +8,62 @@
# name: my_command
let
mom_room = "!kTQjvTQvfVsvfEtmth:thales.citadel.team";
-in {
- matrix =
+in
+{
+ services.home-assistant.config =
{
- # secrets:
- # homeserver, username, password
- homeserver = "https://ext01.citadel.team";
- rooms = [
- mom_room
- ];
- commands = [
- {
- # alternative: expression for regexp
- word = "version";
- name = "version";
- }
- {
- word = "luftqualität";
- name = "luftqualitaet";
- }
- ];
- } // (builtins.fromJSON (builtins.readFile
- <secrets/hass/citadel-bot.json>));
- automation = [
+ matrix =
{
- alias = "React to !version";
- trigger = {
- platform = "event";
- event_type = "matrix_command";
- event_data.command = "version";
- };
- action = {
- service = "notify.matrix_notify";
- data_template.message = "Running home-assistant {{states.sensor.current_version.state}}";
- };
- }
- {
- alias = "React to !luftqualität";
- trigger = {
- platform = "event";
- event_type = "matrix_command";
- event_data.command = "luftqualitaet";
- };
- action = {
- service = "notify.matrix_notify";
- data_template.message = ''Temp: {{states.sensor.notizen_temperature.state_with_unit | replace (" ","")}}, Hum:{{states.sensor.notizen_humidity.state_with_unit | replace (" ","")}}, airquality:{{states.sensor.air_quality.state_with_unit}}'';
- };
- }
+ # secrets:
+ # homeserver, username, password
+ homeserver = "https://ext01.citadel.team";
+ rooms = [
+ mom_room
+ ];
+ commands = [
+ {
+ # alternative: expression for regexp
+ word = "version";
+ name = "version";
+ }
+ {
+ word = "luftqualität";
+ name = "luftqualitaet";
+ }
+ ];
+ } // (builtins.fromJSON (builtins.readFile
+ <secrets/hass/citadel-bot.json>));
+ automation = [
+ {
+ alias = "React to !version";
+ trigger = {
+ platform = "event";
+ event_type = "matrix_command";
+ event_data.command = "version";
+ };
+ action = {
+ service = "notify.matrix_notify";
+ data_template.message = "Running home-assistant {{states.sensor.current_version.state}}";
+ };
+ }
+ {
+ alias = "React to !luftqualität";
+ trigger = {
+ platform = "event";
+ event_type = "matrix_command";
+ event_data.command = "luftqualitaet";
+ };
+ action = {
+ service = "notify.matrix_notify";
+ data_template.message = ''Temp: {{states.sensor.notizen_temperature.state_with_unit | replace (" ","")}}, Hum:{{states.sensor.notizen_humidity.state_with_unit | replace (" ","")}}, airquality:{{states.sensor.air_quality.state_with_unit}}'';
+ };
+ }
- ];
- notify = [{
- name = "matrix_notify";
- platform = "matrix";
- default_room = mom_room;
- }];
+ ];
+ notify = [{
+ name = "matrix_notify";
+ platform = "matrix";
+ default_room = mom_room;
+ }];
+ };
}
diff --git a/makefu/2configs/bureautomation/multi/mittagessen.nix b/makefu/2configs/bureautomation/multi/mittagessen.nix
index 2a9993e92..52ec99a92 100644
--- a/makefu/2configs/bureautomation/multi/mittagessen.nix
+++ b/makefu/2configs/bureautomation/multi/mittagessen.nix
@@ -38,52 +38,55 @@ let
"Jetzt nur noch kurz die Mail fertig schreiben und schon kann es los gehen.",
"Es ist 13 Uhr und die Mittagspause ist bald vorbei .... Kleiner Scherz, es ist erst 12:30, aber Ihr hättet auch nicht wirklich etwas verpasst.",
"Hallo, es ist nun 12 Uhr 30! Dies entspricht der Essenszeit aller Büroinsassen. Bitte begebt euch zur Aramark Essensausgabe um euren menschlichen Bedürfnissen nachzukommen."] | random }}'';
-in {
- automation = [
- { alias = "Mittagessen";
- trigger = {
- platform = "time";
- at = "12:30:00";
+in
+{
+ services.home-assistant.config = {
+ automation = [
+ { alias = "Mittagessen";
+ trigger = {
+ platform = "time";
+ at = "12:30:00";
+ };
+ action = [
+ { service = "homeassistant.turn_on";
+ entity_id = [
+ "script.mittagessen_announce"
+ "script.blitz_10s"
+ "script.mittagessenlicht"
+ ];
+ }
+ ];
+ }
+ ];
+ script = {
+ mittagessenlicht = (flash_entity {
+ entity = "switch.bauarbeiterlampe";
+ alias = "Bauarbeiterlampe Mittagessenlicht";
+ delay = 1000;
+ count = 5;
+ });
+ mittagessen_announce = {
+ alias = "Random Mittagessen announce";
+ sequence = [
+ {
+ service = "media_player.play_media";
+ data = {
+ entity_id = "media_player.mpd";
+ media_content_type = "playlist";
+ media_content_id = "ansage";
+ };
+ }
+ { delay.seconds = 5; }
+ {
+ service = "tts.google_say";
+ entity_id = "media_player.mpd";
+ data_template = {
+ message = random_mittagessen;
+ language = "de";
+ };
+ }
+ ];
};
- action = [
- { service = "homeassistant.turn_on";
- entity_id = [
- "script.mittagessen_announce"
- "script.blitz_10s"
- "script.mittagessenlicht"
- ];
- }
- ];
- }
- ];
- script = {
- mittagessenlicht = (flash_entity {
- entity = "switch.bauarbeiterlampe";
- alias = "Bauarbeiterlampe Mittagessenlicht";
- delay = 1000;
- count = 5;
- });
- mittagessen_announce = {
- alias = "Random Mittagessen announce";
- sequence = [
- {
- service = "media_player.play_media";
- data = {
- entity_id = "media_player.mpd";
- media_content_type = "playlist";
- media_content_id = "ansage";
- };
- }
- { delay.seconds = 5; }
- {
- service = "tts.google_say";
- entity_id = "media_player.mpd";
- data_template = {
- message = random_mittagessen;
- language = "de";
- };
- }
- ];
};
};
}