Support for new velux api, added cover.velux#18738
Conversation
|
Hi I noticed one issue: should be async def async_open_cover(self, **kwargs): And can be changed to support position query: |
|
@WoodsterDK ty for you feedback! i already spotted the |
|
@Julius2342 no problem - I'm up for testing it, when you have something ready. |
| if ATTR_POSITION in kwargs: | ||
| position_percent = 100 - kwargs[ATTR_POSITION] | ||
| from pyvlx import Position | ||
| await self.node.set_position(Position(position_percent=position_percent)) |
There was a problem hiding this comment.
line too long (85 > 79 characters)
|
@WoodsterDK ^^ |
|
@WoodsterDK : do you get any error when initializing the the component? It should load all entities automatically on startup: |
|
@WoodsterDK : may you retry? |
@Julius2342 Will test tomorrow... |
|
@WoodsterDK : When retrieving the scenes, my old implementation was waiting for the last |
|
@WoodsterDK : And you are right, there was another bug with accessing the nodes via index-id instead of node_id (which makes more sense). |
OK - just tried running with the updated library, and my covers seems to added as entities - GREAT. Furthermore it could be nice to add the support of the feature cover.stop_cover in the component. If I look in the log every 10 second there is this: |
|
what do you mean with WRT cover.stop, do you know which Frame to send? No i do not poll. I activated the house-monitor. During movement they broadcast their position from time to time. Does this stop after the covers reached their final position? |
|
@Julius2342 Great work - a couple of things:
|
|
Thanks for this work, I'd love to try it out. |
|
I tested this branch and it works works perfectly. Thanks for the great work! Can't wait to have it merged :) |
|
@Julius2342 have you had a chance to look at: notification of position seems to be working, if the slider is being used. |
|
@WoodsterDK : Yes, started a small refactoring but then I was interrupted. Will try to continue soon. |
|
@WoodsterDK I did not experience that problem when pressing stop. |
|
@apeeters if you operate the cover, press stop close the ui card and open it again, the slider is positioned in a wrong position |
|
@WoodsterDK @Julius2342 I was able to reproduce this. It does not always occur and is caused by negative position values. Initially all my covers (closed) have position -23, after moving and stopping I sometimes get -5. |
|
Very interested in seeing this merged, let me know if I can test via a beta channel/repo for hass.io. |
|
@WoodsterDK may you retry? |
|
@Julius2342 Sure thing - will see if I can fit in try today |
| @callback | ||
| def async_register_callbacks(self): | ||
| """Register callbacks to update hass after device was changed.""" | ||
| async def after_update_callback(device): |
There was a problem hiding this comment.
Question, should the async def be outside of the def? I'm not 100% familiar with this yet.
example: cover.template.pyL201
There was a problem hiding this comment.
I think that's okay, as it is just passed as a callback (which I assume gets awaited later on). The @callback marks this as something that does not do I/O (for optimization), see: https://developers.home-assistant.io/docs/en/asyncio_categorizing_functions.html#the-callback-function
@Julius2342 - just tested, with the reference to 'pyvlx==0.2.8' it seems to be working as expected... COOL :) |
|
Added the 'breaking change' label as according to the initial descriptions this will be such for existing users. |
| host=host, | ||
| password=password) | ||
| password=password, | ||
| log_frames=True) |
There was a problem hiding this comment.
What does this option do as it sounds like a debugging option, and why is it wanted here? Otherwise (considering the reports that this is working on real devices) this should be ready to be merged.
There was a problem hiding this comment.
I removed this parameter!
|
@rytilahti : I addressed your issue. |
|
Thanks! 👍 I bolded the need to mention this in the changelog (inside description), as I don't think we have a label to highlight specific parts at the moment. |
MartinHjelmare
left a comment
There was a problem hiding this comment.
Good! Just a small comment.
|
|
||
| async def async_set_cover_position(self, **kwargs): | ||
| """Move the cover to a specific position.""" | ||
| if ATTR_POSITION in kwargs: |
There was a problem hiding this comment.
This is already validated by the service schema.


Description:
Upgraded pyvlx to version 0.2.*. Users will need to upgrade to a recent firmware version. Old and new firmwareversions are not compatible (both use a completely different API).
Added support for controlling Velux windows one by one.
Configuration should stay the same. Component will fetch the available devices/nodes from API.
Pull request in home-assistant.io with documentation (if applicable): home-assistant/home-assistant.io#7867
EDIT: Within the changelog of the release we should point to the page where the new Firmware may be downloaded: https://www.velux.com/api/klf200