You don’t modify the files in hassio. You should make a custom component instead.
What doesn’t work about it?
You don’t modify the files in hassio. You should make a custom component instead.
What doesn’t work about it?
Hi @flamingm0e i will like to change a .py file in this location:
/usr/src/homeassistant/homeassistant/components/
This is the precise file location and file name:
/usr/src/homeassistant/homeassistant/components/touchline/climate.py
I am using: HASSIO
Someone fix the component: Roth Touchline - Home Assistant
And they got a locally working touchline.py file that i will like to replace in my hassio system.
Here is the post: New Request: ROTH Touchline - Underfloor Heating System - #27 by pilehave
Can you help??
I’ll reiterate this again.
Make it into a CUSTOM component, and don’t try to modify system files that will be overwritten on the next update.
I cant just make it into a CUSTOM component, and i will like to modify this file.
Can you help or not?
Why not?
And I’m telling you that it won’t work on the next update.
I am helping you. Just because it’s not the answer you want to hear doesn’t mean it’s wrong.
How should i make it into a CUSTOM component?
I know it could not work on next update!
I know the files are changeable, and i will like to change the .py file before i make it into custom component.
Why are you making this difficult?
You just copy the component following directory structure into a directory called custom_components…
You can get all the files needed from GitHub.
I am using hacs, so can you help how i make this file:
Into a custom component that i can use?
Irrelevant?
https://developers.home-assistant.io/docs/en/creating_component_loading.html
Put the files needed in custom_components, as I’ve said before.
Okay, i tried to put the 3 files in here: custom_components\touchline
I still see this file be loaded: /usr/src/homeassistant/homeassistant/components/touchline/climate.py
How do i switch to the custom compnents, i dont see it in the documentation.
OK, so you have the __init__.py
, manifest.json
, and the climate.py
? in that directory?
Nothing special. Custom components should “override” the built in components. After you have added those files, you have restarted?
Yep, i put these files in here:
and i restartet the hassio yet.
wierd, seems to start the build in component.
you didn’t add the manifest.json
and you have 2 __init__
files…
OMG, yearh let me try again
Okay that broke my hassio.
I got this error now:
> 2019-12-01 18:29:53 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for touchline which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you do experience issues with Home Assistant.
> 2019-12-01 18:29:54 ERROR (MainThread) [homeassistant.setup] Error during setup of component api
> Traceback (most recent call last):
> File "/usr/src/homeassistant/homeassistant/setup.py", line 176, in _async_setup_component
> component.setup, hass, processed_config # type: ignore
> concurrent.futures._base.CancelledError
> 2019-12-01 18:29:54 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry configuration.yaml for mqtt
> Traceback (most recent call last):
> File "/usr/src/homeassistant/homeassistant/config_entries.py", line 192, in async_setup
> hass, self
> File "/usr/src/homeassistant/homeassistant/components/mqtt/__init__.py", line 649, in async_setup_entry
> result: str = await hass.data[DATA_MQTT].async_connect()
> File "/usr/src/homeassistant/homeassistant/components/mqtt/__init__.py", line 793, in async_connect
> self._mqttc.connect, self.broker, self.port, self.keepalive
> concurrent.futures._base.CancelledError
2019-12-01 18:29:54 ERROR (MainThread) [homeassistant.setup] Error during setup of component group
Traceback (most recent call last):
File "/usr/local/lib/python3.7/asyncio/runners.py", line 43, in run
return loop.run_until_complete(main)
File "/usr/local/lib/python3.7/asyncio/base_events.py", line 579, in run_until_complete
return future.result()
File "/usr/src/homeassistant/homeassistant/__main__.py", line 302, in setup_and_run_hass
log_no_color=args.log_no_color,
File "/usr/src/homeassistant/homeassistant/bootstrap.py", line 148, in async_from_config_file
config_dict, hass, enable_log=False, skip_pip=skip_pip
File "/usr/src/homeassistant/homeassistant/bootstrap.py", line 93, in async_from_config_dict
await _async_set_up_integrations(hass, config)
File "/usr/src/homeassistant/homeassistant/bootstrap.py", line 374, in _async_set_up_integrations
*(async_setup_component(hass, domain, config) for domain in domains_to_load)
File "/usr/src/homeassistant/homeassistant/setup.py", line 51, in async_setup_component
return await task # type: ignore
File "/usr/src/homeassistant/homeassistant/setup.py", line 147, in _async_setup_component
hass, config, integration
File "/usr/src/homeassistant/homeassistant/config.py", line 762, in async_process_component_config
platform = p_integration.get_platform(domain)
File "/usr/src/homeassistant/homeassistant/loader.py", line 232, in get_platform
f"{self.pkg_path}.{platform_name}"
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 953, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
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 724, in exec_module
File "<frozen importlib._bootstrap_external>", line 860, in get_code
File "<frozen importlib._bootstrap_external>", line 791, in source_to_code
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/config/custom_components/touchline/__init__.py", line 1
The touchline component.
^
SyntaxError: invalid syntax
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/setup.py", line 172, in _async_setup_component
hass, processed_config
File "/usr/src/homeassistant/homeassistant/components/group/__init__.py", line 216, in async_setup
await _async_process_config(hass, config, component)
File "/usr/src/homeassistant/homeassistant/components/group/__init__.py", line 373, in _async_process_config
mode=mode,
File "/usr/src/homeassistant/homeassistant/components/group/__init__.py", line 488, in async_create_group
await component.async_add_entities([group], True)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 252, in async_add_entities
await asyncio.wait(tasks)
File "/usr/local/lib/python3.7/asyncio/tasks.py", line 389, in wait
return await _wait(fs, timeout, return_when, loop)
File "/usr/local/lib/python3.7/asyncio/tasks.py", line 482, in _wait
await waiter
concurrent.futures._base.CancelledError
But this component have nothing to do with the mqtt broker.
I think the file: “init.py” is the issue the only thing in the file is this:
The touchline component.
The original site: core/homeassistant/components/touchline at dev · home-assistant/core · GitHub have 3 files, and the only file i replaces was climate.py still not working
The error says it’s failing to setup API
MQTT and everything beyond it is failing to load because of the first error.
That’s all that is supposed to be in that file.
Verify your configuration yaml. It appears that something around API is breaking the loading of config
I believe this question is old so this was figured out a long time ago. Thanks for replying though
What are you talking about?
Allright, now the custom_components is loading the original files.
I did not touch anything in configuration.yaml only recreated the folder and 3 files again.
Now i will try to change the climate.py out.!!
Nvm, I read it wrong srry