openhab / openhab-core

Core framework of openHAB
https://www.openhab.org/
Eclipse Public License 2.0
898 stars 415 forks source link

File-configured item profile is not updated in Admin UI (only after reboot) #4277

Open quensen opened 2 weeks ago

quensen commented 2 weeks ago

Context

I use only the text file based configuration, not the UI config. There, I configured things and items (in this case for the KNX and MQTT bindings). I use my KNX button sensors (GIRA Tastsensor 3 plus) not (any more) to switch the power directly (using a KNX actor) but to switch a KNX Group Address ON/OFF that is a file configured thing linked to a fle configured item in openHAB. I also have a Zigbee light bulb that can be switched ON/OFF using a MQTT2Zigbee topic that is file configured as a thing in openHAB. It all works well in general, but when I add a MQTT channel to a KNX channel to create an item while the OH service is running 'on the fly', the profile won't be shown in the UI‘s profile radio buttons (although it works), only, when I restart the OH service.

Expected Behavior

I can manually configure the functions above using the web-based Admin UI, set the profile for the MQTT-bound channel to the Followprofile using the profile radio buttons, but I intend to do it via text file. I expected the system to show the updated profile in the Admin UI (the profile radio button selector).

Current Behavior

The file configured setting is done 'somehow internally' but it is not reflected in the Admin UI. After a restart of the OH service, it is shown correctly. The radio button reflecting the chosen profile is not default any more.

Possible Solution

None, the workaround is the restart of the OH service.

Steps to Reproduce (for Bugs)

  1. Have two channels configured using .things files, e.g. one for KNX, another one for MQTT (but I guess the binding does not matter here):
    Thing device ga "KNX-Gruppenadressen" [ ]
    {
        Channels:
            Type switch : test_mqtt_schalter "Test MQTT-Schalter" [ ga = "<31/0/99" ]

    and

    
    Thing topic ewelink_24 "Zigbee eWeLink 2.4" @"OG Büro" [ availabilityTopic = "zigbee2mqtt/ewelink_24/availability",     payloadAvailable = "online", payloadNotAvailable = "offline" ]
    {
        Channels:
            Type switch : schalter "Schalter" [ stateTopic = "zigbee2mqtt/ewelink_24/state",                        commandTopic = "zigbee2mqtt/ewelink_24/set", formatBeforePublish = "{\"state\":\"%s\"}" ]
2. Create an item using a .items file
3. In the .items file, link the two channels with a profile while the OH services is running.

Switch Test_MQTT_Schalter "Test MQTT-Schalter" { channel = "knx:device:router:ga:test_mqtt_schalter", channel = "mqtt:topic:mosquitto:ewelink_24:schalter"[profile="system:follow"] }


4. Check item config in the Admin UI
`http://my_host:8080/settings/items/Test_MQTT_Schalter/links/edit/mqtt:topic:mosquitto:ewelink_24:schalter`

## Your Environment
Server: 
- Release = Debian GNU/Linux 12 (bookworm)
- Kernel = Linux 6.6.31+rpt-rpi-2712
- Platform = BCM43455 37.4MHz Raspberry Pi 3+-0190

Browser: MS Edge on the PC
lolodomo commented 1 week ago

Is your problem reproducible by just updating an existing item inside an items file by setting the follow profile ? Or is it the combination of creating a new item and setting the follow profile ?

lolodomo commented 1 week ago

The file configured setting is done 'somehow internally' but it is not reflected in the Admin UI.

Maybe a bug in Main UI ? Did you try Ctrl+F5 or the reload app link in the about page?

miloit commented 4 days ago

I can confirm this issue even the health check is naming the not existing item

quensen commented 4 days ago

I can confirm this issue even the health check is naming the not existing item

Hello miloit,

2 questions:

Best regards, Stefano

quensen commented 4 days ago

The file configured setting is done 'somehow internally' but it is not reflected in the Admin UI.

Maybe a bug in Main UI ? Did you try Ctrl+F5 or the reload app link in the about page?

Yes, I did. Only a restart of the OH service updated the display correctly.

lolodomo commented 3 days ago

I will try to reproduce an easier use case without MQTT, just adding a profile to an item in an items file

quensen commented 3 days ago

I will try to reproduce an easier use case without MQTT, just adding a profile to an item in an items file

Yes, please. And please use one item but two channels from things of different bindings configured in separate things files. I have a knx.things file and a mqtt.things file and one knx.items file that combines two channels into one item by taking one channel from two different things.

I also think that the binding does not matter. I just explained the background.

miloit commented 3 days ago

See here

https://community.openhab.org/t/openhab-4-2-milestone-discussion/154316/176?u=milo

Maybe a different topic but the failure behavior looks similar to me

Health check was newly introduced with oh4.2M4