[SOLVED] Issue with mqtt Broker Binding configuration

Hi there,

I am not sure, why my configuraiton does not work.

mqtt:broker:mymqtt [ host="192.168.178.55", secure=false ]
{

   Thing mqtt:topic:AM_Temp {
        Channels:
         Type Number : tmemp "Am Temperatur" [ stateTopic="zigbee2mqtt/Temperatur_AM", commandTopic="zigbee2mqtt/Temperatur_AM/temperature" ]
         Type Number : humi "Am Luftfeuchtigkeit" [ stateTopic="zigbee2mqtt/Temperatur_AM", commandTopic="zigbee2mqtt/Temperatur_AM/humidity" ]
   }
}

It seems not very complicated to me, but still I was fighting with it for some hours now.

The Logfile says

2019-01-25 14:47:48.117 [WARN ] [el.core.internal.ModelRepositoryImpl] - Configuration model 'mqtt.things' has errors, therefore ignoring it: [4,4]: missing '}' at 'Thing'

[6,11]: mismatched input 'Number' expecting RULE_ID

[6,27]: mismatched input '"Ammar Temperatur"' expecting ':'

[6,48]: missing '}' at 'stateTopic'

[6,88]: no viable alternative at input 'commandTopic'

[7,54]: no viable alternative at input 'stateTopic'

[7,94]: no viable alternative at input 'commandTopic'

But the missing } seems not to be true.

Any idea?

regards

Try

Bridge

and

Thing topic Temperatur_AM

and also change the Number to number.

Example:

Bridge mqtt:broker:mymqtt [ host="192.168.178.55", port=1883, secure=false ]
{

   Thing topic Temperatur_AM {
        Channels:
         Type number : tmemp "Am Temperatur" [ stateTopic="zigbee2mqtt/Temperatur_AM", commandTopic="zigbee2mqtt/Temperatur_AM/temperature" ]
         Type number : humi "Am Luftfeuchtigkeit" [ stateTopic="zigbee2mqtt/Temperatur_AM", commandTopic="zigbee2mqtt/Temperatur_AM/humidity" ]
   }
}

You may also need to use a transformation for the temp and humidity?
Here is a sonoff example I use for temp and humidity.

 // Sonoffs
    Thing topic sonoff11 "Living Room Light" @ "Living Room" {
    Channels:
        Type switch : power       "Power"         [ stateTopic="stat/sonoff11/POWER", commandTopic="cmnd/sonoff11/POWER" ]
        Type number : temperature "Temperature"   [ stateTopic="tele/sonoff11/SENSOR", transformationPattern="JSONPATH:$.SI7021.Temperature" ]
        Type number : humidity    "Humidity"      [ stateTopic="tele/sonoff11/SENSOR", transformationPattern="JSONPATH:$.SI7021.Humidity" ]
    }

Hi H102,

thanks for the tip, did not see it all the time :smile:

Now it works

regards