summaryrefslogtreecommitdiffstats
path: root/makefu/2configs/ham/multi/flurlicht.nix
blob: 25eb78b7feefa3140638035c370eace6b98ede98 (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
# provides:
#  light
#  automation
#  binary_sensor
let
  hlib = (import ../lib);
  tasmota = hlib.tasmota;
in
{
  binary_sensor = [
    (tasmota.motion { name = "Flur Bewegung"; host = "flurlicht";})
  ];
  light = [ (tasmota.rgb { name = "Flurlicht"; host = "flurlicht";} ) ];
  automation = [
    { alias = "Dunkel bei Sonnenuntergang";
      trigger = {
        platform = "sun";
        event = "sunset";
        # offset: "-00:45:00"
      };
      action = [
        {
          service= "light.turn_on";
          data = {
            entity_id= "light.flurlicht";
            # rgb_color = [ 0,0,0 ]; <-- TODO default color
            brightness_pct = 15;
          };
        }
        {
          service= "light.turn_off";
          entity_id= "light.flurlicht";
        }
      ];
    }
    { alias = "Hell bei Sonnenaufgang";
      trigger = {
        platform = "sun";
        event = "sunrise";
        # offset: "-00:00:00"
      };
      action = [
        {
          service= "light.turn_on";
          data = {
            entity_id= "light.flurlicht";
            brightness_pct = 85;
          };
        }
        {
          service= "light.turn_off";
          entity_id= "light.flurlicht";
        }
      ];
    }
  ];
}