The only devices which, apart from our oven which uses high voltage, are not yet recorded are our Hue lights and Sonos speakers.
So I was wondering if anyone of you knows a way to calculate the power consumption of our Hue Lights manually depending on their status and brightness?
Maybe via a template sensor?
I would be happy if maybe one of you has already done something like this and could give me some tips
This obviously does not take into account how bright the lamp is. But for me it’s sufficient to just go with the consomption the lamp has by specification. Of course you can nest some brightness conditions in there. And Technically the off-consumption wouldb’t be 0 either. Anyways, maybe this gets you started.
That’ll help a lot!
I think I’ll set it up like in your example first and then try to figure out how to calculate the consumption per year.
Maybe a combination of history and statistic sensors?
Ok, I think I managed it in a first try with the history sensor and another template sensor.
First, I calculate the time when a certain light was on yesterday:
With these values, I can now display the total consumption in Grafana via a rolling cumulation, I think.
Unfortunately, with this method I only have the total consumption up to the day before. However, I would like to have the total consumption of this year as live data until now.
Unfortunately I haven’t found a way to do this yet Probably I only need a hint how I can use the Statistic Sensor to calculate how long my lamps have been on this year so far.
Hi All
I’ve started making power consumption calculations for my Hue lights unnecessarily complicated, because I almost can. I took power measurements of one of my Philips Hue LTW001 bulbs using a Power-Mate Lite PML10A power meter, stepping brightness from 1% to 100% in 10% steps and mired temperature from 153 to 454 in 50 steps.
Charting the results (below) gave an unexpected curve at first glance (the peak near the middle of the mired values). Sort of makes sense on second glance.
I’ve used bilinear interpolation to estimate the power values for any other values of brightness and mired. I can handle myself in excel well enough, but have no idea how to make this happen in python, or any other code.
If I can figure out how to upload the excel file with the measurements and the calcs, would any one be interested in have a crack and translating the formulas into some code that can be used in HA?
I asked a similar question here, if it helps? If I can understand the maths (which is difficult for me) I’d like to have a function/formula I can apply to any hue bulb model…
Hi @nodecentral , I think the answer was already given in the link you posted. https://stackoverflow.com/a/66525656
If I see it correctly and the values are correct, you would need a template sensor for each lamp that looks something like this:
Of course, there are also online calculators where you can enter your data and which will give you a possible function. Or you can simply do it in any office program (e.g. MS Office or Libre Office). Here is one of such online calculators e-Exponential regression Calculator - High accuracy calculation (casio.com)
Thanks @nodecentral,
That’s for a single dimension, but if i take what @CM000n says about fitting exponential functions and do it for a number of points of light warmth, then I may be able to interpolate between those funcions.
Exactly, except that it would make it even more complicated.
Here you would have a multivariate function, which could look like this, where x1 = brightness and x2 = color temperature:
If you would like to make your data available @cloak , I’m sure someone would try their hand at it sometime.
I would also be very interested, but I have little time at the moment and can’t promise anything.
I played around a bit and created a Jupyter notebook with some test data for a lamp, from the official Hue page mentioned above: https://colab.research.google.com/drive/1vEcx7GAZqYq2SMNzvX-HgLGlkluHJmbP?usp=sharing
Of course without claim to correctness and completeness But maybe this shows, how you could do it if necessary. All suggestions or improvements are welcome
Overall, I then get this (z=brightness and x=kelvin):
Most of my bulbs are Phillips Hue, although I don’t have that many models, it would be good to have a calculator where based on the model/number in use, you can find a corresponding set of values to understand the watts (cost) being used.
Now the following is mostly dummy data, and I found various other Hue bulb model numbers online, which I’ve been testing out (using Lua) on my Vera HA controller.
It’ll be great to have the a list of calculations for each bulb model.
local wattsFromDim = {
LWB010 = function (dim) return 0.43981651 * math.exp(0.012712893 * dim) end,
LWA004 = function (dim) return 0.45677776 * math.exp(0.012712893 * dim) end,
LWW001 = function (dim) return 0.48765897 * math.exp(0.012712893 * dim) end,
LWB006 = function (dim) return 0.40134543 * math.exp(0.012712893 * dim) end,
LWB004 = function (dim) return 0.40134543 * math.exp(0.012712893 * dim) end,
LCT007 = function (dim) return 0.41987568 * math.exp(0.012712893 * dim) end,
RS125 = function (dim) return 0.41987568 * math.exp(0.012712893 * dim) end
}
Unfortunately, the results are not really satisfactory so far.
Maybe @robmarkcole can step in as our Home Assistant Date Science guy and give us some tips if he is interested? I’m sure he can give us some good advice on how best to find a mathematical formula to a given data set
Possibly we also have to consider the physical basics regarding radiation energy etc. more, but this probably makes things even more complicated.
And the basic problem is, of course, the almost non-existent measured values for the individual lamp models. Maybe we can create a kind of database here via Github or something similar, where everyone can contribute their measurements and lamp models?
I did not read every comment in this thread but I suggest that measuring the power consumption (as someone reported) is the advised technique. This will give a lookup table that can be used to calc power usage under any settings
Hi @robmarkcole cool that you took a look. Thanks a lot for your feedback! Shure, a “simple” lookup table would certainly be the most accurate solution.
But that would result in a total of 34.700 measurement points with a mired range of 153-500 and a brightness range of 0%-100%, I don’t think anyone had the patience for that yet
Therefore the Intension was, whether not with a few measuring points a formula can be found, with which one can determine the not existing measuring points.
Ah, and of course there would be even more datapoints if we count in the RGB Values of some lamps
Interesting link from philips - although it doesn’t compare with the measurements, if your fit is accurate - there’s a much sharper bump in the middle. With my measurements, rather than do a exponential fit, I did a polynomial fit in excel and got an R^2 of 0.99+ for all equations (although it appears I didn’t save). I don’t think it would be that complicated to do the interpolation if the equations are plugged into a template. I’ve measured for 7 values of mired, so it’s not too complex.
A crude way could be:
If mired is between a and b, then
calculate power for the respective a and the b mired equations with a brightness of x for both
interpolate between the results of the two equations