Hood control (mappings, button status, rule) OH 2.5

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.

Opera Снимок_2021-05-07_104843_192.168.0.102

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!

Check in other browsers.

However …

unless you are hiding stuff from us, that will break autoupdate for this Item.
Meaning that its state will not change in response to commands.
Sitemap button highlighting is derived from Item state.

What group? You mean,if you use a Group widget in your sitemap?
Yes, that’s entirely expected. When you display a set of Items with a Group widget, each one is displayed with a default widget. There is no way to customize any of them for buttons, colour, etc.or even change the order.

If you need something like that, build the sitemap by hand instead using Text { } widget instead of Group widget.

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.