Custom components location

Hello - first post, and I’ve stumbled early…:slight_smile:

I’ve installed Home Assistant in a Python virtual environment, as the installation guide, on my Raspberry Pi, and all’s working well, to a point.

On my homepage I’m getting:

The following components and platforms could not be set up:

  • [history]
  • [logbook]
  • [recorder]
  • [hive]

I believe I’ve added the appropriate lines to my configuration.yaml

I also want to add the Hive component (Hive Integration) and have got all the approporiate files on my Pi - but I’m struggling to find the custom_components directory to put them in. I assumed I create this within /home/homeassistant/.homeassistant but when I do that, and add the appropriate lines to configuration.yaml (from here https://www.home-assistant.io/components/hive/)…hence the Hive reference in the above error.

What am I missing?

Thanks in advance for any pointers.

You create your own folder to put the custom components in.

Are you getting any errors in the logs re the other components that are failing?

That’s what I’ve done.

My log doesn’t look to have been written to for a few days! Latest lines:

    RuntimeError: File descriptor 14 is used by transport <_SelectorSocketTransport fd=142018-10-11 18:19:32 ERROR (MainThread) [homeassistant.core] Error doing job: ExceptioTraceback (most recent call last):
File "/usr/lib/python3.5/asyncio/events.py", line 126, in _run
self._callback(*self._args)
File "/srv/homeassistant/lib/python3.5/site-packages/aiohttp/web_fileresponse.py",
loop.remove_writer(out_fd)
File "/usr/lib/python3.5/asyncio/selector_events.py", line 351, in remove_writer
self._ensure_fd_no_transport(fd)
File "/usr/lib/python3.5/asyncio/selector_events.py", line 258, in _ensure_fd_no_trfd, transport))
RuntimeError: File descriptor 14 is used by transport <_SelectorSocketTransport fd=142018-10-11 18:19:32 ERROR (MainThread) [homeassistant.core] Error doing job: ExceptioTraceback (most recent call last):
File "/usr/lib/python3.5/asyncio/events.py", line 126, in _run
self._callback(*self._args)
File "/srv/homeassistant/lib/python3.5/site-packages/aiohttp/web_fileresponse.py",
loop.remove_writer(out_fd)
File "/usr/lib/python3.5/asyncio/selector_events.py", line 351, in remove_writer
self._ensure_fd_no_transport(fd)
File "/usr/lib/python3.5/asyncio/selector_events.py", line 258, in _ensure_fd_no_trfd, transport))
RuntimeError: File descriptor 14 is used by transport <_SelectorSocketTransport fd=14Read only

Delete your database and reboot. Post any errors when it restarts.

Done, but now it won’t start…

sudo systemctl status [email protected]

gives

Oct 13 17:31:09 ed-fr24 hass[916]: File "/usr/lib/python3.5/asyncio/futures.py", line 293, in result

Oct 13 17:31:09 ed-fr24 hass[916]: raise self._exception

Oct 13 17:31:09 ed-fr24 hass[916]: File "/usr/lib/python3.5/concurrent/futures/thread.py", line 55, in run

Oct 13 17:31:09 ed-fr24 hass[916]: result = self.fn(*self.args, **self.kwargs)

Oct 13 17:31:09 ed-fr24 hass[916]: File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/config.py", line 406, in process_ha_config_up

Oct 13 17:31:09 ed-fr24 hass[916]: with open(version_path, 'wt') as outp:

Oct 13 17:31:09 ed-fr24 hass[916]: PermissionError: [Errno 13] Permission denied: '/home/homeassistant/.homeassistant/.HA_VERSION'

Oct 13 17:31:09 ed-fr24 systemd[1]: **[email protected]: Main process exited, code=exited, status=1/FAILURE**

Oct 13 17:31:09 ed-fr24 systemd[1]: **[email protected]: Unit entered failed state.**

Oct 13 17:31:09 ed-fr24 systemd[1]: **[email protected]: Failed with result 'exit-code'.**

Permission error suggests (4th line from the bottom) suggests that some commands for upgrading/updating /installing homeassistant were done from outside the venv.

What’s the make up of your system?
(ie - priveleged user, homeassistant user with no sudo, venv location, homeassistant config location)

Ahhh, I think I’ve realised what I’d done wrong…I had the service set to start as my “main” user, not the homeassistant account created during the install. Whoops!

Getting somewhere now, now I just have the hive error when I login:

The following components and platforms could not be set up:

* [hive](https://home-assistant.io/components/hive/)

Will do some more troubleshooting and report back. Thanks for help to date!

1 Like

Now getting the following in the logs - to me it’s like it’s not able to connect out?

Oct 13 18:42:21 ed-fr24 hass[1183]:   File "/srv/homeassistant/lib/python3.5/site-packages/aiohttp/web_response.py", line 608, in _start
Oct 13 18:42:21 ed-fr24 hass[1183]:     return await super()._start(request)
Oct 13 18:42:21 ed-fr24 hass[1183]:   File "/srv/homeassistant/lib/python3.5/site-packages/aiohttp/web_response.py", line 367, in _start
Oct 13 18:42:21 ed-fr24 hass[1183]:     await writer.write_headers(status_line, headers)
Oct 13 18:42:21 ed-fr24 hass[1183]:   File "/srv/homeassistant/lib/python3.5/site-packages/aiohttp/http_writer.py", line 110, in write_headers
Oct 13 18:42:21 ed-fr24 hass[1183]:     self._write(buf)
Oct 13 18:42:21 ed-fr24 hass[1183]:   File "/srv/homeassistant/lib/python3.5/site-packages/aiohttp/http_writer.py", line 67, in _write
Oct 13 18:42:21 ed-fr24 hass[1183]:     raise ConnectionResetError('Cannot write to closing transport')
Oct 13 18:42:21 ed-fr24 hass[1183]: ConnectionResetError: Cannot write to closing transport
Oct 13 18:42:22 ed-fr24 hass[1183]: 2018-10-13 18:42:22 INFO (MainThread) [homeassistant.components.http.view] Serving /api/websocket to 192.168.1.13 (auth: False)

Is it working?

That error is to do with aiohttp, not hive or any of the other things we were looking at.

Also, I’ve just realised that the thread you linked to is from May last year, since then the hive component has official integration and shouldn’t need a custom component…

1 Like

Thanks. I did try first time just adding the credentials to the config file but no joy. Will experiment more tomorrow. Beer time now :grinning:

Managed to get hive working after a lot of playing around - thanks for the help. Now just to get the automation I have going…

1 Like