Comments (5)
Hi @madzrobz !
yes, the problem is, that the lib cant connect to HASS at all - bc the KLF refuses to accept connections. This problem would persist independently of the set timeout.
The devices are only initialized on startup - i have no idea if it is possible to add devices asynchronously. May I ask you to connect to the HASS team and ask how we should change the integration.
Best
Julius
from pyvlx.
Hi @Julius2342 ,
thank you for the quick reply.
As you can see in the log, less than one minute later, the connection gets established - so the KLF itself (which I reboot before each restart of HA) accepts the connection. Thus I somehow donβt understand your reply - but this can easily be due to my lack of knowledge- sorry for that.
Best
Robert
from pyvlx.
the problem is, we should not wait till the KLF has self-repaired. (bc it is not predictable how long this will take).
(we could try to set the timeout to less then a second and immediately retry? But im not sure if this is an elegant approach.
from pyvlx.
Hi @Julius2342,
I checked the content of the file /usr/local/lib/python3.8/site-packages/pyvlx/connection.py on my Home Assistant machine and found the following code:
async def connect(self):
"""Connect to gateway via SSL."""
tcp_client = TCPTransport(self.frame_received_cb, self.connection_closed_cb)
self.transport, _ = await self.loop.create_connection(
lambda: tcp_client,
host=self.config.host,
port=self.config.port,
ssl=self.create_ssl_context(),
ssl_handshake_timeout=5,
)
Strangely, connection.py in your Git repository and part of the 0.2.17 release code looks as follows:
async def connect(self):
"""Connect to gateway via SSL."""
tcp_client = TCPTransport(self.frame_received_cb, self.connection_closed_cb)
self.transport, _ = await self.loop.create_connection(
lambda: tcp_client,
host=self.config.host,
port=self.config.port,
ssl=self.create_ssl_context(),
)
I don't understand, how the parameter ssl_handshake_timeout=5 came into my local file. I have changed the value of the timeout to 60 which has solved the problem for me.
the problem is, we should not wait till the KLF has self-repaired. (bc it is not predictable how long this will take).
(we could try to set the timeout to less then a second and immediately retry? But im not sure if this is an elegant approach.
I would prefer to wait as long as it takes during startup for the component to be set-up properly as I only restart the server during version updates - especially with the latest features which allow almost everything to be reloaded without a restart. Maybe the ssl_handshake_timeout and a repeat_counter during start-up could be exposed as parameters so everybody can configure the start-up behavior as preferred.
Best
Robert
from pyvlx.
@madzrobz seems there was an issue in the pip release of 0.2.17 since I was seeing the same thing. Julius released 0.2.18 and I just got the bump in Home Assistant approved: home-assistant/core#42895 so hope we have this out of the way.
from pyvlx.
Related Issues (20)
- Different venetian blinds are 'open' at different orientation values HOT 2
- Get position while moving a cover HOT 4
- Current position doesn't work HOT 15
- Add outdoor heater functionality?
- Python 3.10: DeprecationWarning: There is no current event loop
- Velux shutter in Home Assistant does not report state "opening" and "closing"
- Serial Number and KLF 200 HOT 2
- "Unable to send command" debug HOT 10
- Which Python versions are supported? HOT 4
- Enable velocity parameter
- Stop cover command throws an error
- Garage door is not reporting its position
- Upload to Pypi HOT 3
- Velux component: asynchronous startup HOT 4
- DEXXO SMART io not working HOT 5
- [Feature request] Support silent mode HOT 4
- Build failure with Python 3.10 HOT 2
- Rain Sensor HOT 55
- pyvlx ssl handshake error 2021.6.0 & 2021.6.1 HOT 10
- Inverted status for awnings HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyvlx.