JoDehli / PyLoxone

Python Loxone binding
Apache License 2.0
183 stars 41 forks source link

Unable to connect to Loxone miniserver (gen1) #63

Closed rnovacek closed 3 years ago

rnovacek commented 3 years ago

I'm unable to connect to local miniserver (gen 1). I know that get2 needs loxone DNS, but this is gen 1.

I'm connecting using direct IP address and I can connect using LoxGui just fine. Loxone is running on port 7777 if that makes any difference.

Is it a requirement to have the miniserver publicly accessible (I have nginx with tls termination in front of it for public access, but not when using direct IP address from homeassistant).

I'm using last version 0.3.4 of PyLoxone (master makes no different, I tried 0.2.9 - also the same result).

Here is the error:

homeassistant_1  | 2021-05-03 07:05:59 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry PyLoxone for loxone
homeassistant_1  | Traceback (most recent call last):
homeassistant_1  |   File "/usr/src/homeassistant/homeassistant/config_entries.py", line 249, in async_setup
homeassistant_1  |     result = await component.async_setup_entry(hass, self)  # type: ignore
homeassistant_1  |   File "/config/custom_components/loxone/__init__.py", line 131, in async_setup_entry
homeassistant_1  |     if not await miniserver.async_setup():
homeassistant_1  |   File "/config/custom_components/loxone/miniserver.py", line 111, in async_setup
homeassistant_1  |     res = await self.api.async_init()
homeassistant_1  |   File "/config/custom_components/loxone/api.py", line 380, in async_init
homeassistant_1  |     _ = await self._ws.recv()
homeassistant_1  |   File "/usr/local/lib/python3.8/site-packages/websockets/protocol.py", line 509, in recv
homeassistant_1  |     await self.ensure_open()
homeassistant_1  |   File "/usr/local/lib/python3.8/site-packages/websockets/protocol.py", line 812, in ensure_open
homeassistant_1  |     raise self.connection_closed_exc()
homeassistant_1  | websockets.exceptions.ConnectionClosedOK: code = 1000 (OK), reason = normally closed
JoDehli commented 3 years ago

Do you have the newest loxone firmware? If not please update. Do you use HASSIO or manual installation?

Then you can try to delete the lox_token.cfg File. It should be located in the same folder where the configuration.yaml is located.

If the error still occurs you can try to change the ip address of the PC where your home assistant is running. I had strange problems with the connection because the loxone blocked my ip after a view connection failures. I could only solve it with changing the IP address of my rasp.

rnovacek commented 3 years ago

I do not have latest firmware, I have 11.1.9.14. I'll try to update and will report back.

It's a manual installation in Docker.

Deleting the token didn't help, nor did changing IP address.

I'll sort out the update and will do some digging if that doesn't help.

JoDehli commented 3 years ago

@rnovacek have you made any progress?

rnovacek commented 3 years ago

Sorry for the delay, waiting for the company that made my Loxone installation to do the upgrade to v12.

JoDehli commented 3 years ago

Ok come back if you still have problems and.reopen the issue. Until now I close it.

rnovacek commented 3 years ago

Updating to Loxone v12 did resolve the issue. Thanks for your help.