core: Cover tilt not working when using HomeKit-Controller with a Somfy TaHoma Box
The problem
The tilt feature of covers is not working properly when using HomeKit-Controller in connection with the Somfy TaHoma box.
When using the TaHoma box on iOS HomeKit directly, one can control the tilt position of the covers without any issues. When using the TaHoma box with HA HomeKit-Controller, tilt is working only to a very limited extend.
The following services don’t work at all:
cover.close_cover_tiltcover.open_cover_tiltcover.stop_cover_tiltcover.toggle_cover_tilt
The service cover.set_cover_tilt_position is working only to a very limited extend:
when calling the service cover.set_cover_tilt_position with a value (can be any value, for example: 0, 25, 50, 100, etc.) it always closes the tilt of the cover completly. One cannot set any other position or open the tilt.
The HomeKit-Controller does support tilt already, but there seems to be a bug in its functionality at this point: https://github.com/home-assistant/core/blob/fc1899987aae9edf1f91100bf4f22766732bc835/homeassistant/components/homekit_controller/cover.py#L202
What version of Home Assistant Core has the issue?
core-2021.12.7
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant OS
Integration causing the issue
homekit_controller
Link to integration documentation on our website
https://www.home-assistant.io/integrations/homekit_controller
Example YAML snippet
service: cover.set_cover_tilt_position
data:
tilt_position: 25
target:
entity_id: cover.office
### Anything in the logs that might be useful for us?
_No response_
### Additional information
_No response_
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 2
- Comments: 41 (31 by maintainers)
This is great, cheers.
So when tilt support was added it wasn’t mapped properly. Someone assumed homekit used percentages, but it uses arcdegrees from -90 to 90. For your device is -90 to 0. So 25 does get passed to aiohomekit, but it clips it to the -90 to 0 scale, which is 0. Same for every value you try. Tilt support has likely never worked.
I need to understand more about these devices to be able to fix it. Are some -90 to 0 and some 0 to 90? Could there be a device where 90 is fully open? Or where 90 is fully closed? Do you have any ideas here?
Awesome! Error is gone, thanks so much! Will get it pushed through later in the day.
“which pytest” “which pylint”
Which is a shell command.
@maimat1 @zazDuTuitisme @Jc2k any chance to put this all together into a PR for a review? Spring is here soon an the tilt feature will probably be used more than in winter. Would be awesome if some of the cracks can have a look at it. Thanks so much 😃
And yes it does. If you search the integration for minValue you should find some examples.
No sorry. I’ve got capacity to review pull requests and do basic triage but not much else right now.
At this point we know I need to support 0-90 and 0 to -90. 0 always seems to be closed. I’m happy to proceed on the assumption that there are no e.g. -45 to 45 devices.
But it might be a long wait for me to get to this, i’m a bit crushed irl atm and then my priority is to help a new contributor get their work on thread support merged and released. Its a massive PR so might be a while before I can think about how to resolve this issue.