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

Incorrect Current Orientation with Somfy Venetian Blind #44

Open
dumpfheimer opened this issue Jul 7, 2020 · 70 comments
Open

Incorrect Current Orientation with Somfy Venetian Blind #44

dumpfheimer opened this issue Jul 7, 2020 · 70 comments

Comments

@dumpfheimer
Copy link
Contributor

Servus!

Yesterday I started migrating my Home Assistant -> Somfy Connexoon to HA -> Velux KFL 200 which worked kind of nicely, but the "tilt position" (=orientation) was missing. So I went ahead and added that to HA.

Setting the orientation works flawlessly, but it always shows strange "current orientation" values. I then set pyvlx to debug and it seems like it is receiving those strange values from the blind. But I was hoping you could confirm that for me.

IF it is the blind, that is sending strange/unhandled signals, would it be possible to use the sent values as current values for this particular blind/product? It did show the right position in the Somfy App.
IF it is not the blind. Do you have any idea what those values could mean? I went through the code and came to the conclusion it actually is within the "position range" which - I guess - would mean it would be a pretty inconvenient "special value"

I appreciate any help.

Vielen Dank!

I copied 2 debug logs from when I tried to set the orientation (it did set it correctly)

EXAMPLE 1

Jul 6 21:00:34 server run.sh[3602197]: 2020-07-06 21:00:34 DEBUG (MainThread) [pyvlx] SEND: <FrameCommandSendRequest node_ids=[3] parameter="10 %" functional_parameter="fp1: 0 %, fp2: 0 %, fp3: 100 %, fp4: 0 %, fp5: 0 %, fp6: 0 %, fp7: 0 %, fp8: 0 %, fp9: 0 %, fp10: 0 %, fp11: 0 %, fp12: 0 %, fp13: 0 %, fp14: 0 %, fp15: 0 %, fp16: 0 %, " session_id=56 originator=Originator.USER/>
Jul 6 21:00:34 server run.sh[3602197]: 2020-07-06 21:00:34 DEBUG (MainThread) [pyvlx] REC: <FrameCommandSendConfirmation session_id=56 status=CommandSendConfirmationStatus.ACCEPTED/>
Jul 6 21:00:34 server run.sh[3602197]: 2020-07-06 21:00:34 DEBUG (MainThread) [pyvlx] REC: <FrameNodeStatePositionChangedNotification node_id=3 state=2 current_position='0x13FC' target='0x1400' current_position_fp1='0xF7FF' current_position_fp2='0xF7FF' current_position_fp3='0xF7FF' current_position_fp4='0xF7FF' remaining_time=0 time='2032-02-08 12:54:40'/>
Jul 6 21:00:34 server run.sh[3602197]: 2020-07-06 21:00:34 DEBUG (MainThread) [pyvlx] NodeUpdater process frame: <FrameNodeStatePositionChangedNotification node_id=3 state=2 current_position='0x13FC' target='0x1400' current_position_fp1='0xF7FF' current_position_fp2='0xF7FF' current_position_fp3='0xF7FF' current_position_fp4='0xF7FF' remaining_time=0 time='2032-02-08 12:54:40'/>
Jul 6 21:00:34 server run.sh[3602197]: 2020-07-06 21:00:34 DEBUG (MainThread) [pyvlx] Living Room Left position changed to: 9 %
Jul 6 21:00:34 server run.sh[3602197]: 2020-07-06 21:00:34 DEBUG (MainThread) [pyvlx] REC: <FrameCommandRunStatusNotification session_id=56 status_id=1 index_id=3 node_parameter=0 parameter_value=5116/>
Jul 6 21:00:34 server run.sh[3602197]: 2020-07-06 21:00:34 DEBUG (MainThread) [pyvlx] REC: <FrameCommandRemainingTimeNotification session_id=56 index_id=3 node_parameter=0 seconds=1/>
Jul 6 21:00:34 server run.sh[3602197]: 2020-07-06 21:00:34 DEBUG (MainThread) [pyvlx] REC: <FrameNodeStatePositionChangedNotification node_id=3 state=4 current_position='0x13FC' target='0x1400' current_position_fp1='0xF7FF' current_position_fp2='0xF7FF' current_position_fp3='0x39BD' current_position_fp4='0xF7FF' remaining_time=1 time='2032-02-08 12:54:40'/>
Jul 6 21:00:34 server run.sh[3602197]: 2020-07-06 21:00:34 DEBUG (MainThread) [pyvlx] NodeUpdater process frame: <FrameNodeStatePositionChangedNotification node_id=3 state=4 current_position='0x13FC' target='0x1400' current_position_fp1='0xF7FF' current_position_fp2='0xF7FF' current_position_fp3='0x39BD' current_position_fp4='0xF7FF' remaining_time=1 time='2032-02-08 12:54:40'/>
Jul 6 21:00:34 server run.sh[3602197]: 2020-07-06 21:00:34 DEBUG (MainThread) [pyvlx] Living Room Left position changed to: 9 %
Jul 6 21:00:34 server run.sh[3602197]: 2020-07-06 21:00:34 DEBUG (MainThread) [pyvlx] Living Room Left orientation changed to: 28 %
Jul 6 21:00:36 server run.sh[3602197]: 2020-07-06 21:00:36 DEBUG (MainThread) [pyvlx] REC: <FrameCommandRunStatusNotification session_id=56 status_id=1 index_id=3 node_parameter=0 parameter_value=5116/>
Jul 6 21:00:36 server run.sh[3602197]: 2020-07-06 21:00:36 DEBUG (MainThread) [pyvlx] REC: <FrameSessionFinishedNotification session_id=56 />
Jul 6 21:00:36 server run.sh[3602197]: 2020-07-06 21:00:36 DEBUG (MainThread) [pyvlx] REC: <FrameNodeStatePositionChangedNotification node_id=3 state=5 current_position='0x13FC' target='0x1400' current_position_fp1='0xF7FF' current_position_fp2='0xF7FF' current_position_fp3='0x39BD' current_position_fp4='0xF7FF' remaining_time=0 time='2032-02-10 01:19:12'/>
Jul 6 21:00:36 server run.sh[3602197]: 2020-07-06 21:00:36 DEBUG (MainThread) [pyvlx] NodeUpdater process frame: <FrameNodeStatePositionChangedNotification node_id=3 state=5 current_position='0x13FC' target='0x1400' current_position_fp1='0xF7FF' current_position_fp2='0xF7FF' current_position_fp3='0x39BD' current_position_fp4='0xF7FF' remaining_time=0 time='2032-02-10 01:19:12'/>
Jul 6 21:00:36 server run.sh[3602197]: 2020-07-06 21:00:36 DEBUG (MainThread) [pyvlx] Living Room Left position changed to: 9 %
Jul 6 21:00:36 server run.sh[3602197]: 2020-07-06 21:00:36 DEBUG (MainThread) [pyvlx] Living Room Left orientation changed to: 28 %

EXAMPLE 2

Jul 6 21:01:09 server run.sh[3602197]: 2020-07-06 21:01:09 DEBUG (MainThread) [pyvlx] SEND: <FrameCommandSendRequest node_ids=[3] parameter="20 %" functional_parameter="fp1: 0 %, fp2: 0 %, fp3: 100 %, fp4: 0 %, fp5: 0 %, fp6: 0 %, fp7: 0 %, fp8: 0 %, fp9: 0 %, fp10: 0 %, fp11: 0 %, fp12: 0 %, fp13: 0 %, fp14: 0 %, fp15: 0 %, fp16: 0 %, " session_id=57 originator=Originator.USER/>
Jul 6 21:01:10 server run.sh[3602197]: 2020-07-06 21:01:10 DEBUG (MainThread) [pyvlx] REC: <FrameCommandSendConfirmation session_id=57 status=CommandSendConfirmationStatus.ACCEPTED/>
Jul 6 21:01:10 server run.sh[3602197]: 2020-07-06 21:01:10 DEBUG (MainThread) [pyvlx] REC: <FrameNodeStatePositionChangedNotification node_id=3 state=2 current_position='0x13FC' target='0x2800' current_position_fp1='0xF7FF' current_position_fp2='0xF7FF' current_position_fp3='0x39BD' current_position_fp4='0xF7FF' remaining_time=0 time='2032-03-06 20:16:16'/>
Jul 6 21:01:10 server run.sh[3602197]: 2020-07-06 21:01:10 DEBUG (MainThread) [pyvlx] NodeUpdater process frame: <FrameNodeStatePositionChangedNotification node_id=3 state=2 current_position='0x13FC' target='0x2800' current_position_fp1='0xF7FF' current_position_fp2='0xF7FF' current_position_fp3='0x39BD' current_position_fp4='0xF7FF' remaining_time=0 time='2032-03-06 20:16:16'/>
Jul 6 21:01:10 server run.sh[3602197]: 2020-07-06 21:01:10 DEBUG (MainThread) [pyvlx] Living Room Left position changed to: 9 %
Jul 6 21:01:10 server run.sh[3602197]: 2020-07-06 21:01:10 DEBUG (MainThread) [pyvlx] Living Room Left orientation changed to: 28 %
Jul 6 21:01:10 server run.sh[3602197]: 2020-07-06 21:01:10 DEBUG (MainThread) [pyvlx] REC: <FrameCommandRunStatusNotification session_id=57 status_id=1 index_id=3 node_parameter=0 parameter_value=5116/>
Jul 6 21:01:10 server run.sh[3602197]: 2020-07-06 21:01:10 DEBUG (MainThread) [pyvlx] REC: <FrameCommandRemainingTimeNotification session_id=57 index_id=3 node_parameter=0 seconds=5/>
Jul 6 21:01:10 server run.sh[3602197]: 2020-07-06 21:01:10 DEBUG (MainThread) [pyvlx] REC: <FrameNodeStatePositionChangedNotification node_id=3 state=4 current_position='0x13FC' target='0x2800' current_position_fp1='0xF7FF' current_position_fp2='0xF7FF' current_position_fp3='0xBC3F' current_position_fp4='0xF7FF' remaining_time=5 time='2032-03-06 20:16:16'/>
Jul 6 21:01:10 server run.sh[3602197]: 2020-07-06 21:01:10 DEBUG (MainThread) [pyvlx] NodeUpdater process frame: <FrameNodeStatePositionChangedNotification node_id=3 state=4 current_position='0x13FC' target='0x2800' current_position_fp1='0xF7FF' current_position_fp2='0xF7FF' current_position_fp3='0xBC3F' current_position_fp4='0xF7FF' remaining_time=5 time='2032-03-06 20:16:16'/>
Jul 6 21:01:10 server run.sh[3602197]: 2020-07-06 21:01:10 DEBUG (MainThread) [pyvlx] Living Room Left position changed to: 9 %
Jul 6 21:01:10 server run.sh[3602197]: 2020-07-06 21:01:10 DEBUG (MainThread) [pyvlx] Living Room Left orientation changed to: 94 %

@dumpfheimer
Copy link
Contributor Author

BTW I'm using pyvlx 0.2.16

@bonito1
Copy link

bonito1 commented Jul 16, 2020

Hello dumpfheimer,

could you explain how have you added the "tilt position" to HA exactly?
I have also venetian blinds with Somfy motors but I can not change the "tilt position" via HA. I can move them only up and down via HA.
Have you modified the the velux component?
Could you share your code to add the "tilt position" to a venetian blind?

@dumpfheimer
Copy link
Contributor Author

Hi!

You are right. HA currently does not support that. I have built it myself but have not yet tested it (especially the close tilt and open tilt correctness) and am not sure about the contribution guidelines so I did not dare to create a merge request YET.

Take a look at my changes here if you want to try it yourself:
dumpfheimer/core@1f5006d

@dumpfheimer
Copy link
Contributor Author

Hi!

I tried to investigate the values but I didn't really get smart from them. I wrote a script, that changes the orientation and reads back the response fp3 values. I put them in a CSV maybe somebody gets an idea of what could be going on.

values_1.txt
values_2.txt

@pawlizio
Copy link
Collaborator

pawlizio commented Aug 7, 2020

For tilt position the HA integration has to be adjusted. pyvlx already support that since #33 . For testing you can use my HACS custom component where I already modified HA integration slightly, but not yet as a final solution to create a pull request to velux integration.

I didn't modified HASS yet, as the tilt function has two different options in terms of implementation, depending on the blinds. At somfy tahoma there was the possibility to configure blinds as either as (+90°/-90°) blinds or 0-100 %. The difference is in the code. Both covers requires a value between 0 and 100 for the tilt position, but the blinds with (+90°/-90°) are open at 50% and close at either 0% (=+90°) or 100% (=-90°) while the others are open at 0% and closed at 100% (inverted logic as in HA). In order to catch these different types of blinds, for each blind an additional configuration step is necessary to give the user the possibility to set the correct blind type. My exterior venetian blinds are from type (+90°/-90°), so I hard coded them to be open at 50 and close at 100. This is currently implemented at

async def open_orientation(self, wait_for_completion=True):
"""Open Blind slats orientation.
Blind slats with ±90° orientation are open at 50%
"""
await self.set_orientation(
orientation=Position(position_percent=50),
wait_for_completion=wait_for_completion,
)
async def close_orientation(self, wait_for_completion=True):
"""Close Blind slats."""
await self.set_orientation(
orientation=Position(position_percent=100),
wait_for_completion=wait_for_completion,
)

and called from HA via:

https://github.com/pawlizio/my_velux/blob/d52ffc7a8998f0e93aa5f5de2d99fd0c69c5d742/custom_components/my_velux/cover.py#L139-L145

However if you install custom component you can modify config\custom_components\my_velux\cover.py as follows to manually define the position_percent at which the cover is open/close

    async def async_open_cover_tilt(self, **kwargs):
        """Open cover tilt."""
        orientation = Position(position_percent=0)
        await self.node.set_orientation(orientation=orientation, wait_for_completion=False )

    async def async_close_cover_tilt(self, **kwargs):
        """Close cover tilt."""
        orientation = Position(position_percent=100)
        await self.node.set_orientation(orientation=orientation, wait_for_completion=False )

My HACS custom component: https://github.com/pawlizio/my_velux

@dumpfheimer
Copy link
Contributor Author

Hi!

I modified the Hass code as posted above: dumpfheimer/core@1f5006d

The problem is not setting the orientation - that works fine. The problem is that it seems like the blinds are not sending the correct orientation when sending a status update. Do you have any information on that topic?

@pawlizio
Copy link
Collaborator

pawlizio commented Aug 8, 2020

You mean that you set them to 100 %, but they confirm their position at 28%?

@pawlizio
Copy link
Collaborator

pawlizio commented Aug 8, 2020

But just for clarification, physically they are at 100%?

What is reported if you set them to another value like 25% or 30%?

@dumpfheimer
Copy link
Contributor Author

dumpfheimer commented Aug 8, 2020

Yes, exactly. I intend to e.g. close the blinds with a 45° orientation. The blinds act exactly right and stay in the desired state. But the values reported back in fp3 are random other values that have nothing to do with the current orientation. Furthermore I wrote a script that set the orientation from 0-100 and displayed the responses in binary form. Ignoring the timestamp and checksum I was able to find exact the same responses from varying orientations which lets me believe the blinds do not send the orientation with the status update frame. Or it is hidden very well (within the timestamp for example. Those are not real timestamps)

@dumpfheimer
Copy link
Contributor Author

Any suggestions what I could try?

@pawlizio
Copy link
Collaborator

pawlizio commented Aug 28, 2020

If you can't find any systematic within the feedback I only can suggest to ignore the feedback from the KLF with regards to orientation (fp3 value). In this case you would always have the latest status which you set via home assistant.

@dumpfheimer
Copy link
Contributor Author

I do have a Somfy connexoon AND the velux klf 200. The Somfy App does show the correct orientation. Should I be able to see the traffic between blind and connexoon on the klf200? Maybe I can identify a new frame.

@pawlizio
Copy link
Collaborator

pawlizio commented Aug 28, 2020 via email

@dumpfheimer
Copy link
Contributor Author

And frames sent between connexoon and the blind?

@pawlizio
Copy link
Collaborator

No, I mean if you activate the debug mode you will see all available frames submitted by KLF. But you will not see the whole io-homecontrol communication, only the abstract which is provided by KLF200.

@dumpfheimer
Copy link
Contributor Author

Okay, too bad. Thank you, though.
I guess I will try it anyways and hope the blind might send a broadcast message or something similar that contains a hint.

@dumpfheimer
Copy link
Contributor Author

How would I enable debug mode?

@pawlizio
Copy link
Collaborator

Enable logger for pyvlx at your configuration.yaml as follows:

logger:
  default: warning
  logs:
    pyvlx: debug

@dumpfheimer
Copy link
Contributor Author

Danke!

@dumpfheimer
Copy link
Contributor Author

Does anyone have a contact from somfy or velux whom I could ask about this?
I tried to contact them but never got a response.

@dumpfheimer
Copy link
Contributor Author

@pawlizio is my assumption correct, that you have venetian blinds too?
If so, is the second byte you receive as FP3 always 00?

I am trying to find a workaround for the random values of somfy blinds. My first try would be to ignore the value if the first byte is a position and the second byte is not 0x00

@pawlizio
Copy link
Collaborator

@dumpfheimer yes I have exterior venetian blinds. If I set the orientation in HA the KLF always confirm only F7FF, which is defined as target valux, but pyvlx ignore this, because only values between 0 and 100% are accepted. I also don't get values on HA if I change the orientation with my remotes. But I have no random values as feedback or at least I never observed them.

@Nicks57
Copy link
Contributor

Nicks57 commented Jul 23, 2021

Hello,

I installed yesterday my new KLF200 with latest firmware as well as the Velux HA custom component from pawlizio. First, thanks a lot for the great contribution!
However, I'm facing the same problems as dumpfheimer with my venitian blind (Warema exterior venitian blinds with Somfy IO Home control module integrated). I can perfectly control the orientation of the blades with both my remote control (Somfy Situo 5) and HA. But as current_position, I randomly get either 28% or 75%.
Is there any update on this issue?

Thank you!

@dumpfheimer
Copy link
Contributor Author

Hi!

Nothing new on my side. I set this aside for now even though its annoying me. If more people are having this issue it might be better to ignore the FP3 from the venetian blinds all along and just cache the last set value. This of course should only happen if there are no users that actually get useful feedback on FP3, but I dont know how we could find out if such blinds exist.

There must be some kind of way to actually get the current position, because the somfy connexoon does load the right angle if you change it by eg a remote control. But I'm afraid that would be a huge trial and error mess. I wrote Velux and Somfy asking for help but neither even bothered to answer me.

@Nicks57
Copy link
Contributor

Nicks57 commented Aug 24, 2021

Hi,

In the meantime, I started to work on it. The problem comes from the frame received by the HouseMonitoring function in KLF 200 which is used for example by Home Assistant to update Main Parameter (position) and Functional Parameter (FP3 : orientation). The notification frame received periodically from HouseMonitoring contains correct values for Main Parameter but total abberant values for Functional Parameters (FP1-FP7). In our case, we get for the slats orientation values that are either UNKNOWN, 26% or 73%.... I assume this is a bug in the Velux KLF 200 API and since there is no more support, we have to find another way.
Fortunately, after some testing, there is a command that delivers the correct Functional Parameter values: GW_STATUS_REQUEST_REQ.
I implemented this command in a local copy of Pyvlx this week-end and I'm still testing it. So far, I can get the correct orientation of the slats in Python debugger but finding a solution to call the GW_STATUS_REQUEST_REQ command within the HouseMonitoring seems to be tricky.
I will continue to work on it and when a solution is found, I will submit the code for acceptance by Julius2342.

@dumpfheimer
Copy link
Contributor Author

Glad to test it if you check in your changes.

And thank you for figuring this out!

@Nicks57
Copy link
Contributor

Nicks57 commented Aug 30, 2021

Hi dumpfheimer,

I finished the code implementation. I had to put the GW_STATUS_REQUEST call in the Hearbeat loop because if call when receiving GW_NODE_STATE_POSITION_CHANGED_NTF (House monitoring frame), then the KLF200 send another GW_NODE_STATE_POSITION_CHANGED_NTF frame and we end in an infinite loop.

I tested it on my side in Home Assistant and it is working well. It would be great if you could also test it on your side. You will find the code in my repository Nicks/pyvlx (master branch).

Thank you!

@dumpfheimer
Copy link
Contributor Author

sorry, I must have missed an email.
I will test it as soon as possible, thank you!

@dumpfheimer
Copy link
Contributor Author

Okay, I'm not home, but everything seems to be working normally and I am not getting randomly jumping values for tilt when I change the tilt position. So this looks like an improvement already. When I'm back I will test changing the orientation with the remote and see what happens.

@dumpfheimer
Copy link
Contributor Author

According to the velux api documents there is a "default" value: 0xD300 maybe we can send that, when position is 0 and the blind itself will decied what is best?
Page 102 in
https://velcdn.azureedge.net/-/media/com/api/klf200/technical%20specification%20for%20klf%20200%20api-ver3-16.pdf

@pawlizio
Copy link
Collaborator

Ok, now I got it and yes this need to be adjusted. The blinds are completely closed if position and orientation is 100%. In pyvlx the current orientation will be transmitted as target orientation if the position is changed. What should be considered in case the target position is set to 100% that also the target orientation should be set to 100% in order to completely close the blinds. This is something I have in mind for a long time, but don't find the time for the implementation.

@Nicks57
Copy link
Contributor

Nicks57 commented Oct 26, 2021

@dumpfheimer Same thing in my case, HA set the orientation to 50% and I can see partially the venitian blind from inside. On my side, position 0% is fully closed and 100% is fully open but maybe it depends on the venitian blind or the settings in the custom component.
The problem is that your response frame has a parameter vaue of Hex D800 which is above the MAX Parameter defined in parameter.py. Could be interesting to debug and view the whole frame i.e. which parameter it is in the array.
@pawlizio Thanks for the feedback. I might try to implement it in my fork if I find some time. It shouldn't be too complicated.

@pawlizio
Copy link
Collaborator

In HA is 100% fully open, but 100% in HA is 0 in pyvlx and reverse versa. That's always confusing.

@Nicks57
Copy link
Contributor

Nicks57 commented Oct 26, 2021

Yes very confusing. I was always talking about HA UI :-)

@dumpfheimer
Copy link
Contributor Author

@Nicks57 it looks like D800 is working for me (D300 is not) would you be willing to test if it retracts all the way with your blind?

https://github.com/dumpfheimer/pyvlx/tree/position_parameter_fixes

@Nicks57
Copy link
Contributor

Nicks57 commented Oct 26, 2021

@dumpfheimer I have no access to the code for now, but why not using the hex value corresponding to 100% orientation in HA UI (i.e. C8 00 or 00 00 which correspond to MAX or MIN parameter)? Then we do not need the DEFAULT parameter.

@dumpfheimer
Copy link
Contributor Author

I would be fine with that but I thought your blind would be positioned in a way that it shows out of the box 🤔

@Nicks57
Copy link
Contributor

Nicks57 commented Oct 26, 2021

It is exactly like your blind i.e. the blind shows out of the box if orientation is different from 100% which is the case when I open the venetian blind because pyvlx use always target orientation as FP3 parameter when setting position. So I think target orientation should be C8 00 or 00 00 when position is 0.
To go further, if we would like to make it perfect, every time that the position is changed, pyvlx should read the current orientation and set it as target orientation. For now target orientation is the last orientation set by HA but if one change the orientation in the meantime with the remote control, the target orientation is not updated.

@dumpfheimer
Copy link
Contributor Author

Ah i misunderstood that... nevermind, I'll just send 0 =)

every time that the position is changed, pyvlx should read the current orientation and set it as target orientation

What are you trying to accomplish with that? Seems like a lot of overhead for very little benefit to me.

@Nicks57
Copy link
Contributor

Nicks57 commented Oct 26, 2021

I agree, not many advantages. This would perfect the harmony between the HA and external control (e.g. remote control).

@dumpfheimer
Copy link
Contributor Author

Do you mean that HA would overwrite the position set by the remote control?

@Nicks57
Copy link
Contributor

Nicks57 commented Oct 26, 2021

I have to do some tests tonight but let's take an example to illustrate what I understand pyvlx does:

  1. You open Home Assistant and set blind position to 10% and then slats orientation to 20%
  2. Few minutes later, you take the remote control and change the slats orientation to 40%
  3. Few minutes later, you open Home Assistant and set blind position to 20%
    -> The blind set the position to 20% and set the orientation to 20% and not 40% because target_orientation has not been updated since step 1.

@dumpfheimer
Copy link
Contributor Author

2 things should prevent that:

  1. The heartbeat polls the state so after a few seconds the value should become visible in HA
  2. In my branch I only send the changed value and set the other value to "ignore". So even if the orientation or position was changed in the few seconds between pressing the remote and HA polling the changes the value would not be changed.

@Nicks57
Copy link
Contributor

Nicks57 commented Oct 26, 2021

I just tested it and the behavior is like my thoughts (see previous post). The thing is that target_orientation is only updated when you change the orientation in HA, not when you change the orientation with the remote. But it is used in set_position. It will make more sense to use current orientation.

@dumpfheimer
Copy link
Contributor Author

Are you sure you used this branch? https://github.com/dumpfheimer/pyvlx/tree/position_parameter_fixes

@Nicks57
Copy link
Contributor

Nicks57 commented Oct 26, 2021

Sorry, I didn't see that you made some changes this afternoon. I tested it again and it works like a charm!

@dumpfheimer
Copy link
Contributor Author

Sorry, should have mentioned that.
Thanks for testing! Good to hear it's working 🙌

@pawlizio
Copy link
Collaborator

I'm really confused. I tested my blinds with pyvlx==0.2.19 just now and without any modification they are completely inserted into their storage box when opened the blinds completely, even if the orientation was 50% before.

@dumpfheimer
Copy link
Contributor Author

Interesting. Are you able to change the orientation when position is 0?

@pawlizio
Copy link
Collaborator

@dumpfheimer No, it's not possible when they are inside the box.

@dumpfheimer
Copy link
Contributor Author

Ok, so at least you should not be affected in a negative way by the changes we want to make?

@stephanseitz
Copy link

stephanseitz commented Nov 16, 2021

I've been using this modification for more than 20 days now. it still works perfectly and I couldn't find any side effects, mega! Will this PR make it into an official release? What is still to be done?

@dumpfheimer
Copy link
Contributor Author

Hi!

I too have been using it for quite some time now without any issues.
I still have 2 concerns:

  1. We should make sure the changes do not affect anybody negatively
  2. There was a change in the close orientation position, which benefits the users that have -90/+90 blinds but causes my blind to close only 50% when I press "close"

First of all I dislike this because it is simply not what I need but also this is a change that might affect many other people in an unexpected undesirable way. I have spent dozens of seconds thinking about how to solve this issue but did not come up with a solution yet.

I would propose to take this change out of the PR anyways and make a separate one for that change. That would make me feel much more confident about the PR.

@Nicks57
Copy link
Contributor

Nicks57 commented Nov 17, 2021

Hi

@dumpfheimer : can you give more details on point 2? Is that a change I implemented? Can't remember....

Regarding this issue, the idea that come to my mind is to adapt the close fonction (and I assume the open fonction) to behave properly in the both cases based on a parameter value. This parameter could be set manually by the user in the configuration.yml file or automatically from the model of the actuator (readable in KLF200). I thing stephanseitz and myself have Somfy Exterior Venetian blind Type 17 and you should have another one.

@dumpfheimer
Copy link
Contributor Author

It seems like I have confused something. The change is in the master branch and has been since 2 years - unless I am blamimg the wrong line of code: https://github.com/Julius2342/pyvlx/blame/9a6d1d8988157e546e6f25bb78ccd2bfffa24f7d/pyvlx/opening_device.py#L268

Not sure why this never was an issue for me. But that definately makes things easier if I am more of an exception than the rule.
Also, this more likely affects the "open" function than "close". Hope I'm not missing anything.

BTW, are you okay with me having created the PR #109 ?
I don't want to make you feel like I am stealing your work.

Also, I would be very interested in how you found out what the issue was and how to work around it.

@dumpfheimer
Copy link
Contributor Author

Ah, one more thing. The changes in the Parameter class.
I was receiving strange values from my blind and was able to fix it by not throwing an exception but rather return UNKNOWN for those values. This is a pretty central change that should probably be reviewed by someone more knowledgeable.

I will revert that change and make a seperate PR for that, so we can move on with the blind orientation fix.

@stephanseitz
Copy link

ah cool, thank you very much!

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

No branches or pull requests

6 participants