<light> sitemap icons are after start on, while switch is off

  • Platform information:
    • Hardware: Virtual Maschine
    • OS: Ubuntu Server 19.10 x86
    • Java Runtime Environment: Zulu
    • openHAB version: 2.4 stable

Hello, since some days i trie to configure my openHAB with KNX. The KNX actors are not configured to send a status back. If I switch a light on, the GA will send to the actor and the status LED of the switch. This works normally. Before I now change my KNX programming to get the status back for openHAB, i have a perhaps more trivial question. When I start openHAB, there is no knowledge about the status of the actors. It seems that the “read” command get no results. So the switches, defined in the sitemap are off, but all icons are “on”. When i switch a light on and off, the icon switches also to off. I did not understand this.

When openHAB starts and you are not using a persistence, all items will be as undef. Site map will then use the default icon (=On)

I’ll guess the state of the Items that they represent are neither ON or OFF, but NULL (because the status hasn’t been read from KNX yet)

The icons are in “sets”, for example -
light.svg
light-off.svg
light-on.svg
You can see how the UI selects the icon; for ON and OFF states the -on and -off icon versions are selected. For no match, as in NULL, the default light.svg is selected.

As it happens, light.svg looks the same as light-on.svg
https://docs.openhab.org/v2.1/addons/iconsets/classic/readme.html

One approach is to change the icon set. I do this, make a new custom icon set like
mylight.svg
mylight-off.svg
mylight-on.svg
where the -on and -off versions are copies of the standard icon, but the default version is somethng else - I use a question mark for “unknown”.

Another approach of course is to fix your KNX configuration so that the Item state gets updated promptly after a reboot.

Personally, I use custom icons anyway so that it’s easy to spot faults.

Thank you for the first explanation of the behavior. I understand now the status “NULL”, but wonder about the openHAB behavior that the light was shown per default as “ON”, while the switch button is on the left side, what is normally OFF. I think here should be the same default behavior for both elements. Perhaps the developers can comment this decision for the Basic UI?

The persistence seems to be no solution for the moment, because also the documentation says, that the status of an switch can change while openHAB restarts. I think it is better to find a solution to get the status. But what could be the problem, I mean to understand that “fetch” in an KNX thing is to read this things out. Or works this fetch only, if the status GA of an actor is programmed?

An example of my KNX configuration:

Thing device bj_reg_1_1_21_kg
        address="1.1.21",
        fetch=true,
        pingInterval=300,
        readInterval=3600
    ] {
        Type switch : ausgang_c   "Wandlampe Kellerdiele"   [ ga="1/2/0" ]
    }

It isn’t. The default version of the icon named happens to be a yellow bulb. That’s so that you can use the icon for any light-ish purpose without getting an icon that looks like an unlit bulb etc. You are interpreting a yellow icon to mean ON.

If you don’t like the default icons, you can use custom icons.

I agree, I’m afraid I do not know KNX.