I’m trying to migrate from MQTT1 to MQTT2.4 but i’m failing miserably.
As to speed-up the debugging process i’m using “temporary” miflora sensor and publishing straight to mqtt (for testing):
mosquitto_pub -t miflora/temporary -m “{"light": 4, "temperature": 22.7, "moisture": 9, "conductivity": 195, "battery": 825}”
Then i’m defining my broker in mqtt_broker.things file:
Bridge mqtt:broker:kopra “Kopra MQTT server”
[
host=“”,
username=“”,
password=“”,
clientID=“openhab”
]
And after that i’m trying to define my sensor in miflora.things file:
Thing mqtt:topic:kopra:temporary “temp” (mqtt:broker:kopra) {
Channels:
Type number : battery “Battery Charge” [ stateTopic=“miflora/temporary”, transformationPattern=“JSONPATH:$.battery” ]
}
In the end there’s item in miflora.items:
Number temporary_Battery “temporary [%d %%]” (gPlantBattery, gBatteryPercent) { channel=“mqtt:topic:kopra:temporary:battery” }
All seems good and no error’s anywhere … but no update of item as well
But if i “merge” broker to same things file:
Bridge mqtt:broker:kopra “Kopra MQTT server”
[
host=“”,
username=“”,
password=“”,
clientID=“openhab”
]
{
Thing mqtt:topic:kopra:temporary “temp” (mqtt:broker:kopra) {
Channels:
Type number : battery “Battery Charge” [ stateTopic=“miflora/temporary”, transformationPattern=“JSONPATH:$.battery” ]
}
}
All seem’s to work like a charm … and i do get update to item.
As i read from the forum it should be possible to separate broker from things?
Can anyone tell me what i’m missing or what i’m doing wrong ?