Page 1 of 2
Limitless Plugwise for free
Posted: Sat Jan 11, 2014 9:46 pm
by Digit
Ah well, not totally fair and accurate, but let's say all you need is a small Linux board like a Raspberry Pi, Cubieboard, BeagleBone or something similar that can run Node.JS But who doesn't have one these days
This week I had an email conversation with someone who asked me if I had already finished moving Plugwise to Raspberry Pi. I hadn't at that time, but the question triggered me to re-explore the options I had and saw that I was mistakenly thinking that a module I found back in 2013 was only about switching and had no power monitoring functions. I was wrong! All I needed was covered by that module. After an hour or so I had it running on a Raspberry Pi, so after some hours of test-driving the module I finished moving Plugwise from a Windows XP VM to one of my RPi's this afternoon. Works like a charm!
Bye bye Source webserver, Windows VM, Belkin USB, ...
Ingredients:
-
Node.JS
- the
PlugwiseJS module;
- a wrapper of only 150 loc to fit PlugwiseJS into my system.
Plug the Stick into the Linux board and off you go!
Re: Limitless Plugwise for free
Posted: Sat Jan 11, 2014 10:45 pm
by RdP
Interesting.....
Like to know more about this. Does it really have feature parity with the source or is it more or less like the Stretch?
I mean, does it also have reports/graphs, schedules, daily usage etc?
I'm not at home this weekend, so I cannot give it a try on one of my RPi's
Thanks,
Rien
Re: Limitless Plugwise for free
Posted: Sat Jan 11, 2014 11:32 pm
by Digit
No, you can't compare it to "the Source". The Source is for 'the masses' I think, not for us

This is somewhat more low-level, based on Maartens "unleashed" work, although the output is very easy to work with.
Let me explain a bit more.
Before today, I used the Source web-server to periodically get an XML with new power usage info and to switch the Circles.
But the Source has always been a PITA for several reasons and I was looking for an alternative.
Reason for that is that I want to power down my 30W Hyper-V and end up with a large real-time HA system only consuming ~5W.
The Plugwise Source software prevented me from doing that.
With this new solution I am able to get power usage (Watt) and switch Circles and that's all I need... because I already have the rest in my own system.
So basically I only need the raw data, nothing more - in fact, anything more than that is plain ballast in my situation.
Reports, charts, schedules, historical data, I already have all that for a long time. For a simple temperature sensor to a boiler or security system.
So, what makes this solution so "special" to post about it (IMO)?
That you don't have to bother about the Plugwise protocol anymore but you
do get all the basic information and tools to build your own "Source" or embed Plugwise into your own HA system in a very comfortable & easy way - without the need to install a complete HA solution that you maybe don't want or need....
Conclusion: perfect for those that like to tinker with software!
Capice?

Re: Limitless Plugwise for free
Posted: Sat Jan 11, 2014 11:46 pm
by Digit
To make it even more clear of what you get:

- plugwise-Knipsel.PNG (40.02 KiB) Viewed 23940 times
Being able to display it in a console means you can do
anything with it

Re: Limitless Plugwise for free
Posted: Sun Jan 12, 2014 5:35 pm
by Phaeton
I'm not an software engineer, but with all you post about node.js you really tempt me Robert. Now even a plugwise solution! I really appriciate your blogs and interesting posts. It inspires. I dont't think I will be able to use these hints in the near future but it surely gives me a goal for the long run.
Re: Limitless Plugwise for free
Posted: Sun Jan 12, 2014 7:48 pm
by nico_gh2
Good work!
I have a RPi lying around so will give it a try later.
Is it only about circles or can scan/sense measurements be used as well?
Only exercise left for the reader is getting these values into a database and highcharts will do the rest.
Re: Limitless Plugwise for free
Posted: Sun Jan 12, 2014 10:18 pm
by Digit
@phaeton
I'm no software engineer either
My background is mechanical engineering/industrial automation (Robotics, CAD/CAM, CNC, that kinda stuff)
So you don't have to be...
@nico_gh2:
All credits go to the developer of the software (and that's not me). I only
found it
I can't say anything about scan/sense, cause I don't have those. Just give it a try...
Re: Limitless Plugwise for free
Posted: Mon Jan 13, 2014 12:43 pm
by jeroen_
Thus, if I get it correctly, as you are directly talking to the plugwise stick over serial, your data never leaves the network aka goes to the 'cloud' right?
As that would remove my objections to Plugwise (in the other thread about software/license updates and feature removals), at least to the hardware part...
Re: Limitless Plugwise for free
Posted: Mon Jan 13, 2014 9:28 pm
by Digit
You're 100% correct

Re: Limitless Plugwise for free
Posted: Mon Jan 13, 2014 9:31 pm
by roheve
jeroen_ wrote:Thus, if I get it correctly, as you are directly talking to the plugwise stick over serial, your data never leaves the network aka goes to the 'cloud' right?
Yes, that is right.
However you stil need the plugwise-source-software to configure your network (and add modules). But once it's configured, PlugWise BV can *not* trace you anymore, you don't need to start its 'source' programe again (still a silly and confusing name!).
This javascript sample does the same thing as what you can do with plugwise in, for example Domotiga, and a few other of those. What is implemented (i took a peek into the code on github) is just reading and translating the realtime statistics and switching modules on or of.
Some of the other commands could be easily added while others are more difficult (e.g groups and switching schedules), but doable. It all depend on what you want and how much time you want to spend configuring/programming/learning.
Somewhere else, I found an example script to configure your network and add a module (on a frensh blog). That got me started to look into that and also did some digging (and described that proces a bit on my blog two years ago). I only tested some parts of the protocol with tiny scripts, just to see how it worked, before I lost interest and used my free-time for other things...
Re: Limitless Plugwise for free
Posted: Wed Jan 15, 2014 11:51 pm
by Darwusch
roheve wrote:PlugWise BV can *not* trace you anymore, you don't need to start its 'source' programe again (still a silly and confusing name!).
It is a very logical name: It is the source for their information about our usage.

Re: Limitless Plugwise for free
Posted: Wed Jan 29, 2014 10:53 am
by remcokortekaas
Hi Robert,
Would you like to share your 150 lines of code 'for inspiration' also? I'm not a JS programmer but looking at your output, it converts Plugwise data to MQTT topcis, just what I need to get a heads start.
Thanks in advance
Remco.
Re: Limitless Plugwise for free
Posted: Wed Jan 29, 2014 9:54 pm
by Digit
Remco,
No problem. But I have to 'warn' you...the module I linked to has a memory leak.
Within 24 hours the amount of memory used will be sky-high and also CPU usage increases as well (on RPi: starts @ 0.1%, within 12 hours it's 4%, yuck).
This won't be that much of a problem on a multi-GB RAM desktop/laptop, but not something you'd like to have running on a RPi this way.
And since the module uses the Serialport module (which I've never been able to successfully compile on Windows) it's running on a RPi over here, but automatically restarted every 24 hours until I have had some time to look into the issue.
Besides that, it does what it's supposed to do

Re: Limitless Plugwise for free
Posted: Thu Jan 30, 2014 9:08 pm
by remcokortekaas
Thanks Robert. Memleak is no problem, I'm just trying to learn from your example so I will not just copy the code.
Regards,
Remco.
Re: Limitless Plugwise for free
Posted: Sun Feb 09, 2014 6:56 pm
by Borgso
Hi, this looks verry interesting.
I have some problem getting it to work, it seems i lack some file.
Havent worked much with node.js, but im familiar with linux shell.
Do you have a step-by-step instructions for how to get this setup?
Also link to all files needed..
Thanks in advance =)