clyra/homeassistant

Upgrade hassio to 0.89.1 and custom components no longer working

MeloT88 opened this issue · 4 comments

Hi I have been using the custom component unify.py for 3 months already, it has been working fantastically but now after updating Hassio to 0.89.1 it stopped working, when I check my configuration it says:
Platform not found: sensor.unifi

It is just me or it happens to other people?

Home Assistant logs:
Unable to find platform unifi. Search path was limited to path of component: homeassistant.components

clyra commented

From the change logs of HA there was some changes on how the custom components files should be organized. The fix should be easy but unfortunately I’m out of the town and without my notebook for a couple of weeks.

Just to let you know. I have sorted in that way based on the new homeassistant architecture organization of custom components.

rename the file unifi.py as sensor.py
create a folder my_unifi
copy the sensor.py into my_unifi folder and copy the entire folder my_unifi into custom_componets folder, this way the custom sensor created by you will not go in conflict with unifi components by homeassistant.

If you do not call the unifi folder as my_unifi, home assistant will not look into custom_components folder but just homeassistant.components.

Hope this will help anyone dealing with the break changes to a custom components.

this the official changes documentation:
https://developers.home-assistant.io/blog/2019/02/19/the-great-migration.html

I forgot to tell you that you need to make sure the sensor configuration cointain the name of the folder.
From the example I made, it should look like this:
`sensor:

  • platform: my_unifi
    name: (optional, default: "unifi")
    region: (optional, default: "default")
    username: <unifi_controller_username>
    password: <unifi_controller_password>
    url: https://x.x.x.x:8443 `
clyra commented

Thanks! I guess i got it right... new layout in place.