Hey there. I’m using sqlite for storing my sensor’s readings. Had to create a string this way otherwise i was not able to load multiple records in one go. Heck, i was not able to use the placeholders either. Is there a more elegant way to insert multiple records?
msg.topic = insert into sensor_data (sensor_id, value, type) values (
+ msg.payload.sensor_id + ,+ msg.payload.temperature + ,1),(
+ msg.payload.sensor_id + ,+ msg.payload.humidity + ,2),(
+ msg.payload.sensor_id + ,+ msg.payload.battery + ,3)
return msg;
Thanks!