Open jintytam opened 5 years ago
Could you name version of lywsd02 and HA both, please?
Also logs output will be helpful.
lywsd02 firmware version 1.1.2_0042 HA version 0.97.2 When I run the following command: hass -- script check_config Output error log: Testing configuration at /root/.homeassistant Failed config homeassistant.packages.th_calc.lywsd02:
And when I run “hass”:
WARNING (MainThread) [homeassistant.components.template.sensor] Could not render template Entrance Humidity, the state is unknown. WARNING (MainThread) [homeassistant.components.template.sensor] Could not render template Entrance Temperature, the state is unknown.
I had the same issue until I copied the folder contents both to /custom_components/ and custom_components/lywsd02/. If its only one or the other - it doesnt work. Obviously there an address mistake somewhere in there. Sorry im new to this, is there anyway to fix this issue?
@uk4pyc thanks a lot for workaround! I fix it soon, maybe tonight.
@uk4pyc so, I've check everything, there are no import issues in code. I tried to add more details into Readme, to make it more obvious.
I HA ecosystem you should place content of your custom components into directory inside custom_components
directory. So, correct file structure will looks like this example:
custom_components
|- lywsd02
| |- client
| | |- __init__.py
| | |- client.py
| |
| |- __init__.py
| |- const.py
| |- manifest.json
| |- sensor.py
|
|- automations.yaml
|- secrets.yaml
|- configuration.yaml
|- customize.yaml
|- groups.yaml
At Home Assistant (0.101.3) hass.io (192),
I get error:
2019-11-14 16:26:30 ERROR (MainThread) [homeassistant.loader] Error loading custom_components.lywsd02. Make sure all dependencies are installed
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/loader.py", line 346, in _load_file
module = importlib.import_module(path)
File "/usr/local/lib/python3.7/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "
So, Lywsd02Client is missing?!?
@JJussi this error means that HomeAssistant did not load library which needs to my component. In most cases HomeAssistant loads it automatically.
Same problem:
2020-01-27 12:27:53 ERROR (MainThread) [homeassistant.loader] Error loading custom_components.lywsd02. Make sure all dependencies are installed
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/loader.py", line 379, in _load_file
module = importlib.import_module(path)
File "/usr/local/lib/python3.7/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 728, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/config/custom_components/lywsd02/__init__.py", line 11, in <module>
from lywsd02 import Lywsd02Client as Client
ModuleNotFoundError: No module named 'lywsd02'
@MiguelAngelLV please try to rename custom_components/lywsd02
directory to custom_components/lywsd02_component
. I guess that we have naming resolution conflict in some cases.
Now the component is not found:
2020-01-29 13:09:00 ERROR (MainThread) [homeassistant.components.hassio] Component error: lywsd02 - Integration 'lywsd02' not found.
@MiguelAngelLV please try to rename
custom_components/lywsd02
directory tocustom_components/lywsd02_component
. I guess that we have naming resolution conflict in some cases.
No =( It's not work. I check rename folder.... ogger: homeassistant.loader Source: custom_components/lywsd02/init.py:11 First occurred: 23:30:52 (1 occurrences) Last logged: 23:30:52 Error loading custom_components.lywsd02. Make sure all dependencies are installed
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/loader.py", line 601, in _load_file
module = importlib.import_module(path)
File "/usr/local/lib/python3.8/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "
Hi, did anyone got the LYWSD02 integration working with a current version of HA? When I follow the instructions given, I end up with the same failure as @MiguelAngelLV
Integration error: lywsd02_sensor - Integration 'lywsd02_sensor' not found
I'm happy for any help :smiley:
Yes, it works fine currently.
Xiaomi BLE integration.
Home Assistant 2023.3.6 Supervisor 2023.04.0 Operating System 9.5 Frontend 20230309.1 - latest
@JJussi Thanks for your reply! I'm using the same version of HA as you, but unfortunately the Xiaomi BLE integration is telling me that there was no broadcast from the LYWSD02 in the last minutes when I want to add it. If I add it anyway, I end up with an integration tile without any entities.
After updating the Passive BLE monitor this morning to the current version, the LYWSD02 is detected without any issues now. As it is supported for some time already, I'm confused why it didn't work before :man_shrugging: Nevertheless, thanks for your reply @JJussi
Upgraded lywsd02 firmware and homeassistant,component lywsd02 unable to import