I have a rtl-sdr stick set up to receive 433.92MHz messages, and I have three temperature sensors around the house. This is my current flow:
Get MQTT-messages -> translate from JSON to JS object -> Filter what i want -> Switch to actually filter what I want -> Retransmit to MQTT on another topic
It’s the “Filter what I want -> Switch to actually filter what I want” part of the flow I’m not quite sure how to do. What I do now works, it just seems so hodge podge…
The filter function is like this:
let mySensors = [9, 197, 89];
msg.payload.forward = mySensors.includes(msg.payload.id);
return msg;
And then the switch sends the payloads with “forward” set to true to the new MQTT-topic.
Would you have done this any different?
(The stray link in the flow just goes to a debug node)