Closed adattada-samuel closed 3 months ago
Hey there @jc2k, @bdraco, mind taking a look at this issue as it has been labeled with an integration (homekit_controller
) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)
homekit_controller documentation homekit_controller source (message by IssueLinks)
Problem found and solved locally by cleaning up below function in 'cover.py' - now less lines of code and covering all scenarios.
async def async_set_cover_tilt_position(self, **kwargs: Any) -> None:
"""Move the cover tilt to a specific position."""
tilt_position = kwargs[ATTR_TILT_POSITION]
if self.is_vertical_tilt:
minValue = self.service[CharacteristicsTypes.VERTICAL_TILT_CURRENT].minValue
maxValue = self.service[CharacteristicsTypes.VERTICAL_TILT_CURRENT].maxValue
# Recalculate tilt_position. Convert from 1-100 scale to arc degree scale respecting possible min/max Values.
totalRange = maxValue - minValue
tilt_position = int(tilt_position / 100 * totalRange + minValue)
# Set tilt_position.
await self.async_put_characteristics(
{CharacteristicsTypes.VERTICAL_TILT_TARGET: tilt_position}
)
elif self.is_horizontal_tilt:
minValue = self.service[CharacteristicsTypes.HORIZONTAL_TILT_TARGET].minValue
maxValue = self.service[CharacteristicsTypes.HORIZONTAL_TILT_TARGET].maxValue
# Recalculate tilt_position. Convert from 1-100 scale to arc degree scale respecting possible min/max Values.
totalRange = maxValue - minValue
tilt_position = int(tilt_position / 100 * totalRange + minValue)
# Set tilt_position.
await self.async_put_characteristics(
{CharacteristicsTypes.HORIZONTAL_TILT_TARGET: tilt_position}
)
Hi @Jc2k, @bdraco - can you please create a PR or give me the permission to do so?
I think the problem is still present - 2024.6.3
Hi @Jc2k, @bdraco - can you please create a PR or give me the permission to do so?
No need to ask for permission, feel free to open a PR
@bdraco Happy to do so, but I believe I do not have the permission to create a branch in this repo ... at least I get a permission error in the console.
Happy to do so, but I believe I do not have the permission to create a branch in this repo ... at least I get a permission error in the console.
In GitHub speak, you create a fork. You can make as many branches as you like in your own fork, then make a PR from your repo into ours. None of this requires us to give you permission. It is very bad security practice to give strangers access to your own GitHub repositories directly. Their contributions need to come via pull requests from their personal forks.
Any changes you make will need to pass the tests. It looks like the existing tests aren't adequate and because we don't have the problematic devices, would be really glad to add more tests.
Ok. Fine with this approach. Will do so.
@Jc2k, @bdraco - pull request finally done today. Thanks for taking it forward. https://github.com/home-assistant/core/pull/123532
The problem
Homekit integration send wrong value for "Tile close" to Velux Gateway.
As a result I am not able to close/darken the venetian blinds from HomeAssistant.
Thanks for any help, Samuel
Observations: When using Somfy remote or Velux Gateway the tilt command leads to expected 90/-90 values received by the homekit integration.
When sending tilt from HomeAssistant, the log from Homekit integration shows 90/0 instead of 90/-90:
What version of Home Assistant Core has the issue?
core-2024.1.6
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant Container
Integration causing the issue
Homekit
Link to integration documentation on our website
https://www.home-assistant.io/integrations/homekit_controller
Diagnostics information
home-assistant_homekit_controller_2024-04-07T10-34-27.000Z.log
Example YAML snippet
No response
Anything in the logs that might be useful for us?
No response
Additional information
No response