UserSuppliedWattage

It “seems” that if a device does not report its Wattage, the system can use the value in the variable “UserSuppliedWattage” (that you setup) instead. The system automagically is then meant to update the variable “Watts” based on whether the device load is on or off ie UserSuppliedWattage or zero is copied into Watts respectively. Or if a dimmer is in use, then UserSuppliedWattage is scaled and then copied into Watts. This doesn’t appear to work with openLuup and AltUI.

So questions:

  • has this ever worked?
  • if so, what does the automagic calculations?
  • perhaps the automagic calculations are meant to be part of the browser (seems very unlikely)?
  • maybe each device’s handler/plugin manages it?

Where did you find this, I had a look in Device Parameters and didn’t see it?
IF I’m not mistaken you are suggesting that if the Wattage of a device is known then the device will report its Wattage and could also be made to report Power Usage (kW/Hr).
That would be very useful and potentially render many metering devices obsolete.

http://wiki.mios.com/index.php/Luup_UPnP_Variables_and_Actions#EnergyMetering1

Functionality appears to be a bit on the mythical side but it works for some? But yes, if it worked that would be good. Seems most likely your device handler would need to do it or alternatively you could write something that watched the various vars and did the updates but that seems a bit tedious.

This certainly has worked. It works for me (on two VeraLites running UI5.) it works on openLuup (because openLuup itself does nothing but hold the variable and AltUI does the magic.)

The HTTP request live_energy_usage is implemented in openLuup, and that returns all the current values…

|30094|Bedroom Ceiling|MiOS-35104860|3|0|
|20353|Study Ceiling|MiOS-35104005|3|0|
|30051|Dining Table|MiOS-35104860|3|50|
|30095|Ceiling|MiOS-35104860|3|0|
|30131|Power Meter|MiOS-35104860|21|2786|

So not sure what is not working for you? Did you use the right serviceId when creating the variable?

This is a plugin I wrote, so that’s probably the problem right there. The devices are all dimmers. I’ve got:

Watts, UserSuppliedWattage with service ID:
urn:micasaverde-com:serviceId:EnergyMetering1
There is no KWH variable

Running under openLuup & AltUI: Watts is always zero.

The URL below works OK - I can see listed the Wattage for a Z-wave device bridged from a Vera 3 to openLuup. My dimmers (plugin runs on openLuup) are listed but show zero Watts. Just by the way what’s the first figure - category?:

http://openLuup:3480/data_request?id=live_energy_usage

If I look at the Vera 3, I can see the power displayed as well - everywhere as expected. I do note that the Vera page shows 3 decimal places and the openLuup page shows no decimal places but that’s not the problem.

  • are you absolutely sure you have the serviceId spelled correctly?
  • first figure is device number

…actually, I think I lied!

AltUI, I think, just shows you the Watts variable. All my devices which are bridged to Vera obviously see whatever Vera does, and I think that this behaviour is implemented there.

It may well be that you have to implement this functionality for your own devices.

:are you absolutely sure you have the serviceId spelled correctly?

I like to think so, but having confused 0 & o and 1 & l and - & – in the past who knows. On the first number, I actually meant the second, so my counting is bit off as well! If I manually change the variable Watts in the child device, the change shows up when the live_energy_usage URL is invoked. It’s the updating of Watts from UserSuppliedWattage that doesn’t appear to work.

Just tried this with a dummy switch under openLuup controlled by my own code. AltUI doesn’t do anything (except display the value of the Watts variable.)

If you want that functionality, you will have to implement it yourself for your own plugin.

I recall now that I did, ages ago, consider adding this in to openLuup as a feature, but in fact it turned out to be too hard to determine if a device was already doing this or not. So, in the end, I didn’t do it.