Got it to work as well. A little more patience was needed:)
@teunehv Happy to hear you got it working!
So just to be sure:
- Created “lyric” folder under “custom_components” folder
- The lyric.py that was present in custom_components folder >> Moved to custom_components/lyric and renamed “init.py”
- Moved the “lyric.py” that was present under “custom_components/climate” to “custom_components/lyric” and renamed it to “climate.py”
Is that correct? What did you do with the “services.yaml” under “custom_components/climate”
Yes, that’s it @Tyfoon Auto correct on the forum prevent the real name of init.py, should be __ init.py __ without the spaces.
I didn’t have the services.yaml and it was working. Wasn’t even aware of the file, what’s the purpose?
I am trying to get this set up on 0.88 for the first time and I am not having any luck
my configuration.yaml is in /home/homeassistant/.homeassistant/configuration.yaml
so I then created the directory /home/homeassistant/.homeassistant/custom_components/
I wget the files from above
renamed them to init.py and /climate/climate.py as per Post #515
and I am getting these errors
Setup failed for lyric: Component not found.
11:45 PM setup.py (ERROR)
Unable to find component lyric
11:45 PM loader.py (ERROR)
does anyone have any ideas ? thanks
I didn’t make any changes, just went into the ~/homeassistant/custom_components/pycache, removed the files and restarted HA. Everything just started working fine after that.
My understanding is that services.yaml is the file used to populate the services available in the lyric component, when you’re accessing developper tools > services.
So… unless you’re using them, not required, but I’d rather having it there as a guide just in case…
You should have:
custom_components/lyric/climate.py
custom_components/lyric/__init__.py
custom_components/lyric/services.yaml
Could you try this approach? I’ve hassio 0.88.1, and it’s working (I had a different folder structure with 0.87.2, but now having a warning message that is solved with this one).
What should be in the services.yaml ?
Haven’t seen the file before
do you have an example of the services.yaml by chance?
I am trying to get everything updated to work in upcoming versions. I am on hass.io currently running 0.88.0
I created a new directory /config/custom_components/lyric and moved /custom_components/lyric.py into that directory then renamed it __ init__.py (without spaces)
I moved /custom_components/climate/lyric.py to /custom_components/lyric and renamed it climate.py
I cleared all the __ pycache __ and removed /custom_components/climate
Restarted HA and now getting the following error
Any help is greatly appreciated
Error loading custom_components.lyric. Make sure all dependencies are installed
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/homeassistant/loader.py", line 147, 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/lyric/__init__.py", line 16, in <module>
from custom_components.lyric import DATA_LYRIC, CONF_FAN,
CONF_AWAY_PERIODS
ImportError: cannot import name 'DATA_LYRIC' from 'custom_components.lyric'
(/config/custom_components/lyric/__init__.py)
If you had it working int the older version, all I had to do is upgrade to new version>remove files in ./pycache>restart HA.
Everything started working again for me without issue. My directory is:
root@homeassistant:~/homeassistant/custom_components# du -a -h
12K ./climate/__pycache__/lyric.cpython-37.pyc
28K ./climate/__pycache__
12K ./climate/lyric.py
44K ./climate
8.0K ./__pycache__/lyric.cpython-37.pyc
12K ./__pycache__
8.0K ./lyric.py
I had it working on 0.88.0 (my current version) with the original setup and the warning about it not working soon. I tried switching everything over to the new format and thats when it stopped working.
LOL, the old adage “if it works don’t fix it”
Anyway I’m currently on 0.88.1 with no changes to how I had it working in 0.87.x versions. All I did was delete what was in the pycache folder and restart HA.
But you do have a warning in your log that it won’t work in the future, right?
Yeah, I do…I had missed that. So it probably will stop working on the next upgrade or 2…bummer.
Wish this was a better maintained plug in, I’m not much of a python coder.
You were right 0.89.0 broke mine. Went back to 0.88.2 and it working again!! Will be watching for any help fixing this. Thanks everyone!!
Same here, trying to fix it via trial and error (I’m not a programmer).
Similar issues here: 0.89 Breaking Change: Prevent partial custom component overlays
edit: Ok, I think i found a fix. Published a repo with it:
https://github.com/teunehv/ha-custom-components/tree/master/lyric
thanks- looks good.