Things reload

Hi, I’m using Openhab 2.5M1. When editing my things file and making changes, it seems that the changes weren’t applied by Openhab when the .things file was saved. The only way it would load the newly updated things file was by restarting openhab.

Here’s my things file in question:

Thing mqtt:topic:mosquitto:livingroom_fan "Living Room Fan" (mqtt:broker:mosquitto) {
    Channels:
        Type switch : power	"Power"		[ stateTopic="stat/livingroom-fan/POWER", commandTopic="cmnd/livingroom-fan/POWER" ]
        Type string : reachable	"Reachable"	[ stateTopic="tele/livingroom-fan/LWT" ]
        Type number : rssi	"Wifi Signal Strength"	[ stateTopic="tele/livingroom-fan/STATE", transformationPattern="JSONPATH:$.Wifi.RSSI" ]
}

Thing mqtt:topic:mosquitto:front_porch_light "Front Porch Light" (mqtt:broker:mosquitto) {
    Channels:
        Type switch : power	"Power"		[ stateTopic="stat/front_porch_light/RESULT", transformationPattern="JSONPATH:$.POWER", commandTopic="cmnd/front_porch_light/POWER" ]
        Type dimmer : dimmer "Dimmer"		[ stateTopic="stat/front_porch_light/RESULT", transformationPattern="JSONPATH:$.Dimmer", commandTopic="cmnd/front_porch_light/Dimmer" ]
        Type string : reachable	"Reachable"	[ stateTopic="tele/front_porch_light/LWT" ]
        Type number : rssi	"Wifi Signal Strength"	[ stateTopic="tele/front_porch_light/STATE", transformationPattern="JSONPATH:$.Wifi.RSSI" ]
}

I was changing the stateTopic and added transformationPattern to one of the channels above. Previously my stateTopic was wrong so I changed it. The change didn’t take effect (the item’s state wasn’t updated) when the things file was saved, even though I saw that the file was “refreshed” in the openhab log. Once openhab was restarted, the state was updating as expected.

Is there a trick to this to avoid restarting openhab?

Anyone else experiencing this issue?

It’s binding dependent. Many bindings seem to be not very good at picking up minor edits in particular. Probably depends on what it has do - here for example it will have to unsubscribe from MQTT broker and subscribe anew.
The binding bundle can usually be stopped and restarted for slightly less trauma.

1 Like