codegrau
(codegrau)
September 3, 2018, 5:19pm
1
Hi there, looking forward to your help with my MQTT + Item + JSONPATH problem. mqtt is working but I can’t get this one right.
Incoming MQTT message
topic : this/is/th:et:op:ic
payload: {"test":"100"}
String VeryMuchHelpNeeded {mqtt="<[mosquitto:this/is/th:et:op:ic:state:JSONPATH($.test)]"}
isn’t working. Any idea how to solve this? I cannot alter the topic (because those are MAC addresses) btw
codegrau
(codegrau)
September 3, 2018, 6:42pm
2
I keep thinking it’s the colons in that topic.
H102
(CM6.5 H102)
September 3, 2018, 7:22pm
3
Yes, I think you are correct about the colons. I think its usually on 4 parts ( 3 colons ) to a message being received by OH.
What error does your log show?
Try to escape the colons with \ :
String VeryMuchHelpNeeded {mqtt="<[mosquitto:this/is/th\:et\:op\:ic:state:JSONPATH($.test)]"}
codegrau
(codegrau)
September 3, 2018, 10:06pm
5
Escaping didnt work:
[el.core.internal.ModelRepositoryImpl] - Configuration model 'mqtt.items' has errors, therefore ignoring it: [32,34]: mismatched character ':' expecting set null
[32,72]: mismatched input '9C' expecting RULE_STRING
[33,117]: mismatched character '<EOF>' expecting '"'
codegrau
(codegrau)
September 3, 2018, 10:10pm
6
[ERROR] [el.item.internal.GenericItemProvider] - Binding configuration of type 'mqtt' of item 'VeryMuchHelpNeeded' could not be parsed correctly.
org.eclipse.smarthome.model.item.BindingConfigParseException: Configuration 'mosquitto:this/is/th:et:op:ic:state:JSONPATH($.test)]' is not a valid inbound configuration: Configuration requires 4 or 5 parameters separated by ':'
So - any workaround around the colons?
codegrau
(codegrau)
September 3, 2018, 10:17pm
8
@namraccr - I LOVE YOU thank you very much!
vzorglub
(Vincent Regaud)
September 3, 2018, 11:37pm
10
This should be added to the binding documentation