Mit MQTT-Lens erhalte ich entsprechende Ausgaben. Das Format ist JSON.
Ich richte also eine Bridge ein, sie ist auch Online:
Code: Alles auswählen
Bridge mqtt:broker:ttn "MQTT Broker TTN" [host="eu1.cloud.thethings.network", port="1883", secure=false, username="xxx@ttn", password="yyyy", clientID="oh3ttn", enableDiscovery=false]
Code: Alles auswählen
Bridge mqtt:broker:ttn ... {
Thing topic loraTemp "loraTemp" [ stateTopic="v3/xxx@ttn/devices/+/up", transformationPattern="JSONPATH:$.uplink_message.decoded_payload.temperature" ]
Thing topic lora "lora" [ stateTopic="v3/xxx@ttn/devices/+/up" ] {
Channels:
Type number : LORA_WAN_TMP "LORA-WAN-TEMP" [ transformationPattern="JSONPATH:$.uplink_message.decoded_payload.temperature" ]
Type number : LORA_WAN_HUM "LORA-WAN-HUMI" [ transformationPattern="JSONPATH:$.uplink_message.decoded_payload.humidity" ]
}
}
Items:
String LW1Test "Inhalt [%s]" { channel="mqtt:topic:ttn:loraTemp" } // <- hier kommt normalerweise noch ein Wert hinten dran, welcher?
Number LW1Temp "LoraWan Temp. [%.1f °C]" { channel="mqtt:topic:ttn:lora:LORA_WAN_TMP" }
Number LW1Humi "LoraWan Feuchte [%.1f %%]" { channel="mqtt:topic:ttn:lora:LORA_WAN_HUM" }
Funktionierender Rapsi-Broker:
Code: Alles auswählen
Bridge mqtt:broker:local [host="xxxx", port="zzzz", secure=false, username="", password="", clientID="mqopenhab31"]
{
Thing topic mq7thing "MQ7-Thing" {
Channels:
Type number : MQ7_PPM "MQ7-PPM" [ stateTopic="MQ7/PPM" ]
}
item: Number iMQ7_PPM "CO Gehalt MQ-7 [%.1f ppm]" <smoke> { channel="mqtt:topic:local:mqt7hing:MQ7_PPM" }