Hi, I am trying to filter incoming MQTT messages that all have the same topic, however different payload objects.
I have a rtl_433 that i am using to pick up the signal from my outdoor weather station. I then wish to take this data and display it.
The problem that i am having is that i am also receiving data from a solar controller so am unable to just set msg.payload to msg.payload.temperature for example, as both the solar controller and the weather station has this in the object.
My thought has been to only pass payloads that contain the payload object "model" : "Bressier".
All i seem to be able to do is pass only the model data and not the rest of the objects in that payload. However this is where my knowledge has ran out and i am struggling and would like some guidance.
I understand what you mean as everywhere i have looked, read and watched all the MQTT topics seem to be unique to the device for example rtl_433/Marlec-solar or rtl_433/Honda-Remote. But if you look at the attached screen shot that i have just taken that is not the case. The unique identifier seem to be in the payload object "Model"
As I wrote before, just use the "switch" node to add a filter that only let the payload pass that have an explicit key! Wait until you have a payload in the debug from your wheather station and find an unique key. Then filter it!
How do you know that is a message that comes from the weather station?
Just you are saying you are getting incorrect messages that are NOT weather messages.
So how do you know that is a valid message?
It could be one of those unwanted ones.
Andrew the rtl device is a radio receiver. It doesn’t know what things are sending what messages apart from what is in the received payload. So we need to identify something unique in the payload first before we can assign that to the topic.
The rtl device is a radio receiver that listens to all transmissions on a certain frequency and then converts the received data into a usable format like my screenshot above.
Then after being received by NR (and MQTT) you need to route the messages depending on something in their message.
That is correct, When i receive a message where the "Model" : "Bresser-5in1" is found in the payload, I wish to forward the entire contents of that payload on
Sorry i haven't included a screen shot of the debug for the weather station, it seems to be a little temperamental in sending data at the moment.
I think there are enough people helping you here now.
Yes, it seems you need to use the switch node to filter the messages.
I don't want to start a pissing contest to who is the better one to help.
I got it wrong when I replied and didn't understand the problem.