2019-03-06 15:42:27 +00:00
|
|
|
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;
|
2019-04-04 20:55:24 +00:00
|
|
|
#optimistic = true;
|
2019-03-06 15:42:27 +00:00
|
|
|
# state
|
|
|
|
command_topic = "/bam/${topic}/cmnd/POWER";
|
2019-04-04 20:55:24 +00:00
|
|
|
state_topic = "/bam/${topic}/tele/STATE";
|
|
|
|
value_template = "{{ value_json.POWER }}";
|
2019-03-06 15:42:27 +00:00
|
|
|
availability_topic = "/bam/${topic}/tele/LWT";
|
2019-04-04 20:55:24 +00:00
|
|
|
payload_on = "ON";
|
|
|
|
payload_off = "OFF";
|
2019-03-06 15:42:27 +00:00
|
|
|
payload_available= "Online";
|
|
|
|
payload_not_available= "Offline";
|
|
|
|
# brightness
|
2019-04-04 20:55:24 +00:00
|
|
|
brightness_state_topic = "/bam/${topic}/tele/STATE";
|
2019-04-17 18:46:58 +00:00
|
|
|
brightness_value_template = "{{value_json.Dimmer|default(100)}}";
|
2019-03-06 15:42:27 +00:00
|
|
|
brightness_command_topic = "/bam/${topic}/cmnd/Dimmer";
|
|
|
|
brightness_scale = 100;
|
|
|
|
# color
|
2019-10-30 07:01:44 +00:00
|
|
|
rgb_state_topic = "/bam/${topic}/stat/RESULT";
|
2019-03-06 15:42:27 +00:00
|
|
|
rgb_command_topic = "/bam/${topic}/cmnd/Color2";
|
2019-10-30 07:01:44 +00:00
|
|
|
rgb_value_template = "{{(value_json.Channel[0]*2.55)|int}},{{(value_json.Channel[1]*2.55)|int}},{{(value_json.Channel[2]*2.55)|int}}";
|
|
|
|
|
2019-03-06 15:42:27 +00:00
|
|
|
# effects
|
2019-04-04 20:55:24 +00:00
|
|
|
effect_state_topic = "/bam/${topic}/tele/STATE";
|
2019-10-30 07:01:44 +00:00
|
|
|
effect_value_template = "{{value_json.Scheme|default(0)}}";
|
2019-03-06 15:42:27 +00:00
|
|
|
effect_command_topic = "/bam/${topic}/cmnd/Scheme";
|
2019-04-04 20:55:24 +00:00
|
|
|
effect_list = [
|
2019-03-06 15:42:27 +00:00
|
|
|
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")
|
|
|
|
]
|