Can't override a core integration

Hello all,

i wan’t to modify the code of a core integration. I am using homeassistant on a supported supervised installation. According to the documentation (link) i should be able to do so by creation a new folder named “custom_components” within my “config”-folder and choosing the same name as the core integration is using.

In my example i would like to change something on the original componented called forked_daapd. I looked up this core in the github repo (link) and found the domain name and folder named used by this integration is forked_daapd.

So i created a folder named forked_daapd in a newly created folder custom_components within my config-folder and changed some strings used to test it. Unfortunately even after a reboot of the whole system my changes are not applying.

I also tried to changed the folder name and the domain name in the manifest.json to something different expecting that this will pop up as a new integration - was also not working.

I was also not able to identify anything within my logs related to this

Do i miss anything ? Kindly ask for help

You need to copy the whole path to the component. See:

Also note that, nowadays, custom components must have a version tag in the manifest.json, but the core integrations do not.

So the documentation is incomplete. You must manually add a “version” tag to the manifest or the duplicated integration won’t load. Note that you get an error in the log in that case.

3 Likes

Awesome koying! Adding a version-tag fixed it for me. Thank you

I created a pull request to add this to the documentation:

2 Likes

I copied the Tuya integration, corrected the manifest and I have this error: cannot import name 'UnitOfElectricCurrent' from 'homeassistant.const'.
Why? How to fix it?

You are on an older version of HASS than the integration code supports , upgrade HASS and that will go away.