summaryrefslogtreecommitdiffstats
path: root/makefu/2configs/bureautomation/multi/frosch.nix
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2020-12-02 00:45:50 +0100
committertv <tv@krebsco.de>2020-12-02 00:45:50 +0100
commitd60b1b793f3a1635c1fe30aa11b64831fd665b4f (patch)
treed484b1315dab9b6c3d230118f6e33b0888f0aca5 /makefu/2configs/bureautomation/multi/frosch.nix
parent29827720520b6a4885dbdcb3237070e6e45dd910 (diff)
parent813eefa3c55fd1cd234b0adb1da7286bd761b579 (diff)
Merge remote-tracking branch 'prism/master' into master
Diffstat (limited to 'makefu/2configs/bureautomation/multi/frosch.nix')
-rw-r--r--makefu/2configs/bureautomation/multi/frosch.nix158
1 files changed, 81 insertions, 77 deletions
diff --git a/makefu/2configs/bureautomation/multi/frosch.nix b/makefu/2configs/bureautomation/multi/frosch.nix
index 816539d4..61606d4e 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;
- }
- ];
};
};
}