I have multiple assets with MQTT agent links. The payloads that are received sometimes do not contain the specific object keys that the JSON path has for the specific attribute. In this case, the attribute value is set to 0 where actually it needs to be left as is with whatever was the final value.
I tried to set the messageMatchFilters and messageMatchPredicate thinking this was their purpose but with no luck.
I am sorry, unfortunately I don’t know how to solve it but I was hoping you could help me clear out something.
If I understand correctly, in the case that you are describing you are receiving data from a temperature sensor and then sending it to a subscribed MQTT agent.
Is the sent data going back to another python code or does it stay in OpenRemote?
If so, how do you manage to send in the data to the MQTT agent, I don’t manage to figure out how to send data to another agent… al I can do is enable a subscription but I do not understand how the agent is supposed to receive the data.
Dear Casentive, no actually I am only receiving data via MQTT using the agent. The attribute values are getting their values based on the json path that is applied to the MQTT message payload being received.
Your understanding of the intent of message match predicate is correct but…
When I created the MQTTAgent I didn’t anticipate needing message match predicate; generally MQTT subscription should be specific enough to already ensure it receives a publish with a valid payload but I guess that isn’t the case here.
I can look to make a change to the MQTTAgent so that it respects the message match predicate if it is set so that way a publish will be evaluated by applying any message match filters and then applying the message match predicate.
P.S. your message match filter is un-necessary as it just returns the whole string, but guess you were just experimenting.
Let me know if this is of use to you so I can figure out a priority on an update.