title: node-red split values from webserver
body: <p>I am trying to node-red to poll the webserver in my Daikin heat pump to get inside and outside temeperatures so I can log them against the schedule I've also configured the unit with.</p>
  
  <p>When polling it for the values, it returns this string of text</p>
  
  <blockquote>
    <p>"ret=OK,htemp=21.5,hhum=-,otemp=18.0,err=0,cmpfreq=0"</p>
  </blockquote>
  
  <p>I use this code in a node-red function to split them at the commas</p>
  
  <pre><code>msg.payload = msg.payload.split(",");
  return msg;
  </code></pre>
  
  <p>It returns an array with 6 fields like this:</p>
  
  <pre><code>array[6]
  0: "ret=OK"
  1: "htemp=21.5"
  2: "hhum=-"
  3: "otemp=18.0"
  4: "err=0"
  5: "cmpfreq=0"
  </code></pre>
  
  <p>This is then put into influxdb by node-red with the numeric fields of the array being the fields created.</p>
  
  <p>I'm unable to analyse this data because it has the text in the fields that end up in the influxdb. I can't work out how to remove the text to the left of and including the = sign without creating errors in node-red.</p>
  
  <p>As a minimum, I'd like the data to be like this:</p>
  
  <pre><code>array[6]
  0: "OK"
  1: "21.5"
  2: "-"
  3: "18.0"
  4: "0"
  5: "0"
  </code></pre>
  
  <p>Even better would be to use the text to the left of the = sign as the field values in the array so they populate in influxdb. This would make analyics easier.</p>
  
  <p>It would then look like this(extra spaces to line up colons for readability):</p>
  
  <pre><code>    array[6]
      ret: "OK"
    htemp: "21.5"
     hhum: "-"
    otemp: "18.0"
      err: "0"
  cmpfreq: "0" 
  </code></pre>
  
  <p>I know the syntax is javascript based, but I'm not strong enough in the area to figure this one out. I've been at it for a day and have had no luck.</p>
  
  <p>Thanks!</p>
  
  <p>P.S. for anyone who owns a Daikin US7 with Wifi and wants to control it over IP, I've been using <a href="https://github.com/ael-code/daikin-control" rel="nofollow noreferrer">this repo</a> to get the values I need to send to the webserver.</p>
  
  <p><strong>Updates with requested info</strong></p>
  
  <p>InfluxDB is v0.10.0, webui says go1.6rc1
  Node-RED is v.0.16.2
  Node-RED is using node-red-contrib-influxdb v0.1.1</p>
  
  <p>When I used this code in the function:</p>
  
  <pre><code>msg.payload = msg.payload.split(",").split("=")[0];
  return msg;
  </code></pre>
  
  <p>I got this error when putting a debug tag on the output of the function:</p>
  
  <pre><code>function : (error)
  "TypeError: msg.payload.split(...).split is not a function"
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/xQHy5.png" rel="nofollow noreferrer">flow layout and error</a></p>