MQTT eventbus not transferring all IHC/ELKO items

Hi all

I am having issues regarding MQTT eventbus (I think the problem lies here).
Everything I have (Sonos, HUE, Netatmo, ESP8266 etc.) is working well, in fact its working great, with great respond times.
BUT I’m running the IHC/ELKO binding on the “MASTER” OH2, and it seems to me that the items from the master, is not being transferred properly.(or picked up properly)

Has anyone had the same experience?
Or perhaps I’m doing something wrong?

My eventbus:

# Slave
broker=brokerOH2_2
statePublishTopic=/openHAB/out/${item}/state
commandSubscribeTopic=/openHAB/in/${item}/command
# Master
broker=brokerOH2_2
commandPublishTopic=/openHAB/out/${item}/command
stateSubscribeTopic=/openHAB/in/${item}/state

Items file on “master”

// BRYGGERS
	Switch entrance_ceiling "Ceiling Entrance" (Entrance, Lights) ["Switchable"] { ihc="69723" }
	Switch entrance_table "Table Entrance" (Entrance, Lights) ["Switchable"] { ihc="70491" }
	Switch	PIR_AND_SKUMRING

// TOILET
	Switch toilet_ceiling "Toilet ceiling" <Toilet> (Toilet, Lights) ["Switchable"] { ihc="58459" }
	
// VÆRELSE 1 -SANDRA
	Switch room1_outlet1 "Sandra Outlet by kitchen" (Room1, Lights) ["Switchable"] { ihc="56923" }
	Switch room1_outlet2 "Sandra Outlet by garden" (Room1, Lights) ["Switchable"] { ihc="56155" }
	Switch room1_ceiling "Sandra Ceiling" (Room1, Lights) ["Switchable"] { ihc="12046865" }
	Switch room1_OEH "Sandra switch upper right" (Room1, Lights) ["Switchable"] { ihc="12076306" }

Please advise

This configuration doesn’t publish anything to MQTT binding.
Do you have connection to IHC? Have you tried by using the user interface, turn on or off some of the items you have configured in OH?

Thanx for your quick respond @jmv_driver
I have started my MQTTfx program, and I see a lot of messages from the “Master”, but not the ones from IHC.
I tried to subscribe to /openHAB/out/entrance_table/ and then i fired a signal from that item, but nothing.
I can control my entire house from Sitemaps, with the IHC Items, no problems.

Perhaps I’m in too deep… :frowning:

I do not know any openhab mechanism to subscribe to all events that pass on the openhab bus. can you reference me the documentation where is explained what you are trying to do? Why would you post every update from IHC to the MQTT broker?

You can find it a bit down the page under "EventBUS"
OpenHAB DOCS BINDINGS

There also a great deal of people, writing in the community about the subject.

MQTT Eventbus

The reason I’m doing it like this, is because I have a lot of rules, running my home automation, and I was in a place where turning on a light (IHC) with a presence detector (HUE), could take up to 3-5 sec. So the respond time was growing as I was making rules.
So my current setup is two OH2 PI3, running subscribe/publish via a MQTT broker.
Everything works great, except all my IHC.

OK, I never used this functionality. @pauli_anttila Can you help @Tonny_Kohler?

OK, so I played a little more with all the MQTT items, and if I publish to a IHC item, with /openHAB/in/toilet_ceiling/state, I can see that the item switches state, in OH2 log (the tail). But it does not switch in real life.
I tried with messages ON and 1 and OFF and 0
Same result 4 times…

The funny side is, if I trigger a IHC item on the slave OH, it can trigger a rule on the slave. SO, IHC from slave to master, and message back to the slave is OK. But when it comes to turning ON an output/IHC on the master, it does not work.

What am I doing wrong here?

Edit: The only thing I can see on the eventbus, is states, not commands.

Are you were that, rules use lazy compiled? When you change you rules, rules will be compiled when they are needed, so first execution normally have a delay.

I have never linked two openHAB instance together via MQTT event bus binding. But I think your configuration is not correct, as you e.g. publish to topic /openHAB/out/${item}/state from slave instance but you don’t subscribe to that topic on master.

I think your problem has nothing todo with IHC binding, so if you change topic name and the problem description, you probably will get better answers from MQTT binding experts.

Hi @pauli_anttila
Thanks for replying.
No I did’nt know the rule compiling was delayed… But this is only one time after creation of the rule, fter rebooting or similar, right?

As for my MQTT actions, this would be better?

# Master
broker=brokerOH2_2
 commandPublishTopic=/openHAB/${item}/command
 stateSubscribeTopic=/openHAB/${item}/state

# Slave
broker=brokerOH2_2
 statePublishTopic=/openHAB/${item}/state
 commandSubscribeTopic=/openHAB/${item}/command

It definetly gave me better responses in MQTTfx, so i guess this is the way, but not all the way.
Still not getting the “live” bulps, outlet etc. to react according to what I se in the log!

I have set up logs on both master and slave, with the same responses:
Master:

2017-01-22 22:31:47.353 [vent.ItemStateChangedEvent] - entrance_table changed from ON to OFF

Slave:

2017-01-22 22:31:42.663 [ome.event.ItemCommandEvent] - Item 'entrance_table' received command OFF
2017-01-22 22:31:42.685 [vent.ItemStateChangedEvent] - entrance_table changed from ON to OFF

So the items are now being transferred from slave to master, but still the master refuses to divert the message to my IHC, and turn ONFF the light.

This item:

2017-01-22 22:31:15.905 [vent.ItemStateChangedEvent] - room1_OEH changed from OFF to ON

is a IHC pushbutton, and doesn’t get from master to slave, so I guess that its a monologue :slight_smile:
All my IHC is onfugured in the master.
Thinking of it, this project of mine, should be able to work, if I only think in MQTT, but ofcause there is also OH2 items to take care of.
Is this a dead end?

Edit:
I just saw that the time stamp differs with about 5 seconds, is there a TTL on the MQTT pub/sub?
The timestamp should be the same, as it came almost exactly at the same time when I looked at the screen! or am I not thinking strait now…