MQTT - Integration openHAB
Voraussetzung
Installation von MQTT Bindig
Installation von JSONPath Transformation
Beispiel Konfiguration
heatpumpMqtt.things file:
Bridge mqtt:broker:heatpump [ host="192.168.178.38", secure=false , port=61894, username="mqtt", password="80B56598 ",reconnectTime=30000, clientId="openhabClientHeatpump" ]{
Thing topic values {
Channels:
Type number : outsideTemp "Outside temperature " [ stateTopic="gateway/iothub/twin_reported_state", transformationPattern="JSONPATH:$.telemetry.1301a" ]
Type number : opMode_manual "Manual operation mode" [ stateTopic="gateway/iothub/twin_reported_state", transformationPattern="JSONPATH:$.telemetry.714i", commandTopic="gateway/modbus/set_value/714i", formatBeforePublish="{\"name\": \"714i\",\"value\":[\"%d\"],\"mqtt_msg_properties\": {\"correlation_data\": 0, \"response_topic\": \"extern/openhabClientHeatpump/response\"}}"]
}
}
heatpumpMqtt.items file:
Number Heatpump_OT "Outside temperature [%.1f °C]" {channel="mqtt:topic:heatpump:values:outsideTemp"}
Number Heatpump_opMode "Manual operation mode %s" {channel="mqtt:topic: heatpump:values:opMode"}