Cześć
Jak wysłać pojedyncze kody RF z Sonoff Bridge RF z Tasmotą?
Chciałbym stworzyć w sitemap takie coś do sterowania taśmą LED:
Switch item=kolory mappings=["1"="RED", "2"="Blue", "3"="Green", "4"="White"]
Do takiego "wysyłania" potrzebuje pojedyncze things i items ale OH tego nie chce wypuścić do bramki 🙁
Bez problemu idzie zrobić tylko switch on off definiując wartość on off w things ale to tylko 2 wartości a ja potrzebuje kilku.
Udało mi się obejść ten problem - metoda pewnie bardzo lamerska ale dobrze działa.
things
Type switch : kod1 "Taśma Dorotka ON OFF" [ stateTopic="stat/sonoff-bridge/RESULT", commandTopic="cmnd/sonoff-bridge/Backlog", on="RfSync 12380; RfLow 410; RfHigh 1150; RfCode #DA3B07", off="RfSync 12380; RfLow 410; RfHigh 1150; RfCode #DA3B08" ]
Type switch : kod2 "Taśma Dorotka Dim + -" [ stateTopic="stat/sonoff-bridge/RESULT", commandTopic="cmnd/sonoff-bridge/Backlog", on="RfSync 12360; RfLow 410; RfHigh 1170; RfCode #DA3B05", off="RfSync 12380; RfLow 410; RfHigh 1150; RfCode #DA3B06" ]
Type switch : kod3 "Taśma Dorotka R G" [ stateTopic="stat/sonoff-bridge/RESULT", commandTopic="cmnd/sonoff-bridge/Backlog", on="RfSync 12360; RfLow 410; RfHigh 1170; RfCode #DA3B09", off="RfSync 12380; RfLow 410; RfHigh 1150; RfCode #DA3B0A" ]
Type switch : kod4 "Taśma Dorotka B W" [ stateTopic="stat/sonoff-bridge/RESULT", commandTopic="cmnd/sonoff-bridge/Backlog", on="RfSync 12360; RfLow 410; RfHigh 1170; RfCode #DA3B0B", off="RfSync 12380; RfLow 410; RfHigh 1150; RfCode #DA3B0C" ]
Type switch : kod5 "Taśma Dorotka O Y" [ stateTopic="stat/sonoff-bridge/RESULT", commandTopic="cmnd/sonoff-bridge/Backlog", on="RfSync 12360; RfLow 410; RfHigh 1170; RfCode #DA3B0D", off="RfSync 12380; RfLow 410; RfHigh 1150; RfCode #DA3B0E" ]
Type switch : kod6 "Taśma Dorotka C P" [ stateTopic="stat/sonoff-bridge/RESULT", commandTopic="cmnd/sonoff-bridge/Backlog", on="RfSync 12360; RfLow 410; RfHigh 1170; RfCode #DA3B0F", off="RfSync 12380; RfLow 410; RfHigh 1150; RfCode #DA3B10" ]
Type switch : kod7 "Taśma Dorotka JUMP" [ stateTopic="stat/sonoff-bridge/RESULT", commandTopic="cmnd/sonoff-bridge/Backlog", on="RfSync 12360; RfLow 410; RfHigh 1170; RfCode #DA3B11", off="RfSync 12360; RfLow 410; RfHigh 1170; RfCode #DA3B12" ]
Type switch : kod8 "Taśma Dorotka FADE" [ stateTopic="stat/sonoff-bridge/RESULT", commandTopic="cmnd/sonoff-bridge/Backlog", on="RfSync 12360; RfLow 410; RfHigh 1170; RfCode #DA3B13", off="RfSync 12360; RfLow 410; RfHigh 1170; RfCode #DA3B14" ]
Type switch : kod9 "Taśma Dorotka MUSIC 1" [ stateTopic="stat/sonoff-bridge/RESULT", commandTopic="cmnd/sonoff-bridge/Backlog", on="RfSync 12360; RfLow 410; RfHigh 1170; RfCode #DA3B15", off="RfSync 12360; RfLow 410; RfHigh 1170; RfCode #DA3B16" ]
Type switch : kod10 "Taśma Dorotka MUSIC 2" [ stateTopic="stat/sonoff-bridge/RESULT", commandTopic="cmnd/sonoff-bridge/Backlog", on="RfSync 12360; RfLow 410; RfHigh 1170; RfCode #DA3B17", off="RfSync 12360; RfLow 410; RfHigh 1150; RfCode #DA3B18" ]
items
SwitchDor_tasma_led_power"Taśma LED []" <my_light> (gBridgeRF) { channel="mqtt:topic:mqtt-broker:tasmota-sonoff-bridge:kod1", autoupdate="true"}
SwitchDor_tasm_led_dim"Taśma LED Jasność[]" <slider> (gBridgeRF) { channel="mqtt:topic:mqtt-broker:tasmota-sonoff-bridge:kod2", autoupdate="true"}
SwitchDor_tasm_led_rg"Taśma LED GREEN RED[]" <rgb> (gBridgeRF) { channel="mqtt:topic:mqtt-broker:tasmota-sonoff-bridge:kod3", autoupdate="true"}
SwitchDor_tasm_led_bw"Taśma LED WHITE BLUE[]" <rgb> (gBridgeRF) { channel="mqtt:topic:mqtt-broker:tasmota-sonoff-bridge:kod4", autoupdate="true"}
SwitchDor_tasm_led_oy"Taśma LED YELLOW ORANGE[]" <rgb> (gBridgeRF) { channel="mqtt:topic:mqtt-broker:tasmota-sonoff-bridge:kod5", autoupdate="true"}
SwitchDor_tasm_led_cp"Taśma LED PURPLE CYAN[]" <rgb> (gBridgeRF) { channel="mqtt:topic:mqtt-broker:tasmota-sonoff-bridge:kod6", autoupdate="true"}
SwitchDor_tasm_led_jump"Taśma LED JUMP 7 & 3[]" <rgb> (gBridgeRF) { channel="mqtt:topic:mqtt-broker:tasmota-sonoff-bridge:kod7", autoupdate="true"}
SwitchDor_tasm_led_fade"Taśma LED FADE 7 & 3[]" <rgb> (gBridgeRF) { channel="mqtt:topic:mqtt-broker:tasmota-sonoff-bridge:kod8", autoupdate="true"}
SwitchDor_tasm_led_music12"Taśma LED MUSIC 2 & 1[]" <rgb> (gBridgeRF) { channel="mqtt:topic:mqtt-broker:tasmota-sonoff-bridge:kod9", autoupdate="true"}
SwitchDor_tasm_led_music34"Taśma LED MUSIC 4 & 3[]" <rgb> (gBridgeRF) { channel="mqtt:topic:mqtt-broker:tasmota-sonoff-bridge:kod10", autoupdate="true"}
Numberpilotled"Pilot led mapping" <rgb> (gBridgeRF)
sitemap
sitemaptest label="Testowe" {
Text label="Pilot LED" icon="remote" {
Switch item=Dor_tasma_led_power
Switch item=Dor_tasm_led_dim mappings=[OFF="-",ON="+"]
Switch item=pilotled label="[]" mappings=[1=" RED ", 2="GREEN ", 3=" BLUE ", 4="WHITE "]
Switch item=pilotled label="[]" mappings=[5="ORANGE", 6="YELLOW", 7="CYAN", 8="PURPPLE"]
Switch item=pilotled label="[]" mappings=[9="JUMP 3", 10="JUMP 7", 11="FADE 3", 12="FADE 7"]
Switch item=pilotled label="[]" mappings=[13="MUSIC1", 14="MUSIC2", 15="MUSIC3", 16="MUSIC4"]
}
}
rule"Tasma_kolory"
when
Itempilotled received command
then
switch (receivedCommand) {
case1:Dor_tasm_led_rg.sendCommand("ON")
case2:Dor_tasm_led_rg.sendCommand("OFF")
case3:Dor_tasm_led_bw.sendCommand("ON")
case4:Dor_tasm_led_bw.sendCommand("OFF")
case5:Dor_tasm_led_oy.sendCommand("ON")
case6:Dor_tasm_led_oy.sendCommand("OFF")
case7:Dor_tasm_led_cp.sendCommand("ON")
case8:Dor_tasm_led_cp.sendCommand("OFF")
case9:Dor_tasm_led_jump.sendCommand("ON")
case10:Dor_tasm_led_jump.sendCommand("OFF")
case11:Dor_tasm_led_fade.sendCommand("ON")
case12:Dor_tasm_led_fade.sendCommand("OFF")
case13:Dor_tasm_led_music12.sendCommand("ON")
case14:Dor_tasm_led_music12.sendCommand("OFF")
case15:Dor_tasm_led_music34.sendCommand("ON")
case16:Dor_tasm_led_music34.sendCommand("OFF")
}
end
Efekt jak na zdjęciu w załączniku.