Adding version to a custom component

I have a customized version of the core component ‘wirelesstag’ in my ‘custom_components’ folder under the same name.

I understand “version” needs to be added to the manifest file but whenever I add “version” in, I get all sorts of errors and HA is actually in a very fragile state, I cannot even restart HA in the Server Controls page, I have to use Docker to restart.

This is my manifest file, same as core but with the added version tag:

“domain”: “wirelesstag”,
“name”: “Wireless Sensor Tags”,
“documentation”: “Wireless Sensor Tags - Home Assistant”,
“requirements”: [“wirelesstagpy==0.4.1”],
“codeowners”: [],
“iot_class”: “local_push”,
“version”: “0.9.0”

If I remove the version tag, everything runs fine except I get the warning that a “version” tag is required for a custom component.

Does anyone have any ideas why this might be happening?

It’s probably not adding the version tag, but instead this:

I have a customized version of the core component ‘wirelesstag’ in my ‘custom_components’ folder under the same name.

What did you change from the built-in version? Removing the “version” tag will prevent HA from loading your custom component starting in 2021.6 or later, so you’re simply reverting back to the working built-in version.

I change the default port in the file to point to a JSON Proxy which supports a local push updated from the Wireless Tag Hub to my HA instance, this bypasses the WirelessTag cloud for updates.

This is what I am customizing
#port = self.hass.config.api.port
port = 9321

It would help if this could be configured from YAML, this is on my list of things to look at.

I am still not sure why it is not working when I add the “version” tag though. Everything works in the custom component if I do not add the extra version tag.

Compare what you have in custom components with the version for the HA version you’re using to see if they’re different in any way beyond the port change. If you’re running HA 2021.6 or later, you’re not actually running using your custom component if your manifest.json is missing the version tag. You’re focusing on the version tag causing problems, but it’s really whether or not HA is loading your custom component at all. My guess is that you have an old version of the integration that’s missing changes that were made to the built-in one, and that’s what’s causing the instability when you add the version key and HA tries to load your custom_component.

Thanks for your help Rob, I think I can just remove the custom component anyway, it seems like the push is working directly with the standard integration. There was an auto issue previously which is why I was using the proxy in the first place.

Sure, np. If the built-in component is working for you, no need for a custom version or the ongoing maintenance required.