-
Notifications
You must be signed in to change notification settings - Fork 246
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Some new config files Hue lights #87
Conversation
It wolud be nice if you can publish also modified script fot HS110 using name eg. measure_hs110. |
Would be nice with modified measure script for zwave and tuya plugs too. |
@smonesi, thanks awesome job! Few remarks.
|
It is really important to have consistent measurement base; it is even more important now, when HA has official "energy panel" available for every user.
ad 1. No more than 2 decimals is really needed (and rather never be), as precision of devices used to measure isn't really big, but also there are other circumstances which distort the result. ad 2. Brightness is most important part (so when I used to measure manually it was always 100 steps of brightness), in case of brigtness it is really sufficient (no need to use all 255 possible values), but due to nonlinear parts of power characteristics it is hard to predict how many measurements will be enough count . ad 3. I'm not 100% sure if my files are OK, maybe better to add just example in documentation, and maybe new subdirectories for sc ript working with other platforms? @Leatherface75 |
I will definitely fix the 2 decimals, I wrote a script that reads the CSV and writes it back rounded. I will always add decimals (as in sprintf %.2f) but I think no decimals should be supported. The first time I run the script with the "default" settings (as in measure.py) it was too slow and I feared some automation would ruin the calculation (eg. the measured light temporarily turning off if I leave the house!), I really thought the component would interpolate between two values. I wrote a script that interpolates the values and generates a new hs file with much more data, I am currently doing some sampling to verify how good the interpolation is and, for now, everything looks quite good. I'm actually more worried about the precision of the measurements of my HS110 (eg. hue changes should be completely irrelevant when saturation is 1, but the results are all slightly different)... I can share those scripts together with the measure_kasa.py script, I'm not a python programmer so the code might now be as good as it should be! |
Ok great!
Haha, you don't want that after 8 hours of measuring ;-). But you still can have this issue when the measure procedure takes 1-2 hours, right? I did disable my light automations in HA (toggle) while measuring so there was no risk this happens.
Nice!
I am also not a Python programmer by heart ;-). Did a lot of PHP, C# and Javascript. But honestly this is my first Python project. Besides the measure scripts and utitlities need to do there job. maintainability or clean code is not the most important factor here. |
"min_power": 0, | ||
"max_power": 6 | ||
}, | ||
"measure_method": "from specs", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can set this to manual
, and then description to "From specs"
@smonesi |
I do have a LTG002 but I have no way to measure it (I might have other lights in the same situation, while for most of them I can and I am measuring via script). I would still like to use this component to have a rough idea of the power used (and I guess all the owners of such a light will). Do you think there is a way to produce a "good-enough" configuration, somehow (eg. a supported_mode="typical-led-interpolation")? Maybe we can take the most similar device that we can measure (LTA001?) and scale the values in the LUT file to the 0.2-5.5W of the LTG002? I think an approximation is still better than nothing (or than linear, as you noticed). |
Yes, similar model could be an approximation, but it shouldn't be published here, maybe it is time to discuss secondary/temporary database for models without measurements. I think as temporary solution could be few linear models with calibrate points |
@smonesi I agree with @nepozs that the linear mode for LTG002 is not accurate enough, and we should not include it in the repository. We should only use linear mode when there is no other option (for example the portable battery powered light Hue Go). Regarding another mode "typical-led-interpolation", not sure how to do it, and I don't want to add unnecessary complexity to the component for this kind of edge cases. It will also take development effort and maintenance. You can include the LTG002 files in your own HA instance using So regarding the state of this PR, to get it merged two things need to be resolved.
Thanks again for your efforts, much appreciated. |
One final question. Is it correct that the Iris and Bloom lights only support |
Those are very old (first/second gen) Philips Hue lights that only support
|
Ok let's get it merged |
Just merged, but I see the build on master is failing now. Not sure why the github actions in the PR were not failing. Could you have a look please? |
I've reviewed hs.csv file inside and it contains "-0" values, so I think probably it is the reason for errors (and it can be fixed quick and simple by manual edit). But there is second and even worst problem: hs.csv contains unbelievable power values - they just can't be lower than standby_power (I know, there are sometimes some fluctuations which are measured as 0W but it means only that pauses in script were much too small). |
I'm trying to automatically create as many files for LUT config as possible using a modified measure.py script (using an TP-Link HS110 smart plug), however for some light I can only provide basic linear config.