summaryrefslogtreecommitdiffstats
path: root/makefu/2configs/bureautomation/multi/daily-standup.nix
blob: f5bd85b9dab036156f282205be838c2a8fc94116 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
{ lib }:
let
  random_daily_text = ''{{ [
    "Es ist so weit, es ist Standup Zeit!",
    "Zehn Uhr Fünfunddreissig ist genau die richtige Zeit für ein Standup!",
    "Hat jeder seine Hausaufgaben gemacht? Bitte einmal aufstehen und den Zettel nach rechts geben",
    "Aufstehen zum Appell, es wird die Anwesenheit kontrolliert!",
    "Hallo Kinder, wisst ihr welche Zeit es ist??? ... Genau! ... Standup Zeit!",
    "Morgens, halb elf in Deutschland - das Standupchen" ] | random }}'';

in {
  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";
      };
      action =
        [
          { service = "homeassistant.turn_on";
          entity_id =  [
            "script.blitz_10s"
            "script.random_daily"
          ];
        }
      ];

    }
  ];
}