bramstroker / homeassistant-powercalc

Custom component to calculate estimated power consumption of lights and other appliances
MIT License
1.04k stars 264 forks source link

model.json file not found #1035

Closed pejotigrek closed 2 years ago

pejotigrek commented 2 years ago

error started with v0.25.0 and then still present in v0.25.2

powercalc starts and creates sensors as it should, but I still found this in the log:

2022-08-24 23:20:16.323 ERROR (MainThread) [custom_components.powercalc.power_profile.library] model.json file not found in directory /config/custom_components/powercalc/power_profile/../data/yeelight
2022-08-24 23:20:16.342 ERROR (MainThread) [custom_components.powercalc.power_profile.library] model.json file not found in directory /config/custom_components/powercalc/power_profile/../data/paulmann licht
2022-08-24 23:20:16.345 ERROR (MainThread) [custom_components.powercalc.power_profile.library] model.json file not found in directory /config/custom_components/powercalc/power_profile/../data/anko
2022-08-24 23:20:16.348 ERROR (MainThread) [custom_components.powercalc.power_profile.library] model.json file not found in directory /config/custom_components/powercalc/power_profile/../data/belkin
2022-08-24 23:20:16.350 ERROR (MainThread) [custom_components.powercalc.power_profile.library] model.json file not found in directory /config/custom_components/powercalc/power_profile/../data/aqara
2022-08-24 23:20:16.353 ERROR (MainThread) [custom_components.powercalc.power_profile.library] model.json file not found in directory /config/custom_components/powercalc/power_profile/../data/wiz
2022-08-24 23:20:16.355 ERROR (MainThread) [custom_components.powercalc.power_profile.library] model.json file not found in directory /config/custom_components/powercalc/power_profile/../data/lidl
2022-08-24 23:20:16.357 ERROR (MainThread) [custom_components.powercalc.power_profile.library] model.json file not found in directory /config/custom_components/powercalc/power_profile/../data/lexman
2022-08-24 23:20:16.360 ERROR (MainThread) [custom_components.powercalc.power_profile.library] model.json file not found in directory /config/custom_components/powercalc/power_profile/../data/tuya
2022-08-24 23:20:16.364 ERROR (MainThread) [custom_components.powercalc.power_profile.library] model.json file not found in directory /config/custom_components/powercalc/power_profile/../data/mueller-licht
2022-08-24 23:20:16.367 ERROR (MainThread) [custom_components.powercalc.power_profile.library] model.json file not found in directory /config/custom_components/powercalc/power_profile/../data/arlec
2022-08-24 23:20:16.370 ERROR (MainThread) [custom_components.powercalc.power_profile.library] model.json file not found in directory /config/custom_components/powercalc/power_profile/../data/ikea
2022-08-24 23:20:16.372 ERROR (MainThread) [custom_components.powercalc.power_profile.library] model.json file not found in directory /config/custom_components/powercalc/power_profile/../data/malmbergs
2022-08-24 23:20:16.376 ERROR (MainThread) [custom_components.powercalc.power_profile.library] model.json file not found in directory /config/custom_components/powercalc/power_profile/../data/signify
2022-08-24 23:20:16.380 ERROR (MainThread) [custom_components.powercalc.power_profile.library] model.json file not found in directory /config/custom_components/powercalc/power_profile/../data/ledvance
2022-08-24 23:20:16.385 ERROR (MainThread) [custom_components.powercalc.power_profile.library] model.json file not found in directory /config/custom_components/powercalc/power_profile/../data/innr
2022-08-24 23:20:16.390 ERROR (MainThread) [custom_components.powercalc.power_profile.library] model.json file not found in directory /config/custom_components/powercalc/power_profile/../data/melitec
2022-08-24 23:20:16.393 ERROR (MainThread) [custom_components.powercalc.power_profile.library] model.json file not found in directory /config/custom_components/powercalc/power_profile/../data/lifx
2022-08-24 23:20:16.396 ERROR (MainThread) [custom_components.powercalc.power_profile.library] model.json file not found in directory /config/custom_components/powercalc/power_profile/../data/elgato
2022-08-24 23:20:16.401 ERROR (MainThread) [custom_components.powercalc.power_profile.library] model.json file not found in directory /config/custom_components/powercalc/power_profile/../data/sonoff
2022-08-24 23:20:16.403 ERROR (MainThread) [custom_components.powercalc.power_profile.library] model.json file not found in directory /config/custom_components/powercalc/power_profile/../data/gledopto
2022-08-24 23:20:16.405 ERROR (MainThread) [custom_components.powercalc.power_profile.library] model.json file not found in directory /config/custom_components/powercalc/power_profile/../data/genio
2022-08-24 23:20:16.407 ERROR (MainThread) [custom_components.powercalc.power_profile.library] model.json file not found in directory /config/custom_components/powercalc/power_profile/../data/osram

Originally posted by @pejotigrek in https://github.com/bramstroker/homeassistant-powercalc/issues/1018#issuecomment-1226408067

bramstroker commented 2 years ago

@pejotigrek Could you modify the file config/custom_components/powercalc/power_profile/library.py and add the following at line 118:

_LOGGER.debug("Model directory: %s", model)

So that it reads:

            for model in next(os.walk(manufacturer_dir))[1]:
                _LOGGER.debug("Model directory: %s", model)
                power_profile = await self._create_power_profile(

Than restart with debug log enabled and share the logs here where Model directory is in the log lines.

pejotigrek commented 2 years ago

@bramstroker should I change logger settings [from default: warn that I have now] to other? because I've added the line and after reboot still can't find the line with Model directory, while the earlier errors are shown

bramstroker commented 2 years ago

See last section of readme how to enable debug logging for powercalc

pejotigrek commented 2 years ago

thanks. log below:

2022-08-27 12:09:13.908 DEBUG (MainThread) [custom_components.powercalc.power_profile.library] Model directory: YLDD05YL
2022-08-27 12:09:13.909 DEBUG (MainThread) [custom_components.powercalc.power_profile.library] Model directory: YLDP13YL
2022-08-27 12:09:13.914 DEBUG (MainThread) [custom_components.powercalc.power_profile.library] Model directory: YLDP06YL
2022-08-27 12:09:13.915 DEBUG (MainThread) [custom_components.powercalc.power_profile.library] Model directory: YLDL01YL
2022-08-27 12:09:13.916 DEBUG (MainThread) [custom_components.powercalc.power_profile.library] Model directory: YLDP01YL
2022-08-27 12:09:13.926 DEBUG (MainThread) [custom_components.powercalc.power_profile.library] Model directory: LED1925G6
2022-08-27 12:09:13.929 DEBUG (MainThread) [custom_components.powercalc.power_profile.library] Model directory: LED1649C5
2022-08-27 12:09:13.931 DEBUG (MainThread) [custom_components.powercalc.power_profile.library] Model directory: LED1623G12
2022-08-27 12:09:13.933 DEBUG (MainThread) [custom_components.powercalc.power_profile.library] Model directory: LED1536G5
2022-08-27 12:09:13.935 DEBUG (MainThread) [custom_components.powercalc.power_profile.library] Model directory: L1529
2022-08-27 12:09:13.938 DEBUG (MainThread) [custom_components.powercalc.power_profile.library] Model directory: LED1624G9
2022-08-27 12:09:13.940 DEBUG (MainThread) [custom_components.powercalc.power_profile.library] Model directory: LED1924G9
2022-08-27 12:09:13.941 DEBUG (MainThread) [custom_components.powercalc.power_profile.library] Model directory: LED2005R5
2022-08-27 12:09:13.942 DEBUG (MainThread) [custom_components.powercalc.power_profile.library] Model directory: L1528
2022-08-27 12:09:13.943 DEBUG (MainThread) [custom_components.powercalc.power_profile.library] Model directory: LED1837R5
2022-08-27 12:09:13.944 DEBUG (MainThread) [custom_components.powercalc.power_profile.library] Model directory: LED2002G5
2022-08-27 12:09:13.946 DEBUG (MainThread) [custom_components.powercalc.power_profile.library] Model directory: LED1949C5
2022-08-27 12:09:13.949 DEBUG (MainThread) [custom_components.powercalc.power_profile.library] Model directory: LED1835C6
2022-08-27 12:09:13.951 DEBUG (MainThread) [custom_components.powercalc.power_profile.library] Model directory: LED1732G11
2022-08-27 12:09:13.952 DEBUG (MainThread) [custom_components.powercalc.power_profile.library] Model directory: L1527
2022-08-27 12:09:13.954 DEBUG (MainThread) [custom_components.powercalc.power_profile.library] Model directory: LED1842G3
2022-08-27 12:09:13.955 DEBUG (MainThread) [custom_components.powercalc.power_profile.library] Model directory: LED2003G10
2022-08-27 12:09:13.956 DEBUG (MainThread) [custom_components.powercalc.power_profile.library] Model directory: LED1736G9
2022-08-27 12:09:13.957 DEBUG (MainThread) [custom_components.powercalc.power_profile.library] Model directory: LED1537R6
2022-08-27 12:09:13.959 DEBUG (MainThread) [custom_components.powercalc.power_profile.library] Model directory: L1616
2022-08-27 12:09:13.962 DEBUG (MainThread) [custom_components.powercalc.power_profile.library] Model directory: LED1934G3
2022-08-27 12:09:13.964 DEBUG (MainThread) [custom_components.powercalc.power_profile.library] Model directory: LED1650R5
2022-08-27 12:09:13.969 DEBUG (MainThread) [custom_components.powercalc.power_profile.library] Model directory: T1820
2022-08-27 12:09:13.972 DEBUG (MainThread) [custom_components.powercalc.power_profile.library] Model directory: LED1738G7
2022-08-27 12:09:13.973 DEBUG (MainThread) [custom_components.powercalc.power_profile.library] Model directory: LED1923R5
2022-08-27 12:09:13.976 DEBUG (MainThread) [custom_components.powercalc.power_profile.library] Model directory: LED1935C3
2022-08-27 12:09:13.978 DEBUG (MainThread) [custom_components.powercalc.power_profile.library] Model directory: LED1546G12
2022-08-27 12:09:13.980 DEBUG (MainThread) [custom_components.powercalc.power_profile.library] Model directory: LED1733G7
2022-08-27 12:09:13.982 DEBUG (MainThread) [custom_components.powercalc.power_profile.library] Model directory: LED1836G9
2022-08-27 12:09:13.984 DEBUG (MainThread) [custom_components.powercalc.power_profile.library] Model directory: LED1545G12
2022-08-27 12:09:14.014 DEBUG (MainThread) [custom_components.powercalc.power_profile.library] Model directory: SL20
2022-08-27 12:09:14.015 DEBUG (MainThread) [custom_components.powercalc.power_profile.library] Model directory: NO66-ZB
2022-08-27 12:09:14.020 DEBUG (MainThread) [custom_components.powercalc.power_profile.library] Model directory: yeelight
2022-08-27 12:09:14.021 ERROR (MainThread) [custom_components.powercalc.power_profile.library] model.json file not found in directory /config/custom_components/powercalc/power_profile/../data/yeelight
2022-08-27 12:09:14.059 DEBUG (MainThread) [custom_components.powercalc.power_profile.library] Model directory: paulmann licht
2022-08-27 12:09:14.059 ERROR (MainThread) [custom_components.powercalc.power_profile.library] model.json file not found in directory /config/custom_components/powercalc/power_profile/../data/paulmann licht
2022-08-27 12:09:14.067 DEBUG (MainThread) [custom_components.powercalc.power_profile.library] Model directory: anko
2022-08-27 12:09:14.068 ERROR (MainThread) [custom_components.powercalc.power_profile.library] model.json file not found in directory /config/custom_components/powercalc/power_profile/../data/anko
2022-08-27 12:09:14.070 DEBUG (MainThread) [custom_components.powercalc.power_profile.library] Model directory: belkin
2022-08-27 12:09:14.071 ERROR (MainThread) [custom_components.powercalc.power_profile.library] model.json file not found in directory /config/custom_components/powercalc/power_profile/../data/belkin
2022-08-27 12:09:14.074 DEBUG (MainThread) [custom_components.powercalc.power_profile.library] Model directory: aqara
2022-08-27 12:09:14.074 ERROR (MainThread) [custom_components.powercalc.power_profile.library] model.json file not found in directory /config/custom_components/powercalc/power_profile/../data/aqara
2022-08-27 12:09:14.076 DEBUG (MainThread) [custom_components.powercalc.power_profile.library] Model directory: wiz
2022-08-27 12:09:14.077 ERROR (MainThread) [custom_components.powercalc.power_profile.library] model.json file not found in directory /config/custom_components/powercalc/power_profile/../data/wiz
2022-08-27 12:09:14.080 DEBUG (MainThread) [custom_components.powercalc.power_profile.library] Model directory: lidl
2022-08-27 12:09:14.081 ERROR (MainThread) [custom_components.powercalc.power_profile.library] model.json file not found in directory /config/custom_components/powercalc/power_profile/../data/lidl
2022-08-27 12:09:14.084 DEBUG (MainThread) [custom_components.powercalc.power_profile.library] Model directory: lexman
2022-08-27 12:09:14.084 ERROR (MainThread) [custom_components.powercalc.power_profile.library] model.json file not found in directory /config/custom_components/powercalc/power_profile/../data/lexman
2022-08-27 12:09:14.087 DEBUG (MainThread) [custom_components.powercalc.power_profile.library] Model directory: tuya
2022-08-27 12:09:14.088 ERROR (MainThread) [custom_components.powercalc.power_profile.library] model.json file not found in directory /config/custom_components/powercalc/power_profile/../data/tuya
2022-08-27 12:09:14.094 DEBUG (MainThread) [custom_components.powercalc.power_profile.library] Model directory: mueller-licht
2022-08-27 12:09:14.095 ERROR (MainThread) [custom_components.powercalc.power_profile.library] model.json file not found in directory /config/custom_components/powercalc/power_profile/../data/mueller-licht
2022-08-27 12:09:14.098 DEBUG (MainThread) [custom_components.powercalc.power_profile.library] Model directory: arlec
2022-08-27 12:09:14.099 ERROR (MainThread) [custom_components.powercalc.power_profile.library] model.json file not found in directory /config/custom_components/powercalc/power_profile/../data/arlec
2022-08-27 12:09:14.108 DEBUG (MainThread) [custom_components.powercalc.power_profile.library] Model directory: ikea
2022-08-27 12:09:14.108 ERROR (MainThread) [custom_components.powercalc.power_profile.library] model.json file not found in directory /config/custom_components/powercalc/power_profile/../data/ikea
2022-08-27 12:09:14.110 DEBUG (MainThread) [custom_components.powercalc.power_profile.library] Model directory: malmbergs
2022-08-27 12:09:14.112 ERROR (MainThread) [custom_components.powercalc.power_profile.library] model.json file not found in directory /config/custom_components/powercalc/power_profile/../data/malmbergs
2022-08-27 12:09:14.115 DEBUG (MainThread) [custom_components.powercalc.power_profile.library] Model directory: signify
2022-08-27 12:09:14.115 ERROR (MainThread) [custom_components.powercalc.power_profile.library] model.json file not found in directory /config/custom_components/powercalc/power_profile/../data/signify
2022-08-27 12:09:14.119 DEBUG (MainThread) [custom_components.powercalc.power_profile.library] Model directory: ledvance
2022-08-27 12:09:14.120 ERROR (MainThread) [custom_components.powercalc.power_profile.library] model.json file not found in directory /config/custom_components/powercalc/power_profile/../data/ledvance
2022-08-27 12:09:14.122 DEBUG (MainThread) [custom_components.powercalc.power_profile.library] Model directory: innr
2022-08-27 12:09:14.123 ERROR (MainThread) [custom_components.powercalc.power_profile.library] model.json file not found in directory /config/custom_components/powercalc/power_profile/../data/innr
2022-08-27 12:09:14.125 DEBUG (MainThread) [custom_components.powercalc.power_profile.library] Model directory: melitec
2022-08-27 12:09:14.125 ERROR (MainThread) [custom_components.powercalc.power_profile.library] model.json file not found in directory /config/custom_components/powercalc/power_profile/../data/melitec
2022-08-27 12:09:14.127 DEBUG (MainThread) [custom_components.powercalc.power_profile.library] Model directory: lifx
2022-08-27 12:09:14.128 ERROR (MainThread) [custom_components.powercalc.power_profile.library] model.json file not found in directory /config/custom_components/powercalc/power_profile/../data/lifx
2022-08-27 12:09:14.134 DEBUG (MainThread) [custom_components.powercalc.power_profile.library] Model directory: elgato
2022-08-27 12:09:14.135 ERROR (MainThread) [custom_components.powercalc.power_profile.library] model.json file not found in directory /config/custom_components/powercalc/power_profile/../data/elgato
2022-08-27 12:09:14.138 DEBUG (MainThread) [custom_components.powercalc.power_profile.library] Model directory: sonoff
2022-08-27 12:09:14.140 ERROR (MainThread) [custom_components.powercalc.power_profile.library] model.json file not found in directory /config/custom_components/powercalc/power_profile/../data/sonoff
2022-08-27 12:09:14.143 DEBUG (MainThread) [custom_components.powercalc.power_profile.library] Model directory: gledopto
2022-08-27 12:09:14.143 ERROR (MainThread) [custom_components.powercalc.power_profile.library] model.json file not found in directory /config/custom_components/powercalc/power_profile/../data/gledopto
2022-08-27 12:09:14.148 DEBUG (MainThread) [custom_components.powercalc.power_profile.library] Model directory: genio
2022-08-27 12:09:14.150 ERROR (MainThread) [custom_components.powercalc.power_profile.library] model.json file not found in directory /config/custom_components/powercalc/power_profile/../data/genio
2022-08-27 12:09:14.152 DEBUG (MainThread) [custom_components.powercalc.power_profile.library] Model directory: osram
2022-08-27 12:09:14.154 ERROR (MainThread) [custom_components.powercalc.power_profile.library] model.json file not found in directory /config/custom_components/powercalc/power_profile/../data/osram
bramstroker commented 2 years ago

Could you add one extra log line on line 113. same file, just before the for construct.

_LOGGER.debug("Get profile by manufacturer: %s", manufacturer)
for data_dir in self._data_directories:
pejotigrek commented 2 years ago

ok, right now it was kinda harder to cut-out specific lines, so here goes log with successful lines too. I guess that linest 161-207 are those connected with the issue - and there is an empty manufacturer [line 161]

powercalc_debug.log

bramstroker commented 2 years ago

Yes I suspected that was the culprit:

2022-08-27 13:09:55.139 DEBUG (MainThread) [custom_components.powercalc.power_profile.model_discovery] switch.1_lvn_bluetooth_inquiries: Auto discovered model (manufacturer=, model=Docker Container)
2022-08-27 13:09:55.139 DEBUG (MainThread) [custom_components.powercalc.power_profile.library] Get profile by manufacturer:

That's why I couldn't reproduce and no other users are reporting this issue.

I can now resolve this. Thanks.

pejotigrek commented 2 years ago

I can now resolve this. Thanks.

no, thank YOU! I'm happy I could help! :)

bramstroker commented 2 years ago

Fixed by #1045. Will be in next release.