So I have spent almost the whole day to read threads and trying to get this to work.
Like many others, I’m struggling with going from textual mqtt1 to textual mqtt2.
So the good thing, is that I know my broker is working as it should.
I thought I should start simple - just get the radon reading from my 3 radon sensors, that can be found on my broker in this path;
/house/radon/radoneye024e01 etc.
My old config:
broker.url=tcp://127.0.0.1:1883
broker.clientId=openhab
My old item (first sensor only)
Number radon_1 "Radonnivå 1 pCu/L [%.2f]" {mqtt="<[broker:/house/radon/radoneye024e01:state:default]"}
My new things file:
Bridge mqtt:broker:mosquitto "Mosquitto" [ host="127.0.0.1", port=1883, secure=false, clientID="openhab" ]
{
// RadonEye1/2/3
Thing topic radon1 "RadonEye 1" {
Channels:
Type number : pcu_l "pCu/L" [ stateTopic="house/radon/radoneye024e01" ]
}
Thing topic radon2 "RadonEye 2" {
Channels:
Type number : pcu_l "pCu/L" [ stateTopic="house/radon/radoneye15f4c5" ]
}
Thing topic radon3 "RadonEye 3" {
Channels:
Type number : pcu_l "pCu/L" [ stateTopic="house/radon/radoneye104432" ]
}
}
My three things:
Number radon_1 "Radonnivå 1 pCu/L [%.2f]" {channel="mqtt:topic:mosquitto:radon1:pci_l"}
Number radon_2 "Radonnivå 2 pCu/L [%.2f]" {channel="mqtt:topic:mosquitto:radon2:pci_l"}
Number radon_3 "Radonnivå 3 pCu/L [%.2f]" {channel="mqtt:topic:mosquitto:radon3:pci_l"}
Both broker and the three devices shows as online in UI.
(Broker shows as online even though I select any ip address, so maybe online is not online with broker, but online/available to oh.)
But: Here oh tries to tell me something - I just don’t understand it! I have a broker, it is online.
The channel link is exactly as entered in item file, so why is it not active here. (I guess the missing broker warning text is the reason.)
Restarting oh, this is all I get in the log:
17:40:07.857 [TRACE] [ng.mqtt.handler.AbstractBrokerHandler] - Subscribed org.openhab.binding.mqtt.homeassistant.internal.discovery.HomeAssistantDiscovery@1a18c528 to discovery topic homeassistant/# on broker mqtt:broker:mosquitto
17:40:07.858 [TRACE] [ng.mqtt.handler.AbstractBrokerHandler] - Subscribed org.openhab.binding.mqtt.homie.internal.discovery.Homie300Discovery@7768c16d to discovery topic +/+/$homie on broker mqtt:broker:mosquitto
17:40:07.861 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'mqtt:broker:mosquitto' changed from UNINITIALIZED to INITIALIZING
17:40:07.887 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'mqtt:topic:mosquitto:radon1' changed from UNINITIALIZED to UNINITIALIZED (BRIDGE_UNINITIALIZED)
17:40:07.889 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'mqtt:topic:mosquitto:radon2' changed from UNINITIALIZED to UNINITIALIZED (BRIDGE_UNINITIALIZED)
17:40:07.890 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'mqtt:topic:mosquitto:radon3' changed from UNINITIALIZED to UNINITIALIZED (BRIDGE_UNINITIALIZED)
17:40:07.902 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'mqtt:broker:mosquitto' changed from INITIALIZING to OFFLINE
17:40:07.907 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'mqtt:topic:mosquitto:radon1' changed from UNINITIALIZED (BRIDGE_UNINITIALIZED) to INITIALIZING
17:40:07.909 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'mqtt:topic:mosquitto:radon2' changed from UNINITIALIZED (BRIDGE_UNINITIALIZED) to INITIALIZING
17:40:07.910 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'mqtt:topic:mosquitto:radon3' changed from UNINITIALIZED (BRIDGE_UNINITIALIZED) to INITIALIZING
17:40:07.941 [DEBUG] [c.MqttChannelStateDescriptionProvider] - Adding state description for channel mqtt:topic:mosquitto:radon3:pcu_l
17:40:07.941 [DEBUG] [c.MqttChannelStateDescriptionProvider] - Adding state description for channel mqtt:topic:mosquitto:radon1:pcu_l
17:40:07.941 [DEBUG] [c.MqttChannelStateDescriptionProvider] - Adding state description for channel mqtt:topic:mosquitto:radon2:pcu_l
17:40:07.942 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'mqtt:topic:mosquitto:radon1' changed from INITIALIZING to OFFLINE (BRIDGE_OFFLINE)
17:40:07.943 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'mqtt:topic:mosquitto:radon2' changed from INITIALIZING to OFFLINE (BRIDGE_OFFLINE)
17:40:07.943 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'mqtt:topic:mosquitto:radon3' changed from INITIALIZING to OFFLINE (BRIDGE_OFFLINE)
17:40:08.180 [INFO ] [o.transport.mqtt.MqttBrokerConnection] - Starting MQTT broker connection to '127.0.0.1' with clientid openhab
17:40:08.186 [TRACE] [ng.mqtt.handler.AbstractBrokerHandler] - Subscribed org.openhab.binding.mqtt.homeassistant.internal.discovery.HomeAssistantDiscovery@1a18c528 to discovery topic homeassistant/# on broker mqtt:broker:mosquitto
17:40:08.187 [TRACE] [ng.mqtt.handler.AbstractBrokerHandler] - Subscribed org.openhab.binding.mqtt.homie.internal.discovery.Homie300Discovery@7768c16d to discovery topic +/+/$homie on broker mqtt:broker:mosquitto
17:40:08.366 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'mqtt:broker:mosquitto' changed from OFFLINE to ONLINE
17:40:08.385 [DEBUG] [hab.binding.mqtt.generic.ChannelState] - Subscribed channel mqtt:topic:mosquitto:radon2:pcu_l to topic: house/radon/radoneye15f4c5
17:40:08.387 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'mqtt:topic:mosquitto:radon2' changed from OFFLINE (BRIDGE_OFFLINE) to ONLINE
17:40:08.389 [DEBUG] [hab.binding.mqtt.generic.ChannelState] - Subscribed channel mqtt:topic:mosquitto:radon3:pcu_l to topic: house/radon/radoneye104432
17:40:08.391 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'mqtt:topic:mosquitto:radon3' changed from OFFLINE (BRIDGE_OFFLINE) to ONLINE
17:40:08.426 [DEBUG] [hab.binding.mqtt.generic.ChannelState] - Subscribed channel mqtt:topic:mosquitto:radon1:pcu_l to topic: house/radon/radoneye024e01
17:40:08.427 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'mqtt:topic:mosquitto:radon1' changed from OFFLINE (BRIDGE_OFFLINE) to ONLINE
What am I doing wrong?