Upload to pachube

Requests for future functionality

Moderator: Mattk

Post Reply
stefferber
Senior Boarder
Senior Boarder
Posts: 44
Joined: Sun Sep 25, 2011 7:48 pm

Upload to pachube

Post by stefferber »

I could not find a build in way in metehub to upload data to http://www.pachube.com.
Did I miss the information? Is there a plan for this?
stefferber
Senior Boarder
Senior Boarder
Posts: 44
Joined: Sun Sep 25, 2011 7:48 pm

Re: Upload to pachube

Post by stefferber »

Looks like nobody has a solution yet. Here is what I would propse and maybe you give me a feedback before I start implementing.

The goal is to produce an xml file accorinding to this style sheet http://www.eeml.org/ and send it to http://www.pachube.com feed. Pachube offers both push and pull.
  • As I could not find a configurable "http push" in meteohub I will use the ftp upload mechanism.
  • Putting a html file at "/graphs/pachube-template.html"
  • Graph Uploads selecting "pachube-template *" every 5 Minutes with the target filename "pachube.xml"
  • Configuring my web-page for FTP in "Set up Push services"
  • Configuring the pachube feed to fetch the "pachube.xml" file from my web-site
Anything wrong with this?
stefferber
Senior Boarder
Senior Boarder
Posts: 44
Joined: Sun Sep 25, 2011 7:48 pm

Re: Upload to pachube

Post by stefferber »

Today I finished the above implementation. Below you find one template file for this feed https://pachube.com/feeds/2056:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<eeml xmlns="http://www.eeml.org/xsd/0.5.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="0.5.1" xsi:schemaLocation="http://www.eeml.org/xsd/0.5.1 http://www.eeml.org/xsd/0.5.1/0.5.1.xsd">
  <environment>
    <data id="0">
      <current_value>[actual_thb0_temp_c]</current_value>
    </data>
    <data id="1">
      <current_value>[actual_th1_temp_c]</current_value>
    </data>
    <data id="6">
      <current_value>[actual_t6_temp_c]</current_value>
    </data>
    <data id="7">
      <current_value>[actual_thb0_hum_rel]</current_value>
    </data>
    <data id="8">
      <current_value>[actual_th1_hum_rel]</current_value>
    </data>
    <data id="13">
      <current_value>[actual_thb0_sealevel_hpa]</current_value>
    </data>
    <data id="14">
      <current_value>[actual_wind0_speed_kmh]</current_value>
    </data>
    <data id="15">
      <current_value>[actual_wind0_dir_deg]</current_value>
    </data>
    <data id="16">
      <current_value>[hour1_rain0_total_mm]</current_value>
    </data>
  </environment>
</eeml>
I have one problem left. How to change the formatting of the date-time string and time-zone in meteohub to the pachube format? Here is one example:

Code: Select all

Meteohub:  "20111223173934"
has to become

Code: Select all

Pachube: "2011-12-23T16:39:34.894650Z"
Any ideas?
stefferber
Senior Boarder
Senior Boarder
Posts: 44
Joined: Sun Sep 25, 2011 7:48 pm

Re: Upload to pachube

Post by stefferber »

Pachube can be triggered to send messages e.g. for twitter. Here is my first "debugging" event from my weather station. Really fun! Check out yourself at
https://twitter.com/#!/Stefferber
wfpost
Platinum Boarder
Platinum Boarder
Posts: 591
Joined: Thu Jun 12, 2008 2:24 pm
Location: HONSOLGEN
Contact:

Re: Upload to pachube

Post by wfpost »

stefferber wrote: I have one problem left. How to change the formatting of the date-time string and time-zone in meteohub to the pachube format? Here is one example:

Code: Select all

Meteohub:  "20111223173934"
has to become

Code: Select all

Pachube: "2011-12-23T16:39:34.894650Z"
Any ideas?

Code: Select all

[actual_date0_year_local]-[actual_date0_month_local]-[actual_date0_day_local]T[actual_date0_hour_local]:[actual_date0_min_local]:[actual_date0_sec_local].894650Z
stefferber
Senior Boarder
Senior Boarder
Posts: 44
Joined: Sun Sep 25, 2011 7:48 pm

Re: Upload to pachube

Post by stefferber »

Thanks a lot "wfpost"! This explain my syntax question very well.
But leads to the next question: Which time is measured here?
  • Let's assume a sensor captures a value at time t0.
  • The sensor transmitts data later to its console at time t1 (+ 2 min).
  • The console sends data to meteohub at time t2 (+ 5 min).
  • Meteohub publishes data to weather network at time t3 (+ 5 min).
As far as I understand the meteohub documentation, the above code would put time t3 in the html file, correct?
The difference between t0 and t3 could be 12 Min!
But I want to have time t0 in this file. How do get this information?
Post Reply