The topics are correct. There is a connection. IP is static.
Perhaps you could show us how you configured your Bridge thing myBroker, and your generic Thing myDevice, and its channel IO?
You should be able to see the binding connect to your broker in your openhab.log
When does your mystery device publish to MX210/Output/GET/DO/STATE ? Is that happening
this ? mqtt:topic:aa27f488:Output_1
Yes it works
There is no visual toggle switch on other devices
Well that did not move us any further forward.
I understand there is a language problem.
Can you send messages from openHAB to the secret device via MQTT ?
Are you receiving messages from the secret device at openHAB ?
What is a “visual toggle switch” , is something on the secret device, or on openHAB, or ?
Yes
Yes, but only on one device. I.e. if I switch on the phone then the current on the phone is visible on or off
Okay, so may we see the openHAB events log that goes with this one phone that you can see on/off?
4 switch ON and OFF, computer only OFF
2020-07-21 19:41:18.157 [ome.event.ItemCommandEvent] - Item ‘InOut’ received command 0
2020-07-21 19:41:18.376 [ome.event.ItemCommandEvent] - Item ‘light_1’ received command ON
2020-07-21 19:41:18.394 [ome.event.ItemCommandEvent] - Item ‘InOut’ received command 1
2020-07-21 19:41:18.399 [vent.ItemStateChangedEvent] - InOut changed from 0 to 1
2020-07-21 19:41:20.134 [ome.event.ItemCommandEvent] - Item ‘light_2’ received command ON
2020-07-21 19:41:20.148 [ome.event.ItemCommandEvent] - Item ‘InOut’ received command 3
2020-07-21 19:41:20.161 [vent.ItemStateChangedEvent] - InOut changed from 1 to 3
2020-07-21 19:41:20.927 [ome.event.ItemCommandEvent] - Item ‘light_3’ received command ON
2020-07-21 19:41:20.940 [ome.event.ItemCommandEvent] - Item ‘InOut’ received command 7
2020-07-21 19:41:20.949 [vent.ItemStateChangedEvent] - InOut changed from 3 to 7
2020-07-21 19:41:21.661 [ome.event.ItemCommandEvent] - Item ‘light_4’ received command ON
2020-07-21 19:41:21.677 [ome.event.ItemCommandEvent] - Item ‘InOut’ received command 15
2020-07-21 19:41:21.682 [vent.ItemStateChangedEvent] - InOut changed from 7 to 15
2020-07-21 19:41:28.167 [ome.event.ItemCommandEvent] - Item ‘InOut’ received command 15
2020-07-21 19:41:28.312 [ome.event.ItemCommandEvent] - Item ‘light_4’ received command OFF
2020-07-21 19:41:28.323 [ome.event.ItemCommandEvent] - Item ‘InOut’ received command 7
2020-07-21 19:41:28.340 [vent.ItemStateChangedEvent] - InOut changed from 15 to 7
2020-07-21 19:41:28.735 [ome.event.ItemCommandEvent] - Item ‘light_3’ received command OFF
2020-07-21 19:41:28.747 [ome.event.ItemCommandEvent] - Item ‘InOut’ received command 3
2020-07-21 19:41:28.755 [vent.ItemStateChangedEvent] - InOut changed from 7 to 3
2020-07-21 19:41:29.767 [ome.event.ItemCommandEvent] - Item ‘light_2’ received command OFF
2020-07-21 19:41:29.780 [ome.event.ItemCommandEvent] - Item ‘InOut’ received command 1
2020-07-21 19:41:29.792 [vent.ItemStateChangedEvent] - InOut changed from 3 to 1
2020-07-21 19:41:30.677 [ome.event.ItemCommandEvent] - Item ‘light_1’ received command OFF
2020-07-21 19:41:30.687 [ome.event.ItemCommandEvent] - Item ‘InOut’ received command 0
2020-07-21 19:41:30.692 [vent.ItemStateChangedEvent] - InOut changed from 1 to 0
2020-07-21 19:41:38.178 [ome.event.ItemCommandEvent] - Item ‘InOut’ received command 0
What does your “device in” rule look like?
import java.math.BigInteger
rule "Device in"
when
Item InOut changed
then
var BigInteger register = (InOut.state as DecimalType).toBigDecimal.toBigInteger
gLights.members.forEach[i |
val Integer nBit = Integer::parseInt(i.name.split("_").get(1)) - 1
i.postUpdate(if(register.testBit(nBit) == 1) ON else OFF)
]
end
rule "Device out"
when
Member of gLights received command
then
var BigInteger register = (InOut.state as DecimalType).toBigDecimal.toBigInteger
val Integer nBit = Integer::parseInt(triggeringItem.name.split("_").get(1)) - 1
if(receivedCommand == ON)
register = register.setBit(nBit)
else
register = register.clearBit(nBit)
InOut.sendCommand(register)
end
Looks like you are going to have to debug it a bit, either carefully placed logInfo()s
you will have to do it via modbus tcp…
Seems the command is not sent towards the device.
Do you have mqtt.fx or something similar (mqtt spy…)
to ensure that the message is sent at all…
They reach, the relay clicks, the indicators light up
There are “MQTT Explorer”
So what is missing?
The switch only works on one device. If enabled on the phone the same switch is turned off on the computer and Vice versa if enabled on the computer the phone is turned off
Ah. How do you switch om computer and phone?
Phone: Openhab app
Computer: localhost:8080
So there is a sitemap involved …
Anyway, looking at your events.log
When there is a command to one of your individual switch Items like -
There is never a corresponding Item state change. (unless you are hiding those logs)
No state change, nothing for your UI to display.
Okay, we were expecting the rule “Device in” to supply the state changes, so there is something wrong there.
I have run that rule in my own system, it does not work, so will suggest a fixed version. This works in 2.5.0 -
import java.math.BigInteger
rule "Device in"
when
Item DeviceIO changed
then
val BigInteger register = (DeviceIO.state as DecimalType).toBigDecimal.toBigInteger
gSwitches.members.forEach[ i |
val Integer nBit = Integer::parseInt(i.name.split("_").get(1)) - 1
i.postUpdate(if(register.testBit(nBit) == true) ON else OFF)
]
end
You can also amend your Item definition to remove the autoupdate from the Group, that is not needed.
Group gSwitches "group for binary switches"
Items included in the rule do not work the same way on different devices. The others are working fine.
Did you restart openHAB and the openHAB app already? I’m pretty sure that it’s not possible to have different states for the same item on different devices, regardless, whether the item is bound to a binding or not.