Cover tilt not working when using HomeKit-Controller with a Somfy TaHoma Box
See original GitHub issueThe 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_tilt
cover.open_cover_tilt
cover.stop_cover_tilt
cover.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_
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:22 (7 by maintainers)
Top GitHub Comments
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?
And yes it does. If you search the integration for minValue you should find some examples.