Module.GetPowerUsage(timeout,retries)

Plugwise Forum about Plugwise devices and the Source software.
Post Reply
frens
Starting Member
Starting Member
Posts: 3
Joined: Wed Dec 23, 2009 4:51 pm

Module.GetPowerUsage(timeout,retries)

Post by frens »

Hi all,

I wanted to share with you a finding I did when working with the Plugwise Source webserver:

I was a bit bothered by the refresh interval of the current power information on modules / appliances. I'm using the plugwise hardware in combination with a custom scheduler (mixing in simulated device etc ...). But for this I needed pretty up to date information on the current power usage (more in the line of seconds instead of minutes).

My solution is based on calling GetPowerUsage(timeout,retries) on any module which is online and closed (allowing the appliance to consume/produce) whenever I poll for an update.

Hope this helps someone :)

Cheers,
Frens
User avatar
Rene
Global Moderator
Global Moderator
Posts: 1689
Joined: Wed Oct 08, 2008 3:54 pm
Location: Netherlands

Re: Module.GetPowerUsage(timeout,retries)

Post by Rene »

Is this a new function of the latest release? The previous manual of the Plugwise Template Engine does not mention this function. In previous version using the module method to poll the modules was not recommended and could result in long timeouts (> 20s).
Rene.
frens
Starting Member
Starting Member
Posts: 3
Joined: Wed Dec 23, 2009 4:51 pm

Re: Module.GetPowerUsage(timeout,retries)

Post by frens »

Hi René,

I'm not working with Plugwise that long, but I guess it is part of their latest release (2.13, which is what I'm using).

I would rather have the modules push their current power when significant fluctuations occur (and e.g. let the source periodically poll if it doesn't receive anything). But that's out of my hands ... But as you say this might lead to significant delays if not worked out properly. The 'cool' thing is that both in the GetPowerUsage as well as the OpenRelay and CloseRelay methods they have added a timeout and a retries parameter. For now I'm using a timeout of a second and zero retries (in other words get a response in a second or continue). When it times out, these methods return false. If you then read e.g. Module.PowerUsage you just get the last known value as always.

I'm not using this in a very operational setting yet, so I don't know how this behaves with a large number of circles etc... right now I only use it to read out the Circle+ (which is the only circle I'm using right now).

Cheers,
Frens
Bwired
Administrator
Administrator
Posts: 4704
Joined: Sat Mar 25, 2006 1:07 am
Location: Netherlands
Contact:

Re: Module.GetPowerUsage(timeout,retries)

Post by Bwired »

@Frens: interesting thank!
@Renee: Did you test did also or are going to?
@Reinder: Can you tell us about this option, is it new, best way to handle?
Thanks
User avatar
Rene
Global Moderator
Global Moderator
Posts: 1689
Joined: Wed Oct 08, 2008 3:54 pm
Location: Netherlands

Re: Module.GetPowerUsage(timeout,retries)

Post by Rene »

Maybe I am going to play with it when I can find some time.
Rene.
Bwired
Administrator
Administrator
Posts: 4704
Joined: Sat Mar 25, 2006 1:07 am
Location: Netherlands
Contact:

Re: Module.GetPowerUsage(timeout,retries)

Post by Bwired »

I will check it out soon as well, lets also wait what Reinder tells about is.
Post Reply

Return to “Plugwise Forum”