summaryrefslogtreecommitdiffstats
path: root/krebs/2configs/shack/glados/multi/rollos.nix
blob: 29525ad828ff709117730d64fe4e1c79a99da344 (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
55
56
57
58
59
# 

let
  glados = import ../lib;
  tempsensor = "sensor.dark_sky_temperature";
  all_covers = [
    "cover.crafting_rollo"
    "cover.elab_rollo"
    "cover.or2_rollo"
    "cover.retroraum_rollo"
  ];
in
{
  services.home-assistant.config =
  {
    automation =
    [
      { alias = "Rollos fahren Runter";
        trigger = [
          {
            platform = "numeric_state";
            entity_id = tempsensor;
            above = 25;
            for = "00:30:00";
          }
        ];
        condition =
          [
            {
              condition = "state";
              entity_id = "sun.sun";
              state = "above_horizon";
            }
        ];
        action =
          [
            { service = "cover.close_cover";
              entity_id = all_covers;
            }
          ];
      }
      { alias = "Rollos fahren Hoch";
        trigger = [
          {
            platform = "sun";
            event = "sunset";
          }
        ];
        condition = [ ];
        action =
          [
            { service = "cover.open_cover";
              entity_id = all_covers;
            }
          ];
      }
    ];
  };
}