hello. i had a flow to get temp and humidity data from mqtt and send it Firebase real time database,
i sent temp data and humidity data to firebase succesfully. and i want to use temp and humidity data for room is "relaxing" conditions or "stressful". For example, if temp above 35 and humidity above 70, room is "stressful". Else "relaxing".
thank you for reply. it such an example that i wrote,there are 10 different contitions at orginal node. i also send sensor and condition data to MySQL for logging. after that use values from MySQL for how many times relaxed or stressed in a day or week.
As the temp and humdity are in separate messages you first need to combine them into one message, otherwise only one of them at a time is available in the function node (which only receives one message at a time). See this article in the cookbook for an example of how to join messages into one object.
thank you for reply. i already use join node. wait until 2 messages arrive and after function node run. i can define new topic, payload comes from if condition. debug show an object include topic, payload, msgid. but when i connected firebase, this message appeared;
"SyntaxError: Unexpected token m in JSON at position 0"
Your payload is not an object. You need to combine them not as topic and payload, you need a payload object with properties and perhaps as JSON string - which means you have to convert the object into a JSON string.