Hi friends! I decided to automate the cooker hood.
But I ran into little difficulties. Help me to understand!
I have 3 relays (tasmota interlock mode) that switch fan speeds.
Everything works great in Habpanel! All switches and statuses from physical buttons are visible.
And here’s what comes out in basicui.
Buttons (mappings) are displayed normally (Switch relays).
But they do not display or toggle the status of physical buttons.
And they do not save the status when the browser page is refreshed.
sitemap
Frame {
Text label="Вентиляция" icon="fan" {
Switch item=GF_Kitchen_fan label="Кухонная вытяжка" mappings=[FAST="FAST", MIDDLE="MIDDLE", SLOW="SLOW", OFF="OFF"] icon="oiuyt"
There are no buttons at all in the group.
items
String GF_Kitchen_fan "Кухонная вытяжка [MAP(Kitchenfan.map):%s]" <oiuyt> (GF_Kitchen) ["Switchable"] {channel=""}
Little Rule
rule "Kitchen Fan Buttons"
when
Item GF_Kitchen_fan received command
then
switch(receivedCommand) {
case "FAST": {
GF_Kitchen_fan1.sendCommand(ON)
}
case "MIDDLE": {
GF_Kitchen_fan2.sendCommand(ON)
}
case "SLOW": {
GF_Kitchen_fan3.sendCommand(ON)
}
case "OFF": {
GF_Kitchen_fan4.sendCommand(ON)
}
}
end
rule "Kitchen Fan OFF"
when
Item GF_Kitchen_fan4 changed to ON
then
GF_Kitchen_fan1.sendCommand(OFF)
GF_Kitchen_fan2.sendCommand(OFF)
GF_Kitchen_fan3.sendCommand(OFF)
GF_Kitchen_fan4.postUpdate(OFF)
end
Map
FAST=FAST
MIDDLE=MIDDLE
SLOW=SLOW
OFF=OFF
I would be grateful for your hints.
Thank!