Hi,
I try to parse MQTT message coming from domoticz (topic domoticz/out)
The content of the messages is JSON
Examples :
2015-10-01 21:54:25,493 INFO [log] {
“Battery” : 100,
“RSSI” : 12,
“dtype” : “Temp”,
“id” : “3073”,
“idx” : 45,
“name” : “Temperature”,
“nvalue” : 0,
“stype” : “TFA 30.3133”,
“svalue1” : “22.8”,
“unit” : 1
}
2015-10-01 21:54:25,473 INFO [log] {
“Battery” : 100,
“RSSI” : 12,
“dtype” : “Lux”,
“id” : “0000C03”,
“idx” : 44,
“name” : “Luminosite”,
“nvalue” : 0,
“stype” : “Lux”,
“svalue1” : “30”,
“unit” : 255
}
In my Item, I want to get the svalue1 of sensor name “Luminosite”
I defined it like that:
String LuminositeSensor “Luminosité [%s]” (g1) {mqtt="<[mqttserver:domoticz/out:state:JSONPATH($.svalue1):REGEX(.*“Luminosite”.*)]"}
But I didn’t success in filtering the correponding message, it is skipped…
2015-10-02 00:00:01.574 [DEBUG] [.o.b.m.i.MqttMessageSubscriber] - Skipped message '{
“Battery” : 100,
“RSSI” : 12,
“dtype” : “Lux”,
“id” : “0000C03”,
“idx” : 44,
“name” : “Luminosite”,
“nvalue” : 0,
“stype” : “Lux”,
“svalue1” : “20”,
“unit” : 255
}
’ because Message Filter ‘REGEX(.*“Luminosite”.*)’ does not apply.
despite the regex pattern seems to match …
https://regex101.com/r/nG0eL9/27
any idea of how to define the mqtt binding rule to filter the correct sensor ?
Thanks
Romain