-
Notifications
You must be signed in to change notification settings - Fork 26
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
Window opening % reported as 1 instead of 0 when closed (new vasistas) #47
Comments
What node type id does your product have? |
I'm a bit lost on this, I can't find this information on the entity attributes nor on the logs... |
Ok, enabled debug level logging, I see the windows I was talking about have: product_type=12 |
May I ask you to paste the log? |
Sure, here is it: https://pastebin.com/SjgNQtwW |
So the interesting line is:
My Windows also identify themselves as WINDOW_OPENER_WITH_RAIN_SENSOR - and there it works correctly. What model are your windows? Mine are Velux roof windows from about 2017. And if you look at the Velux KLF 200 API specs (page 114), it says:
So there is aditionally a typo / error in the API documentation. |
These are Velux roof windows as well. These are the newly released motorized with vasistas opening. These have been added to the catalogue just last April, I ordered immediately (I was waiting for those to be released) and my authorized dealer says it's one of the first sent out and installed. I tried also with the remote, with different positions of the handle... They always go to 1 when closed. |
Is this a matter of calibration? I don't know whether and how it's possible to recalibrate, though. I have a cover which reports 1% only sometimes when it's closed - more often in winter than in summer. |
Hi, I'm having the same problem/symptom as described above. I tried to debug it, but I don't get it. I have 2 shutters and one of them is showing current_position = 1 and the state reports open. Here are some debug logs, but I can't spot the difference that results in the position being 1:
Best regards |
Hi, The problem here is coming from the inaccuracy of some motors. When you set the position of the cover to 51200 (this value correspond to 100% close in the KLF200 API. Range in the API is 0 to 51200 which represent C800 in Hexadecimal), the cover will close and send back the position. HA reads then this position and convert it in integer and percentage (100 - the value read). However, as you are expecting that the cover will send back 51200 when it is closed, some cover will sent a bit less. For Velux SML covers for example, I read 51160 (I use the API to directly read what is coming out of the KLF200). Some over cover seams to be more accurate. My SOMFY Blinds respond exactly 51200 when closed. So when we get 51160, the conversion done in PYVLX results in 99% and not 100% (100% will come out only if you have exactly 51200). That’s why we get 1% (100-99) instead of 0. A simple solution will be to slightly modify the conversion done in PYVLX, which takes place in the parameter.py file, function « to_percent(raw) ». For now the formula is int(raw[0] / 2). I suggest to change it to int((raw[0] / 2) + 0.5). Adding the 0.5 will solve the problem of inaccuracy that we have with Velux cover. I hope that Julius2342 will agree to this and make the modifications. Thank you! |
@Nicks57 : I think your considerations sound reasonable. May I ask you to do a PR? (It would be great if you could add a comment to the line of code, describing the reason behind the formula). Thank you in advance! Julius |
@Julius2342 Sorry but I'm not very familiar to GitHub: to which branch should I do the Pull Request? Thank you! |
To |
@Julius2342 I would appreciate your help. Create Pull Request to Master is greyed out here... Thx |
Is it to master on this repo? |
you have to push your changes first to a remote branch (!= master) on your repo ( git@github.com:Nicks57/pyvlx.git ). If you have a local checkout:
|
…ctly 51200 as final position when closed. Fixes Julius2342/pyvlx #47
@Julius2342 Done! Hope I made no mistake. Thank you for your help! Man lernt nie aus :-) |
Your PR goes into master of your repository. You have to change the target branch to |
Hello, I'm a proud owner of two of the newly released motorized windows with vasistas opening.
Successfully paired and operated with HA through KLF 200, but when these are completely closed the status attribute reports 1% opening instead of 0%. Thus in HA it is not reported as "closed" and the close button is not deactivated.
Note that another window with "traditional" opening is correctly reporting 0% when closed, so it must be something related to the implementation of this new model.
Available to debug and/or provide logs.
The text was updated successfully, but these errors were encountered: