Building private history information with the Stretch

Plugwise Forum about Plugwise devices and the Source software.

Building private history information with the Stretch

Postby Post-IT » Fri Apr 12, 2013 11:01 pm

Plugwise might have a nice interface, but I want to fill my own database with historical information so I can visualise and store the information the way I would like to (and without extra cost).

So far I've taken a look at the different xml outputs. The Stretch shows a slightly different output then Source.

Stretch URL /minirest/appliances shows:
Code: Select all
<appliance id="1889f71584e042d494301fc91d99745">
<name>Opladers</name>
<type>charger</type>
<created_date>2013-04-11T11:03:53+00:00</created_date>
<modified_date>2013-04-12T08:45:49+00:00</modified_date>
<last_seen_date>2013-04-12T08:45:49+00:00</last_seen_date>
<power_state>on</power_state>
<current_power_usage>2.5</current_power_usage>
<do_not_switch_off>false</do_not_switch_off>
<last_known_measurement_date>2013-04-12T08:45:49+00:00</last_known_measurement_date>
<module id="3a9bf45071d427998d283a3f5c81a2a"/>
<groups/>
</appliance>


Stretch URL /minirest/modules shows:
Code: Select all
<module id="3a9bf45071d427998d283a3f5c81a2a">
<mac_address>000D6F0000236A54</mac_address>
<name>00236A54</name>
<type>2</type>
<hardware_version>0000-0440-0107</hardware_version>
<firmware_version>2011-06-27</firmware_version>
<created_date>2013-04-11T10:57:49+00:00</created_date>
<modified_date>2013-04-12T08:12:01+00:00</modified_date>
<last_seen_date>2013-04-12T08:12:01+00:00</last_seen_date>
<power_state>on</power_state>
<current_power_usage>2</current_power_usage>
<last_known_measurement_date>2013-04-12T08:12:01+00:00</last_known_measurement_date>
<network id="173a244314d4439b87a6f3eae572f03"/>
<appliance id="1889f71584e042d494301fc91d99745"/>
</module>



Stretch URL /appliances/interval_logs shows:
Code: Select all
<appliance id="1889f71584e042d494301fc91d99745">
<interval_logs>
<interval_log id="612b2f5936444a858176957e63410c34">
<unit>Wh</unit>
<type>electricity_consumed</type>
<last_consecutive_log_date>2013-04-12T20:00:00+00:00</last_consecutive_log_date>
<updated_date>2013-04-12T21:01:14.317+00:00</updated_date>
<period start_date="2013-04-11T08:00:00+00:00" end_date="" interval="PT1H">
<measurement log_date="2013-04-12T14:00:00+00:00">2.07</measurement>
<measurement log_date="2013-04-11T21:00:00+00:00">4.52</measurement>
<measurement log_date="2013-04-11T13:00:00+00:00">2.06</measurement>
<measurement log_date="2013-04-12T06:00:00+00:00">2.06</measurement>
<measurement log_date="2013-04-11T22:00:00+00:00">2.76</measurement>
<measurement log_date="2013-04-11T14:00:00+00:00">2.07</measurement>
<measurement log_date="2013-04-12T16:00:00+00:00">2.07</measurement>
<measurement log_date="2013-04-11T23:00:00+00:00">2.53</measurement>
<measurement log_date="2013-04-11T15:00:00+00:00">2.06</measurement>
<measurement log_date="2013-04-12T00:00:00+00:00">4.32</measurement>
<measurement log_date="2013-04-11T16:00:00+00:00">2.06</measurement>
<measurement log_date="2013-04-12T18:00:00+00:00">1.12</measurement>
<measurement log_date="2013-04-11T08:00:00+00:00">1.62</measurement>
<measurement log_date="2013-04-12T10:00:00+00:00">2.08</measurement>
<measurement log_date="2013-04-11T17:00:00+00:00">2.07</measurement>
<measurement log_date="2013-04-11T09:00:00+00:00">1.62</measurement>
<measurement log_date="2013-04-12T02:00:00+00:00">3.67</measurement>
<measurement log_date="2013-04-11T18:00:00+00:00">2.08</measurement>
<measurement log_date="2013-04-12T19:00:00+00:00">1.12</measurement>
<measurement log_date="2013-04-12T20:00:00+00:00">2.49</measurement>
<measurement log_date="2013-04-11T10:00:00+00:00">1.62</measurement>
<measurement log_date="2013-04-12T17:00:00+00:00">1.87</measurement>
<measurement log_date="2013-04-12T12:00:00+00:00">2.07</measurement>
<measurement log_date="2013-04-11T19:00:00+00:00">2.08</measurement>
<measurement log_date="2013-04-12T15:00:00+00:00">2.08</measurement>
<measurement log_date="2013-04-11T11:00:00+00:00">1.62</measurement>
<measurement log_date="2013-04-12T03:00:00+00:00">2.86</measurement>
<measurement log_date="2013-04-12T09:00:00+00:00">2.07</measurement>
<measurement log_date="2013-04-12T13:00:00+00:00">2.06</measurement>
<measurement log_date="2013-04-12T04:00:00+00:00">2.86</measurement>
<measurement log_date="2013-04-12T05:00:00+00:00">2.44</measurement>
<measurement log_date="2013-04-12T01:00:00+00:00">5.73</measurement>
<measurement log_date="2013-04-11T20:00:00+00:00">3.59</measurement>
<measurement log_date="2013-04-12T11:00:00+00:00">2.09</measurement>
<measurement log_date="2013-04-12T08:00:00+00:00">2.05</measurement>
<measurement log_date="2013-04-11T12:00:00+00:00">1.92</measurement>
<measurement log_date="2013-04-12T07:00:00+00:00">2.05</measurement>
</period>
</interval_log>
<interval_log id="e72cc31866744b1cb87a0b5a1a4e9fb6">
<unit>Wh</unit>
<type>electricity_produced</type>
<last_consecutive_log_date/>
<updated_date/>
</interval_log>
</interval_logs>
</appliance>


Source URL /statistics.xml shows:
Code: Select all
<appliance>
<id>11</id>
<name>Miscellaneous 1</name>
<type>- Miscellaneous -</type>
<image>/pwimg/32/zz_misc_unknown.png</image>
<locked>False</locked>
<realstate>unknown</realstate>
<powerstate>unknown</powerstate>
<powerusage>0</powerusage>
<totalusage>6918</totalusage>
<moduleid>12</moduleid>
<macaddr>000D6F00002362D8</macaddr>
<moduletype>Circle</moduletype>
<room>- Miscellaneous -</room>
</appliance>


So I'm clearly missing the "totalusage" in the new situation. Now the question is, how can I build the historical information with the output from the Stretch?
Post-IT
Member
Member
 
Posts: 444
Joined: February 2009
Location: Netherlands (Rotterdam)

Re: Building private history information with the Stretch

Postby Rene » Sat Apr 13, 2013 8:05 am

Statistics.xml shows totalusage?
Rene.
User avatar
Rene
Global Moderator
Global Moderator
 
Posts: 1687
Joined: October 2008
Location: Netherlands

Re: Building private history information with the Stretch

Postby Post-IT » Sat Apr 13, 2013 11:11 am

statistics.xml is only available in Source, not on the Stretch.
Post-IT
Member
Member
 
Posts: 444
Joined: February 2009
Location: Netherlands (Rotterdam)

Re: Building private history information with the Stretch

Postby Rene » Sat Apr 13, 2013 11:16 pm

Ah, was not paying attention
Rene.
User avatar
Rene
Global Moderator
Global Moderator
 
Posts: 1687
Joined: October 2008
Location: Netherlands

Re: Building private history information with the Stretch

Postby Post-IT » Sat Apr 13, 2013 11:49 pm

I hope to adjust or add some xml files to the webroot of the Stretch, or maybe find other files/links which would help me.

I've tried to get a terminal connection using a usb-serial cable as described here: http://phoenixinteractive.mine.nu/websi ... ?f=27&t=43
However my efforts are without luck so far, the terminal output is scrambled and I've tried several speedsettings.

Hopefully I'll get it to work in the near future...
Post-IT
Member
Member
 
Posts: 444
Joined: February 2009
Location: Netherlands (Rotterdam)

Re: Building private history information with the Stretch

Postby RdP » Sun Apr 14, 2013 8:33 am

This summer Plugwise will make an public API available for the Stretch, this would probably make it much easier to interface with the Stretch.

/Rien
Rien
User avatar
RdP
Advanced Member
Advanced Member
 
Posts: 948
Joined: May 2006
Location: Netherlands

Re: Building private history information with the Stretch

Postby Post-IT » Sun Apr 14, 2013 8:38 am

Indeed that's what they've told me also, however they've also told me the Stretch would be launched this spring and this autumn... the past few years. And I think the API will only concentrate on switching and current usage, not on collection of historical data. This would make their portal useless.

And switching and current usage I have already working.
Post-IT
Member
Member
 
Posts: 444
Joined: February 2009
Location: Netherlands (Rotterdam)

Re: Building private history information with the Stretch

Postby hapklaar » Sat Jan 24, 2015 1:42 pm

I'm sorry to have to add to such an old topic, but I was wondering if you made any progress on this.

I'm currently graphing Plugwise data in Zabbix, but found http://192.168.x.x/minirest/appliances often gives me 0 power usage for certain Circles when it shouldn't. This only happens for some modules, no idea why that is. (<current_power_usage>0</current_power_usage>). Maybe anyone else ran into this issue as well?

I found http://192.168.x.x/core/appliances is in fact returning valid figures for the modules all the time, but I still have to reconfigure the xml parse script I use to be able to read the xml this command returns.

This is an example of what I'm getting in Zabbix now.

Image
hapklaar
Starting Member
Starting Member
 
Posts: 6
Joined: January 2015

Re: Building private history information with the Stretch

Postby Post-IT » Sat Jan 24, 2015 4:16 pm

I haven't taken the time to look at this. I've noticed in the releasenotes of the new firmware there should be some more info about historical usage in the XML output. However I don't want to upgrade yet as I hope to get root access to the stretch using some exploits.
Post-IT
Member
Member
 
Posts: 444
Joined: February 2009
Location: Netherlands (Rotterdam)


Return to Plugwise Forum

Who is online

Users browsing this forum: No registered users and 3 guests

cron