def his_write(data)
      query =
        ["ver:\"#{haystack_project.haystack_version}\" id:@#{self.haystack_point_id}",'ts,val'] + data.map{ |d| "#{d[:time]},#{d[:value]}"}

      res = connection.post('hisWrite') do |req|
        req.headers['Content-Type'] = 'text/plain'
        req.body = query.join("\n")
      end

      JSON.parse(res.body)['meta']['ok'].present?
    end
def his_write(data)
      query =
        ["ver:\"#{haystack_project.haystack_version}\" id:@#{self.haystack_point_id}",'ts,val'] + data.map{ |d| "#{d[:time]},#{d[:value]}"}

      res = connection.post('hisWrite') do |req|
        req.headers['Content-Type'] = 'text/plain'
        req.body = query.join("\n")
      end

      JSON.parse(res.body)['meta']['ok'].present?
    end
data is ascending array of hashes with format: {time: epochtime, value: myvalue}