That makes sense! Good to know.
Sorry but an issue has just occurred. The code I have inside the function is this:
var sqliteTimeStamp = Math.round(Date.now() / 1000);
var temp = msg.payload["loungeSensor/temp"]; // << or whatever the copy path gives you
var humi = msg.payload["loungeSensor/humi"]; // << or whatever the copy path gives you
msg.topic = `INSERT INTO lounge_sensors (date, temperature, humidity) VALUES ('${sqliteTimeStamp}', '${temp}', '${humi}')`
return msg;
The problem is that when checking the table inside phpLiteAdmin I've noticed the readings are duplicated (see screenshot). I've also tested this putting 4 sensors with the same set up and I get in the table the readings duplicated X4.
Any thoughts?
EDIT:
Zenofmud, I can't make further posts due to reaching max of replies as a new user... so I have edited this reply. Here is the screenshot of my flow: