Plugwise MsAccess Database

Plugwise Forum about Plugwise devices and the Source software.
DJF3
Advanced Member
Advanced Member
Posts: 895
Joined: Thu Jul 12, 2007 9:28 am
Contact:

Plugwise MsAccess Database

Post by DJF3 »

Is the Plugwise data available through MS Access? (so I could write some code that generates graphs based on the .MDB data?)
Bwired
Administrator
Administrator
Posts: 4704
Joined: Sat Mar 25, 2006 1:07 am
Location: Netherlands
Contact:

Plugwise MsAccess Database

Post by Bwired »

Yes you can but you have to figure out the data! It looks like there are some internal functions translating the data before putting it in the database.
DJF3
Advanced Member
Advanced Member
Posts: 895
Joined: Thu Jul 12, 2007 9:28 am
Contact:

Plugwise MsAccess Database

Post by DJF3 »

Just noticed that after running Plugwise (w/9 circles) for about a day, the database file in "\program files\plugwise\plugwise source\db" seems to be untouched. No changes, updates, data, etc.

Is Plugwise storing usage data in this DB or not?

DJ
User avatar
TANE
Forum Moderator
Forum Moderator
Posts: 4806
Joined: Fri Apr 06, 2007 9:46 pm
Location: Netherlands
Contact:

Plugwise MsAccess Database

Post by TANE »

actual DB is in the user profiles
DJF3
Advanced Member
Advanced Member
Posts: 895
Joined: Thu Jul 12, 2007 9:28 am
Contact:

Plugwise MsAccess Database

Post by DJF3 »

<grin>
I overlooked that.. Thanks!
Quart
Starting Member
Starting Member
Posts: 14
Joined: Wed Jan 21, 2009 2:43 pm
Location: Sweden
Contact:

Re: Plugwise MsAccess Database

Post by Quart »

I am trying to get this to work as well.
I want to use the accessdatabase to see how much things has been consuming past 12h,24h and past week.
Has anybody find a way to get datafrom the accessdatabase to a webpage.
On my webpage today (www.sundshult.se/wxplugwise.php) I measure total energy and what my heating (bergvärme=heat from the ground) consumes .
It would also be interesting to see charts from my plugwise units are Consuming.

visit www.sundhult.se and under "elförbrukning" I have a lot og energy measures, se also my charts on the same page, ist a link called grafer......
Reinder
Member
Member
Posts: 220
Joined: Sun Jan 13, 2008 12:57 am
Location: Netherlands

Re: Plugwise MsAccess Database

Post by Reinder »

I think it's easier to use the build in Webserver in the Source. This provides also creating graphs, just copy the code from the example html to your website. :)
Koen Zomers
Starting Member
Starting Member
Posts: 20
Joined: Mon Aug 01, 2011 12:28 am

Re: Plugwise MsAccess Database

Post by Koen Zomers »

I'm also looking for a way to extract the data towards my own software. So far the best option I've found is by tracing the Ajax calls the built in webserver is making to update its views. Its calling http://localhost: webserver port>/_graphview.pte?cmd=appliances every few seconds to retrieve a small set of HTML containing the actual values. Would be easy to write a regular expression to filter the actual data from the HTML crap that is being sent along. The developers at Plugwise clearly did not understand how Ajax is supposed to work if they send along HTML :lol:
User avatar
Rene
Global Moderator
Global Moderator
Posts: 1689
Joined: Wed Oct 08, 2008 3:54 pm
Location: Netherlands

Post by Rene »

Use the scripting features of the webserver to create a page that outputs all required data in xml when requested. This is an easy way to integrate the data in your own application.
Koen Zomers
Starting Member
Starting Member
Posts: 20
Joined: Mon Aug 01, 2011 12:28 am

Re: Plugwise MsAccess Database

Post by Koen Zomers »

Thanks for the info Rene. Do you have some pointers to documentation or samples how this can be done? Sounds like exactly what I'm looking for. I am getting the "Not licensed for extended scripting" error when visiting the webinterface of Plugwise. Is that a problem? Any idea whats causing this?
User avatar
Rene
Global Moderator
Global Moderator
Posts: 1689
Joined: Wed Oct 08, 2008 3:54 pm
Location: Netherlands

Re: Plugwise MsAccess Database

Post by Rene »

In the www directory of your Plugwise installation there is a directory called doc and this contains a PDF describing the scripting features.
Rene.
Koen Zomers
Starting Member
Starting Member
Posts: 20
Joined: Mon Aug 01, 2011 12:28 am

Re: Plugwise MsAccess Database

Post by Koen Zomers »

Thanks Rene. Found it. For others interested in this as well, I have made the manual available for direct download at files.koenzomers.nl/Plugwise_Source_Tem ... Engine.pdf
Koen Zomers
Starting Member
Starting Member
Posts: 20
Joined: Mon Aug 01, 2011 12:28 am

Re: Plugwise MsAccess Database

Post by Koen Zomers »

The error "Not licensed for extended scripting" prevents one from using the script extensions. Sending your Plugwise Source license key to helpdesk@plugwise.com requesting your license to be upgraded to include the script extensions will have them upgrade your license for free.
DJF3
Advanced Member
Advanced Member
Posts: 895
Joined: Thu Jul 12, 2007 9:28 am
Contact:

Re: Plugwise MsAccess Database

Post by DJF3 »

Quick question regarding the Charts.. I'm able to create nice charts with a single URL. That's the simple part.

Now I would like to create charts with custom colors but I have no idea how. Does anyone have example code of a chart with different colors (background, bars, etc).

When that works I'll document it and post it on my website.

Thank you!
DJ
Koen Zomers
Starting Member
Starting Member
Posts: 20
Joined: Mon Aug 01, 2011 12:28 am

Re: Plugwise MsAccess Database

Post by Koen Zomers »

I found out that there's actually already a lot of good stuff available by default in the Plugwise webinterface that can perfectly be used to extract the data. For example:

http://localhost:8080/api/data.xml?type=appliances

Will output a perfectly fine XML file with all your devices, its status, current usage, device name, status, etc.

Turning a device on or off or setting its lock status can easily be done via:

http://localhost:8080/api/actions.html? ... tchon&id=1

In which the option can be: switchon, switchoff, lockon or lockoff and the Id represents the Id of the device in Plugwise.

The documentation about both of these can be found at http://localhost:8080/api/index.html

There's even a RSS feed to subscribe to by default. This can be found at:

http://localhost:8080/rss/example.xml

This displays the status of all devices in a nicely formatted RSS feed. The template of this RSS feed can easily be edited by customizing the file in C:\Program Files (x86)\Plugwise\Plugwise Source\www\rss\example.xml.

Awesome stuff!
Post Reply

Return to “Plugwise Forum”