Using remote_homeassistant with Nabu Casa

I have Home Assistant setup at my cottage and home. I would like to link the two using the remote_homeassistant custom component.

I use Nabu Casa to access the cottage instance of Home Assistant remotely.

I can not seem to be able to configure remote_homeassistant to use Nabu Casa.

Should work just fine. Use your nabu casa address, port 443 and check the secure box.

Do mean like this?

remote_homeassistant:
  instances:
    - host: xxxxxxxxxxxxxxxxxxxx.ui.nabu.casa
      port: 443
      secure: true
      verify_ssl: false
      access_token: xxxxxxxxxxxxxxxxxxxxxxxx
      entity_prefix: "KLN_Remote_"

I get the following error:

2021-01-07 08:31:49 ERROR (MainThread) [custom_components.remote_homeassistant.config_flow] import of https://xxxxxxxxxxxxxxxxxxxxxxxx.ui.nabu.casa/ failed
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/aiohttp/connector.py", line 1005, in _create_direct_connection
    hosts = await asyncio.shield(host_resolved)
  File "/usr/local/lib/python3.8/site-packages/aiohttp/connector.py", line 871, in _resolve_host
    addrs = await self._resolver.resolve(host, port, family=self._family)
  File "/usr/local/lib/python3.8/site-packages/aiohttp/resolver.py", line 31, in resolve
    infos = await self._loop.getaddrinfo(
  File "/usr/local/lib/python3.8/asyncio/base_events.py", line 825, in getaddrinfo
    return await self.run_in_executor(
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.8/socket.py", line 918, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -3] Try again

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/config/custom_components/remote_homeassistant/config_flow.py", line 68, in validate_input
    info = await async_get_discovery_info(
  File "/config/custom_components/remote_homeassistant/rest_api.py", line 46, in async_get_discovery_info
    async with session.get(url, headers=headers) as resp:
  File "/usr/local/lib/python3.8/site-packages/aiohttp/client.py", line 1124, in __aenter__
    self._resp = await self._coro
  File "/usr/local/lib/python3.8/site-packages/aiohttp/client.py", line 527, in _request
    conn = await self._connector.connect(
  File "/usr/local/lib/python3.8/site-packages/aiohttp/connector.py", line 541, in connect
    proto = await self._create_connection(req, traces, timeout)
  File "/usr/local/lib/python3.8/site-packages/aiohttp/connector.py", line 898, in _create_connection
    _, proto = await self._create_direct_connection(req, traces, timeout)
  File "/usr/local/lib/python3.8/site-packages/aiohttp/connector.py", line 1017, in _create_direct_connection
    raise ClientConnectorError(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host https:443 ssl:default [Try again]

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/config/custom_components/remote_homeassistant/config_flow.py", line 167, in async_step_import
    info = await validate_input(self.hass, user_input)
  File "/config/custom_components/remote_homeassistant/config_flow.py", line 77, in validate_input
    raise CannotConnect()
custom_components.remote_homeassistant.rest_api.CannotConnect

That should work. If you omit verify_ssl or set it to true instead?

did you find a solution?
I also use remote homeassistant and it’s not difficult to connect a remote server with a white ip, but it won’t work through the nabu casa service.

Is it really suppsed to work with nuba casa? If it is and if someone knows how to get it running it will solve my current problem without having to buy new HW:-)

Edit: Yes it works like a charm!! Now in full control of our summer house from my main HA at home! Only to make sure to use ssl and port 443.

@moelito

Would you mind sharing a step-by-step?

Also trying to get this working and no luck yet. My primary and secondary are both on Nabu and I can’t connect to the remote hub.

I got the same problem right now. Did anyone solve this?

This does work. make sure to check all boxes and remove https://

Ok, thanks for your reply. I just figured out, that the Remote-Nabu-Casa-Link points to my main instance, although i’m logged into the second (remote) instance.
As far as i know, you can’t manage two instances with one Nabu-Casa-account (see this topic ).
I think this is disappointing and the only solution would be to create a second account or use another cloud-connection.