summaryrefslogtreecommitdiffstats
path: root/makefu/2configs/bureautomation/light/statuslight.nix
blob: 0acab728135184473f473fee2b3ea3924e3aec69 (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
let
  tasmota_rgb = name: topic:
# LED WS2812b
#      effect_state_topic: "stat/led/Scheme"
#      effect_command_topic: "cmnd/led/Scheme"
#      effect_value_template: "{{ value_json.Scheme }}"
  { platform = "mqtt";
    inherit name;
    retain = false;
    qos = 1;
    #optimistic = true;
    # state
    command_topic = "/bam/${topic}/cmnd/POWER";
    state_topic = "/bam/${topic}/tele/STATE";
    value_template = "{{ value_json.POWER }}";
    availability_topic = "/bam/${topic}/tele/LWT";
    payload_on = "ON";
    payload_off = "OFF";
    payload_available= "Online";
    payload_not_available= "Offline";
    # brightness
    brightness_state_topic = "/bam/${topic}/tele/STATE";
    brightness_value_template = "{{value_json.Dimmer}}";
    brightness_command_topic = "/bam/${topic}/cmnd/Dimmer";
    brightness_scale = 100;
    # color
    rgb_state_topic = "/bam/${topic}/stat/Color";
    rgb_command_topic = "/bam/${topic}/cmnd/Color2";
    rgb_command_mode = "hex";
    rgb_command_template = "{{ '%02x%02x%02x' | format(red, green, blue)}}";
    # effects
    effect_state_topic = "/bam/${topic}/tele/STATE";
    effects_value_template = "{{value_json.Scheme}}";
    effect_command_topic = "/bam/${topic}/cmnd/Scheme";
    effect_value_template = "{{ value_json.Scheme }}";
    effect_list = [
      0  # single color for LED light
      1  # start wake up sequence (same as Wakeup)
      2  # cycle up through colors using Speed option
      3  # cycle down through colors using Speed option
      4  # random cycle through colors using Speed and Fade
      5  # clock mode (example)
      6  # candlelight pattern
      7  # RGB pattern
      8  # Christmas pattern
      9  # Hannukah pattern
      10 # Kwanzaa pattern
      11 # rainbow pattern
      12 # fire pattern
    ];
  };
in
[
  (tasmota_rgb "Status Felix" "status1")
  (tasmota_rgb "Status Daniel" "status2")
  (tasmota_rgb "Buslicht" "buslicht")
]