Skip to content
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

No lookup file found for mode 'hs' #45

Closed
DanielV88 opened this issue Jul 1, 2021 · 16 comments
Closed

No lookup file found for mode 'hs' #45

DanielV88 opened this issue Jul 1, 2021 · 16 comments

Comments

@DanielV88
Copy link

Hi Bram,

I'm using your great integration, but it only seems to work on two of my bulbs.
I've put 4 of them in my config right now, but on 2 bulbs I'm getting the following error:

Skipping sensor setup light.tv_meubel_links: ('No lookup file found for mode', 'hs') Skipping sensor setup light.tv_meubel_rechts: ('No lookup file found for mode', 'hs')

I've configured them in lut mode with manufacturer and model. I'm using the default Hue integration from HA, but without mode, manufacturer and model they all don't work.

So it seems I've got the some issue as mentions in issue:
#15

I don't understand the error for mode 'hs', because that mode isn't even mentioned in your documentation.

The model is LCT0015.

Can you help me out?

@bramstroker
Copy link
Owner

Hi Daniel,

This is a known issue for this particular light model LCT015. That light is controllable by color temperature, but also with color. The hs.csv should be there to supply the measurements for color (hue/saturation), however that one is missing causing this error. I have asked the author if he can do the measurements for HS (color) mode, as I don't have this light model myself. But I don't know when he will be able to do this. @CM000n could you have a look into this?
I will also have a look soon if I can make the light work for color temperature mode only even when the hs files are missing, but I don't have time until saturday.

@nepozs
Copy link
Contributor

nepozs commented Jul 2, 2021

I've prepared short time lapse (60x faster than real time; 1 min. -> 1 hour) showing only 1.5h of script working (view is from HA GUI) - I think no one knows how much time and resources are consumed to prepare LUT file when MODE = MODE_HS:

20210702-1355-51_fixed.mp4

But in my opinion:

  1. setting MODE = MODE_HS should be set as default in measure.py script (so no one will miss this mode).
  2. LCT0015 should be temporary moved to unsupported models - any workaround will not be good - it is impossible to map h/s mode to color_temp mode, it is of course possible to use LUT file from other model, but it will show false values.
  3. I've read nearly all model.json files, and most of them miss standby_usage, so, it would be nice if script have option to generate also file with power value when light is off eg. standby_usage.txt - I think it is possible to measure it in early stage - 10 seconds waiting could be divided to 2x 5 secs and in meantime off state could be measured, in my opinion Shelly measures power just instant, waiting time is needed only because bulbs have variable power factor (so it is impossible to measure state more frequently than 2 secs).

BTW Script does not work properly under windows (now it is running for me usinng Ubuntu) - Shelly returns measure value ony once in the begining and this value is copied tiil end.

@DanielV88
Copy link
Author

Hi Daniel,

This is a known issue for this particular light model LCT015. That light is controllable by color temperature, but also with color. The hs.csv should be there to supply the measurements for color (hue/saturation), however that one is missing causing this error. I have asked the author if he can do the measurements for HS (color) mode, as I don't have this light model myself. But I don't know when he will be able to do this. @CM000n could you have a look into this?
I will also have a look soon if I can make the light work for color temperature mode only even when the hs files are missing, but I don't have time until saturday.

Thanks, that's clear.

I've runned the integration with debug enabled. I have someother bulbs and a lightstrip that also don't work.
Do you think they come available in the future?

2021-07-02 16:08:40 DEBUG (MainThread) [custom_components.powercalc.strategy_lut] Loading data file: /config/custom_components/powercalc/data/signify/LCT010/color_temp.csv.gz
2021-07-02 16:08:40 DEBUG (MainThread) [custom_components.powercalc.strategy_lut] Loading data file: /config/custom_components/powercalc/data/signify/LCT010/hs.csv.gz
2021-07-02 16:08:42 DEBUG (MainThread) [custom_components.powercalc.sensor] Setting up power sensor. entity_id:light.eettafel sensor_name:Eettafel Powermeter strategy=LutStrategy manufacturer=signify model=LCT010 standby_usage=0
2021-07-02 16:08:42 DEBUG (MainThread) [custom_components.powercalc.sensor] Setting up power sensor. entity_id:light.hektar_staande_lamp sensor_name:Hektar Powermeter strategy=LutStrategy manufacturer=signify model=LCT010 standby_usage=0
2021-07-02 16:08:42 INFO (MainThread) [custom_components.powercalc.sensor] Model not found in library light.hue_lightstrip_plus: ('Model not supported', 'LST002')
2021-07-02 16:08:42 ERROR (MainThread) [custom_components.powercalc.sensor] Error setting up calculation strategy: You must supply a valid manufacturer and model to use the LUT mode
2021-07-02 16:08:42 DEBUG (MainThread) [custom_components.powercalc.strategy_lut] Loading data file: /config/custom_components/powercalc/data/signify/LCT015/color_temp.csv.gz
2021-07-02 16:08:42 ERROR (MainThread) [custom_components.powercalc.sensor] Skipping sensor setup light.tv_meubel_links: ('No lookup file found for mode', 'hs')
2021-07-02 16:08:42 ERROR (MainThread) [custom_components.powercalc.sensor] Skipping sensor setup light.tv_meubel_rechts: ('No lookup file found for mode', 'hs')
2021-07-02 16:08:42 INFO (MainThread) [custom_components.powercalc.sensor] Model not found in library light.speelgoedkast: ('Model not supported', 'LCT007')
2021-07-02 16:08:42 ERROR (MainThread) [custom_components.powercalc.sensor] Error setting up calculation strategy: You must supply a valid manufacturer and model to use the LUT mode
2021-07-02 16:08:42 INFO (MainThread) [custom_components.powercalc.sensor] Model not found in library light.plafond: ('Model not supported', 'LWB006')
2021-07-02 16:08:42 ERROR (MainThread) [custom_components.powercalc.sensor] Error setting up calculation strategy: You must supply a valid manufacturer and model to use the LUT mode
2021-07-02 16:08:42 ERROR (MainThread) [custom_components.powercalc.sensor] Skipping sensor setup light.hue_go: ('No lookup file found for mode', 'color_temp')
2021-07-02 16:09:05 DEBUG (MainThread) [custom_components.powercalc.sensor] State changed to "off" for entity "light.eettafel". Power:0
2021-07-02 16:09:05 DEBUG (MainThread) [custom_components.powercalc.sensor] State changed to "off" for entity "light.hektar_staande_lamp". Power:0

@nepozs
Copy link
Contributor

nepozs commented Jul 2, 2021

Do you think they come available in the future?

It just depends on users - you can measure all of them yourself (like I'm doing it now) and make project better.
In next days I'will provide support for LTW010 and LLC011 and some Ikea models.
I could do measurments for anyone, but sending hardware abroad will cost too much.

@DanielV88
Copy link
Author

Do you think they come available in the future?

It just depends on users - you can measure all of them yourself (like I'm doing it now) and make project better.
In next days I'will provide support for LTW010 and LLC011 and some Ikea models.
I could do measurments for anyone, but sending hardware abroad will cost too much.

Out of curiousity;
How do you measure this? I understand you're using hardware to do this?
If the costs are not to high I would gladly help to measure more models.

@nepozs
Copy link
Contributor

nepozs commented Jul 2, 2021

Only few things are needed:

  • computer with any modern linux as OS, with installed Python and eg. Visual Studio Code (or any editor, but VSC is "all in one" IDE)
  • lighting fixture (where measured bulb fit and is able to electrically connect to Shelly)
  • Shelly Plug or Shelly Plug S (cost ~20€) - script is nearly ready for them - it needs just small configuration, (or maybe other Shelly modules with ability to measure power, but it needs electrician skills, I think other equipment from different manufaturer could be used but it will need good Python knowledge)
  • I've forgot - plenty of time and suitable place: P - one full H/S measure tooks about 20 hours…

Personally I've tested Shelly Plug S (used originally by author @bramstroker ) with highly accurate power meter and values measured by Shelly are accurate enough, so I'm using this hardware now.

Script is located here
https://github.com/bramstroker/homeassistant-powercalc/tree/master/utils/measure

@bramstroker
Copy link
Owner

As @nepozs already explained users can create a LUT file for missing models and help the project that way. I did all the light models which I have in my house, and two other users did a lot of other lights already. Right now we "only" support 15 lights.

Some additions to what @nepozs already said:
You can also use windows or Mac OSX. As long as it is running Python. There is a python script included in this repository (under utils/measure.py directory) which I created to automatically change the light settings and take measurements each 2 seconds. You let this script running and it will generate the CSV. Than you can create a pull request to get it included in this repository.
This script is created especially for the Shelly Plug (which is a smart plug which you can connect to your wifi network).
When you want to use some other smartplug (zigbee, zwave plug) whatever you need to alter my script or create your own script (when you can program).

@bramstroker
Copy link
Owner

I've prepared short time lapse (60x faster than real time; 1 min. -> 1 hour) showing only 1.5h of script working (view is from HA GUI) - I think no one knows how much time and resources are consumed to prepare LUT file when MODE = MODE_HS:

20210702-1355-51_fixed.mp4
But in my opinion:

  1. setting MODE = MODE_HS shold be set as default in measure.py script (so no one will miss this mode).
  2. LCT0015 should be temporary moved to unsupported models - any workaround will not be good - it is impossible to map h/s mode to color_temp mode, it is of course possible to use LUT file from other model, but it will show false values.
  3. I've read nearly all model.json files, and most of them miss standby_usage, so, it would be nice if script have option to generate also file with power walue when light is off eg. standby_usage.txt - I think it is possible to measure it in early stage - 10 seconds waiting could be divided to 2x 5 secs and in meantime off state could be measured, in my opinion Shelly measures power just instant, waiting time is needed only because bulbs have variable power factor (so it is impossible to measure state more frequently than 2 secs).

BTW Script does not work properly under windows (now it is running for me usinng Ubuntu) - Shelly returns measure value ony once in the begining and this value is copied tiil end.

Very cool time lapse. I like it ;-)

I have a littlebit of time to work on the component tomorrow. I think I will make the mode a use input (same as the light selection), that way the user can select the correct mode when starting the script. What do you think?
I will also add the standby usage to the script.

@nepozs
Copy link
Contributor

nepozs commented Jul 2, 2021

I think I will make the mode a use input (same as the light selection), that way the user can select the correct mode when starting the script. What do you think?

It will be great option - I've unintentional changed code many times by missclicks :D

I will also add the standby usage to the script.

It would be great, because every model has power draw between 0,3W and 0,5W so it is slightly more than 0W (in case using multiple lights total will be quite more).

I have some thoughts about optimization in script (eg. in HS mode mired step could be bigger, but britghness step sholud probably be lower) , but I have to analyze more .csv files
It looks like the maximum brightness could be 255 and it would be better to find the matching values so that the script ends up using the highest brightness (like many users use lights in reality).
Maybe the finished .csv files can also be optimized post factum (it depends on the algorithms used by the integration) - I think it would be enough to cut a few lines containing the same power values, but apart from the first and last in the series.

You can also use windows

I've tried on windows 7 (old laptop which could be working 24/7), but without success (on Win7 it is possible to use only old version of Python) - maybe win10 works?

BTW Most of my measurements are ready, so I'll try to prepare PR tonight.

@bramstroker
Copy link
Owner

Thanks. Btw it would be better idea to make a seperate issue for improvements in the measure script as we are taking over @DanielV88 topic now which is about an error for the missing lut file of LCT015.

@bramstroker
Copy link
Owner

@DanielV88 where do you live? I live in the Netherlands and there I could buy the Shelly plug for 22 euro which is not that expensive imo

@DanielV88
Copy link
Author

@bramstroker Also in the Netherlands :)
I will look into it and see if I can help in this project!

@bramstroker
Copy link
Owner

bramstroker commented Jul 3, 2021

Thanks. I have also made some improvements in the measure script. Let me know if you need any help.
Bought my Shelly plug at robbshop. https://www.robbshop.nl/tussenstekker-2500w-wifi-shelly

@bramstroker
Copy link
Owner

@CM000n I am sorry to ping you. Did you see my request for providing hue/saturation measurement for LCT015? Users will get an error when trying to use this bulb because hs.csv is missing.
Unfortunately I don't have this bulb myself so I have no way to do measurements.

@CM000n
Copy link
Contributor

CM000n commented Aug 10, 2021

Sorry, I don't have much time at the moment, as I already wrote to you in a PM. In the meantime, however, I have found some time and have been able to carry out the measurements. :-)

Pull request is created: #65

@bramstroker
Copy link
Owner

Thanks @CM000n! PR is merged. Will be in next release 0.2.8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants