Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not able to make home-assistant-remote work #42

Closed
ygreq opened this issue Apr 2, 2020 · 23 comments
Closed

Not able to make home-assistant-remote work #42

ygreq opened this issue Apr 2, 2020 · 23 comments
Labels
question Further information is requested

Comments

@ygreq
Copy link

ygreq commented Apr 2, 2020

Hi guys,

I am trying to figure out what to do in order to make the addon functional in my setup. Do you have any clues on why it does not work? Thank you so much for all your help. This is what I did:

-I checked that I can access both HA instances from outside of the network. (I did this with the help of ZeroTier One. Both are in the same virtual network now along with a laptop from where I can access them. From my laptop I can ping both HA instances and I can also access them in the browser by going to their IP address as created in ZeroTier One)
-I installed HACS on both HA devices and installed remote_homeassistant in HACS
-I created an access token in the remote instance of HA.
-In the remote HA instance (I called ggs) in the configuration.yaml file I only added remote_homeassistant:
-in the main HA instance (I called home) in the configuration.yaml file I added the following:

remote_homeassistant:
   instances:
   - host: [IP_ADDRESS_of_REMOTE_Instance_provided_by_ZEROTIER_ONE]
     port: 8123
     secure: false
     verify_ssl: true
     access_token: !secret ggs_access_token
     entity_prefix: "ggs_"

What else should I do?
Thank you once again for any help you can provide!
ygr

@lukas-hetzenecker
Copy link
Member

Hello,

this looks actually correct.
The remote instances don't need to have remote_homeassistant installed (clarified that in the instructions now), but it shouldn't hurt either.
Do you see any error messages in "Developer Tools - Logs" in the web UI of the primary instance?

@ygreq
Copy link
Author

ygreq commented Apr 14, 2020

Hi, Lukas! Sorry it took so much to answer. I had to restart the remote host.

This is what is says in the log:

Log Details (ERROR)
Logger: custom_components.remote_homeassistant
Source: custom_components/remote_homeassistant/init.py:176
First occurred: 6:03:34 PM (144 occurrences)
Last logged: 6:28:10 PM

Could not connect to ws://[REMOTE_HOST_IP_via_ZEROTIER]:8123/api/websocket, retry in 10 seconds...

Any ideas what it means? BTW, I still can connect to it via my extra pc (which is the 3rd device in the ZeroTier virtual network, but also in the same physical network with the main HA instance. First is the main HA instance on a Proxmox, Second is the remote HA instance on a Raspberry 3B+)

@ygreq
Copy link
Author

ygreq commented Apr 23, 2020

Hi Lukas! Did you have a chance to look into this? Do you know what I should do?

Thank you so much!

@ygreq
Copy link
Author

ygreq commented Apr 28, 2020

I just tested the setup on the same network. I modified the IP address in the configuration.yaml to reflect the changes. Now I have:

remote_homeassistant:
  instances:
  - host: 192.168.1.101
    port: 8123
    access_token: !secret ggs_same_network_access_token
    entity_prefix: "ggs_"

I still get the error:

Logger: custom_components.remote_homeassistant
Source: custom_components/remote_homeassistant/init.py:176
First occurred: 3:50:10 PM (32 occurrences)
Last logged: 3:55:20 PM

Could not connect to ws://192.168.1.101:8123/api/websocket, retry in 10 seconds...

I also tried using - host: https://192.168.1.101. Still nothing

Please help! :(

PS: I am running master HA on Proxmox on a pc and the slave HA on a Raspberry Pi 3b

@ygreq
Copy link
Author

ygreq commented Apr 30, 2020

I followed the user Krash' advice on the Home Assistant in this forum post and disabled DuckDNS settings of the slave instance by commenting out the code in configuration.yaml necessary for DuckDNS to function. And thus Remote Home Assistant worked and I had access from the master instance.

If I add the code again, WebSocket stops working and it seems I get 2 errors asociated with this addon:

1st Error
Logger: custom_components.remote_homeassistant
Source: custom_components/remote_homeassistant/init.py:229
First occurred: 12:25:23 PM (1 occurrences)
Last logged: 12:25:23 PM

2nd Error
Logger: custom_components.remote_homeassistant
Source: custom_components/remote_homeassistant/init.py:176
First occurred: 12:25:23 PM (33 occurrences)
Last logged: 12:32:07 PM

Could not connect to ws://10.242.0.97:8123/api/websocket, retry in 10 seconds..
websocket connection is closing

Do you know if there is a solution to using a secured connection via DuckDNS and using home-assistant-remote as well?
Thank you so much!

@klovatt
Copy link

klovatt commented Apr 30, 2020

I am using doing this via duckdns from a different location.

Here's the snippet from configuration.yaml

remote_homeassistant:
instances:

  • host: remotehostname.duckdns.org
    port: 8123
    secure: true
    access_token: !secret master_access

@lukas-hetzenecker
Copy link
Member

Sorry, but there is nothing much I can do about the

Could not connect to ws://10.242.0.97:8123/api/websocket, retry in 10 seconds

errors. Master HA on Proxmox on a pc and the slave HA on a Raspberry Pi 3b is by the way exactly the same setup as mine.

Unfortunately I'm not familiar with DuckDNS, but as there seems to be no network connectivity possible between your two instances so I don't suspect DNS is the problem here.

Are you able to connect to the web interface of HA ( http://10.242.0.97:8123 ) from another PC in the same network? Are master and slave in the same network (seems to be the case from your description in the first post)? Can you e.g. ping the Raspberry from your Proxmox VM?
If not, is there any local firewall on the Raspberry blocking access?

@ygreq
Copy link
Author

ygreq commented May 6, 2020

Thank you both for all your input. I have a problem with my port forwarding on the remote router and I cannot test with DuckDNS or any other Dynamic DNS provider like no-ip.com yet. Like I said before I only tested with ZeroTier One. And as ZeroTier One is used to simulate a local network even though your devices are on different physical networks, I have local network issues. Like previously mentioned, on a local network, the remote host cannot be secured. It needs to be unsecured in order for home-assistant-remote to work. This is the problem.

So to recapitulate, if you would like to simulate my situation you can try puting the master and the slave on the same network and once you secure the slave, you cannot access it anymore. Is this normal for everyone or just a bug for some of us? And if first case, can you update it to make it work? :)

Otherwise on the forums, a user there said that if you connect to the remote / slave host via internet, it will work even if it is secured.

Thank you much!

@Automan69
Copy link

Hi Lukas,

I would just like to confirm I am having the same issues as mentioned above by @ygreq. Sounds like I also have the same setup as both of you. NUC at home running Proxmox and remote RPi's, all connected with ZeroTier. I am able to ping in both directions (ie from home to remote and vice versa). I have five remote devices, only one remote device is sending data. I have tried all manor of disabling remote devices and re-enabling them with no success. This system was working for me previously with a number of websocket errors on the master instance. Interestingly, a sensor is created "sensor.remote_connection<ZT_address>_8123". This sensor says it is connected but sending no data. I intermittently have the error
"Could not connect to ws://<ZT_address>:8123/api/websocket, retry in 10 seconds..." More usually now though, there are no errors in the log at all.

Any ideas? Has anyone else managed to overcome this problem?

@Automan69
Copy link

I should add also, I am able to connect to the web interface of all remote devices.

@ygreq
Copy link
Author

ygreq commented Jun 24, 2020

Try to use DuckDNS instead of ZeroTier and see if that works. DIsable ZeroTier on all devices while doing that just to be sure.

Unfortunately I could not use DuckDNS as I have some problems with the remote router so I cannot set it up last time I tried.

Let me know if that works.

@Automan69
Copy link

I'm in the same position as you @ygreq. My remote modem / router is behind a CGNAT'ed mobile network. ZeroTier finds the instance no problem but DuckDNS does not. I've had it working fine with ZT. For some reason it has just stopped.

@ygreq
Copy link
Author

ygreq commented Jun 24, 2020

You said remoteaccess worked for you with ZeroTier but only recently stopped working? If this is the case, when did it stop working?

@Automan69
Copy link

One of the instances still is working. The other four instances died maybe three days ago. It definitely works with ZT.

@Automan69
Copy link

@ygreq one of my other instances has popped back up tonight. I now have 2 of 5 connected. Don't know what happened to make it connect.

@Automan69
Copy link

Anyone else suffering from this non-parsing of data - try rebooting the "Host System" from "Supervisor" -> "System"
Worked for me. Thanks to @lukas-hetzenecker. Your addon makes a world of IoT possible.

@ygreq
Copy link
Author

ygreq commented Jun 30, 2020

@Automan69 So you say it works for you using ZeroTier? And now it works without any problems thanks to the rebooting thing? That is great news! Did you do anything special to make it work with ZeroTier?

@ygreq
Copy link
Author

ygreq commented Jul 6, 2020

Hi @Automan69 ! I just tried again to reconnect via ZeroTier. Still the same problem. May I ask that you share the steps you did? Maybe also paste the code you used in HA configuration.yaml? For example did you use https:// before the ip address of your remote instance? Did you use different ports like 8123, 81234 for each instance?

Thank you so much!

@Automan69
Copy link

Automan69 commented Jul 9, 2020

ZT.txt

I've used the same port each time.

I've not locked down the remote instance as that instance has no ports open and is on a double nat'ed mobile network in Australia.

@Automan69
Copy link

@ygreq , it is also possible you have not setup your zt access properly. You need to tick the box of each zt instance in the zt interface. I'm just assuming you have done that. All instances also need to be on the same zt network.

@postlund
Copy link
Collaborator

Is this issue still relevant? Seems to be more of a network connection issue rather than problem with the component?

@postlund postlund added the question Further information is requested label Dec 23, 2020
@ygreq
Copy link
Author

ygreq commented Dec 23, 2020

I did not see the replies. I will check asap. Probably after the holidays!!

Thank you, Automan69!!

@postlund
Copy link
Collaborator

Closing this now as I don't think this is a problem with this component. Feel free to open it again if you disagree.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

5 participants