Skip to content

Add model type 72 (Silhouette) #41

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

ehendrix23
Copy link

Added model type 72 (Silhouette) to ShadeBottomUpTiltOnClosed90 as capability reported by this blind is incorrect.

Fixes issue #40

@kingy444
Copy link
Collaborator

kingy444 commented May 9, 2025

It sure this is the fix to the issue.

From the issue #40 you raised this will now break Tilt as well

I've been on some personal/family time for a while but should find time to come back to look at the outstanding issues on this. Got a feeling this one may be related to another fix I started and didn't finish yet.

@ehendrix23
Copy link
Author

Yep, it is. I forked your repository and did this change. Then I copied the HASS integration as a custom component so I can use my fork with my fix in it through HASS.
Been using it yesterday and today all day without issues.
I can open/close the blind to any position from any position.
I can also set the tilt to any position.
If blind is not closed when setting tilt to anything but 0 it will close the blind and then do the tilt.

All in all, it is now working as expected with the commit I provided. :-)

@kingy444
Copy link
Collaborator

kingy444 commented May 9, 2025

Can you provide the json for the shades - what capabilities were they originally reporting ? There could be an issue in that class I need to look into

@ehendrix23
Copy link
Author

Sure, here you go:

[
{"id":2,"type":72,"name":"QmFjayAgTGVmdA==","ptName":"Back  Left","motion":null,"capabilities":2,"powerType":0,"batteryStatus":3,"roomId":1,"firmware":{"revision":3,"subRevision":0,"build":417},"positions":{"primary":1,"secondary":0,"tilt":0,"velocity":0},"signalStrength":-55,"bleName":"HLO:B285","shadeGroupIds":[],"serialNumber":"<serial>"},
{"id":11,"type":72,"name":"QmFjayAgUmlnaHQ=","ptName":"Back  Right","motion":null,"capabilities":2,"powerType":0,"batteryStatus":3,"roomId":1,"firmware":{"revision":3,"subRevision":0,"build":417},"positions":{"primary":1,"secondary":0,"tilt":0,"velocity":0},"signalStrength":-56,"bleName":"HLO:83EA","shadeGroupIds":[],"serialNumber":"<serial>"},
{"id":17,"type":72,"name":"U2luaw==","ptName":"Sink","motion":null,"capabilities":2,"powerType":0,"batteryStatus":3,"roomId":16,"firmware":{"revision":3,"subRevision":0,"build":417},"positions":{"primary":1,"secondary":0,"tilt":0,"velocity":0},"signalStrength":-75,"bleName":"HLO:69CB","shadeGroupIds":[],"serialNumber":"<serial>"}
]

They are reporting capability 2 which resulted in them getting the bottomUp I believe but with tilt anywhere resulting in the call always including the tilt parameter.
But in reality they are bottomUp tilt on close as the tilt has to be closed when you open them (roll-up).
These are the Silhouette blinds.

@kingy444
Copy link
Collaborator

TiltOnClosed has historically indicated that the tilt should only work when the blinds are closed. Not that the tilt needs to be closed to open them

From what you posted it sounded like perhaps the issue was only with the open/close buttons, and the positional changes work as expected.

Can you confirm if (using the old code) and changing the positional changes using the UI (as opposed to the open close buttons) results in the same outcome?

I recall one of the things I needed to fix was the close position on one of the classes - which I suspect may be the cause here

There is a lot of crossover between the classes so it's entirely possible that what you have done works, it doesn't rule out an issue in the code for their true type though

@ehendrix23
Copy link
Author

With the old, pushing the open button would not work. Pushing the close button did work. Changing the position to any % except for 0% would not work either.
The problem being that for any of them the tilt was provided as well in the call and thus the blind only changes tilt and to do so the blind always closes first.
For example, if the blind is at 50% and I set it to open, then the blind would close instead as at that time tilt is 0 and thus the blind would close.
If however the blind position is at 50% and I set a tilt of 40% then it would work and the blind would 1st close and then change the tilt to 40%.

0 < Position => 100 (tilt is then always 0) -> set position to anything else non-zero => position goes to 0% (blind closes)
0 < Position => 100 (tilt is then always 0) -> set tilt to anything non-zero => position goes to 0% (blind closes) and then tilt is set

From the API, when we're setting tilt we only need to provide the tilt parameter in the call, not the position as the blind will automatically close if not closed and then set tilt.
When we're setting position we cannot provide the tilt otherwise the blind will always close and then set the tilt. Current tilt of the blinds can be anything, they will automatically change tilt then to 0 and then adjust the position to what was requested. BUT, if tilt was provided in the API call then only tilt will be adjusted and not position.

@ehendrix23
Copy link
Author

FYI,

I've been using this change with my blind now for few weeks without issues. Open, close, tilt all works.

@kingy444
Copy link
Collaborator

With the old, pushing the open button would not work. Pushing the close button did work.

Based on this comment - could you please try the below as a fix for all type 2 shades instead of hardcoding them.
This _open_position has always included the tilt and as you have reported that as working this would indicate that the shade can handle receiving both tilt and move commands (as long as those commands are compatible positions)

https://github.com/kingy444/aio-powerview-api/blob/shade72/aiopvapi/resources/shade.py
compare avail here master...kingy444:aio-powerview-api:shade72

@ehendrix23
Copy link
Author

That is not going to work. If I /home/shades/positions?ids=
and provide the following:
'{"positions": {"primary": 0.7, "tilt": 0.0, "velocity": 0.0}}'

Then the shade opens completely instead of going to 70% even although tilt is always will be 0 unless position is 0 in which case tilt can be something different.
"positions":{"primary":0,"secondary":0,"tilt":0,"velocity":0}

If I provide this:
'{"positions": {"primary": 0.7, "tilt": 1.0, "velocity": 0.0}}'
Then nothing changes, so setting tilt to minimum or maximum doesn't do it:
"positions":{"primary":0,"secondary":0,"tilt":1,"velocity":0}

If I then provide this:
'{"positions": {"primary": 1.0, "tilt": 0.0, "velocity": 0.0}}'
Even although tilt should be 0 to close the blind (position 1), it doesn't do it.:
"positions":{"primary":0,"secondary":0,"tilt":0.0,"velocity":0}

Now if I provide this (no tilt provided):
'{"positions": {"primary": 1.0, "velocity": 0.0}}'
Now was I did not provide any tilt, the blind closes:
"positions":{"primary":1,"secondary":0,"tilt":0,"velocity":0}

If I then provide:
'{"positions": {"primary": 1.0, "tilt": 0.5, "velocity": 0.0}}'
We get:
"positions":{"primary":1,"secondary":0,"tilt":0,"velocity":0}

And with this:
'{"positions": {"tilt": 0.5, "velocity": 0.0}}'
Not providing position, only tilt and the blind opened first and then did the tilt:
"positions":{"primary":0,"secondary":0,"tilt":0.5,"velocity":0}

Starting again from this:
"positions":{"primary":1,"secondary":0,"tilt":0,"velocity":0}
And doing this:
'{"positions": {"primary": 0.0, "tilt": 0.5, "velocity": 0.0}}

Providing position and tilt works as long as we provide the position of 0, but I think this is more because the blind prefers setting blind based on tilt and only if not provided then uses the position (refer back to my 1st example):
"positions":{"primary":0,"secondary":0,"tilt":0.5,"velocity":0}

If I do this:
'{"positions": {"primary": 0.8, "tilt": 0.2, "velocity": 0.0}}'
we can see that tilt took preference over position:
"positions":{"primary":0,"secondary":0,"tilt":0.2,"velocity":0}

Providing a tilt of 0 and a position of non-zero just results in the blind completely opening ending with position=0 and tilt=0.
Providing any non-zero position and a non-zero tilt results in blind just using the tilt.

In the end, if we want to change the position then we can't provide the tilt. And if we want to change the tilt then it is best not to provide the position although normally it looks like tilt always gets preference.

Hope this explains the behavior and when I looked it really is behaving the same as the other silhouette with model type 23.

@ehendrix23
Copy link
Author

Just checking on this to see if my examples and what I see explains behavior.

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

Successfully merging this pull request may close these issues.

2 participants