OH 2.5: multiple channels on one Item issue

On OH2.5 I’m trying to bridge the nikobus binding to MQTT binding.
Following Item is defined:

Switch sKeukenMuurVerlichting "Keuken muurverlichting" { channel="nikobus:switch-module:mypclink:s1:output-9", channel="mqtt:topic:mosquitto:nikobus_sc1:09" }

When i use the switch in paperUI both channels are being triggered.
Nikobus binding is turning on the light and the state is correctlty published on MQTT.:ok_hand:

When I publish the correct command to the MQTT broker, the Item switches on in paperUI and the Nikobus binding is turning on the light.:ok_hand:

However when the light is switched on via physical buttons, the Nikobus binding is correclty updating the the switch in paperUI, but the state is not being published to the broker. :tired_face:

So both channels work fine individually, but when the first one (nikobus) is triggering the Item change, the state change doesn’t seem to trigger the second channel.

Help, Advise is much appreciated.

Maybe use autoupdate on the mqtt item or a rule that will update the item on a state change?

Tried the autoupdate option on the mqtt thing, but no change. Same behavior.
The item is being updated, but the mqtt state is not being published.

Try a rule to update the mqtt state when there is an update with the associated Nikobus binding item.

Something of interest?

What version is the Nikobus binding?

259 │ Active │ 81 │ 2.5.0 │ openHAB Add-ons :: Bundles :: MQTT Things and Channels
266 │ Active │ 80 │ 2.5.0 │ openHAB Add-ons :: Bundles :: Nikobus Binding

I agree that a rule might do the job, but that’s not supposed to be the purpose is it?
That would mean I need to create a rule for each Item.

I wouldn’t think so but I didn’t see an open issue on github.:thinking:

Take a look at this link:

This can be a workaround indeed. But again this is not supposed to work that way and I would like to know the root cause.:thinking:

Why if channel1 is updating an Item state, the state change is not being picked up by channel2?
But the other way around works. (channel2 is updating an item state and the state change is picked up by channel1 correctly) :thinking:

Stop OH and clean the cache as there may be something lingering around that’s causing the issue. Other than that maybe try adding DEBUG or TRACE to the logs for both mqtt and nikobus binding to help get an idea with what the root cause is.

sudo systemctl stop openhab2

sudo openhab-cli clean-cache

sudo systemctl start openhab2 or sudo reboot

What you need is the follow profile.

Bindings normally pass only commands to real devices, and convert incoming data to state updates.
It has to be that way or it’d all collapse in a screaming loop.

So if you want something incoming to prompt a binding, then you need to make it into a command; this is what the follow profile is for.
MQTT binding is an odbball in this use because you can actually configure non-standard response events to internal state changes and incoming data.

1 Like