summaryrefslogtreecommitdiffstats
path: root/makefu/2configs/home/ham/automation/light_buttons.nix
blob: 460d48bc4aec4570abc78a611dc95636f15d7cb1 (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
60
61
62
63
64
65
66
67
68
69

let
  inherit (import ../lib) btn_cycle_light;
  schlafzimmer_komode = "light.schlafzimmer_komode_osram";
  schlafzimmer_button = "sensor.schlafzimmer_btn2_click";
in {
  services.home-assistant.config.automation = [
    # (btn_cycle_light "light.arbeitszimmerbeleuchtung" "arbeitszimmer_btn1")

    {
      alias = "toggle keller";
      trigger = {
        platform = "state";
        entity_id = "sensor.keller_btn1_click";
        to = "single";
      };
      action = {
        service = "light.toggle";
        #entity_id = lights;
        data = {
          entity_id = "light.keller_osram";
          brightness = 255;
        };
      };
    }
    {
      alias = "low brightness keller with doubleclick";
      trigger = {
        platform = "state";
        entity_id = "sensor.keller_btn1_click";
        to = "double";
      };
      action = {
        service = "light.toggle";
        data = {
          entity_id = "light.keller_osram";
          brightness = 25;
        };
      };
    }
    # (btn_cycle_light "light.wohnzimmerbeleuchtung" "wohnzimmer_btn3")
    {
      alias = "Dim Toggle schlafzimmer komode";
      trigger = {
        platform = "state";
        entity_id = schlafzimmer_button;
        to = "single";
      };
      action = {
        service = "light.toggle";
        entity_id = schlafzimmer_komode;
        brightness = 1;
      };
    }
    {
      alias = "Bright Toggle schlafzimmer komode";
      trigger = {
        platform = "state";
        entity_id = schlafzimmer_button;
        to = "double";
      };
      action = {
        service = "light.toggle";
        entity_id = schlafzimmer_komode;
        brightness = 255;
      };
    }
  ];
}