Function to write Netatmo measurement in Influx DB

I am using an influxdb-batch node (with telegraf) and send all netatmo data to it like this:

m = msg.payload.devices[0].dashboard_data


msg.payload = [
    {
        measurement:"netatmo",
        fields: m,
        tags:{
            weather:"internal"
        },
        timestamp: new Date()
    }];

return msg