home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
69.83k stars 28.95k forks source link

Value dimmable bulbs lasts only a few seconds homekit device #110299

Closed Lastless closed 1 week ago

Lastless commented 4 months ago

The problem

When I set a value from the home assistant (either as an automation or manually from the dashboard, after a few seconds it returns to the value set by the app that owns the lights. If you put 75 in the app that owns the lights and 10 in the home assistant, after 3 seconds the lights are set to 75. I use homekit devices as integration, turning it off and on works correctly.

What version of Home Assistant Core has the issue?

core-2024.2.1

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 Device

Link to integration documentation on our website

https://www.home-assistant.io/integrations/homekit_controller

Diagnostics information

home-assistant_homekit_controller_2024-02-11T22-42-48.346Z.log

Example YAML snippet

No response

Anything in the logs that might be useful for us?

2024-02-11 23:42:04.084 DEBUG (MainThread) [aiohomekit.controller.ip.connection] IP: raw request: b'PUT /characteristics HTTP/1.1\r\nHost: IP\r\nContent-Length: 51\r\nContent-Type: application/hap+json\r\n\r\n{"characteristics":[{"aid":117,"iid":9,"value":1}]}'
2024-02-11 23:42:05.058 DEBUG (MainThread) [aiohomekit.controller.ip.connection] IP: raw response: bytearray(b'')
2024-02-11 23:42:05.058 DEBUG (MainThread) [aiohomekit.controller.abstract] callback ev:{(117, 9): {'value': 1}}
2024-02-11 23:42:05.058 DEBUG (MainThread) [homeassistant.components.homekit_controller.connection] Called async_set_available_state with True for MAC
2024-02-11 23:42:07.430 DEBUG (MainThread) [aiohomekit.controller.abstract] callback ev:{(117, 10): {'value': 100}}
2024-02-11 23:42:07.431 DEBUG (MainThread) [homeassistant.components.homekit_controller.connection] Called async_set_available_state with True for MAC
2024-02-11 23:42:09.043 DEBUG (MainThread) [aiohomekit.controller.ip.connection] IP: raw request: b'PUT /characteristics HTTP/1.1\r\nHost: IP\r\nContent-Length: 83\r\nContent-Type: application/hap+json\r\n\r\n{"characteristics":[{"aid":117,"iid":10,"value":58},{"aid":117,"iid":9,"value":1}]}'
2024-02-11 23:42:11.690 DEBUG (MainThread) [aiohomekit.controller.ip.connection] IP: raw response: bytearray(b'')
2024-02-11 23:42:11.690 DEBUG (MainThread) [aiohomekit.controller.abstract] callback ev:{(117, 10): {'value': 58}, (117, 9): {'value': 1}}
2024-02-11 23:42:11.690 DEBUG (MainThread) [homeassistant.components.homekit_controller.connection] Called async_set_available_state with True for MAC
2024-02-11 23:42:11.725 DEBUG (MainThread) [aiohomekit.controller.abstract] callback ev:{(117, 10): {'value': 58}}
2024-02-11 23:42:11.725 DEBUG (MainThread) [homeassistant.components.homekit_controller.connection] Called async_set_available_state with True for MAC
2024-02-11 23:42:13.348 DEBUG (MainThread) [aiohomekit.controller.abstract] callback ev:{(117, 10): {'value': 100}}
2024-02-11 23:42:13.349 DEBUG (MainThread) [homeassistant.components.homekit_controller.connection] Called async_set_available_state with True for MAC
2024-02-11 23:42:15.213 DEBUG (MainThread) [aiohomekit.controller.ip.connection] IP: raw request: b'PUT /characteristics HTTP/1.1\r\nHost: IP\r\nContent-Length: 83\r\nContent-Type: application/hap+json\r\n\r\n{"characteristics":[{"aid":117,"iid":10,"value":72},{"aid":117,"iid":9,"value":1}]}'
2024-02-11 23:42:16.330 DEBUG (MainThread) [aiohomekit.controller.ip.connection] IP: raw response: bytearray(b'')
2024-02-11 23:42:16.330 DEBUG (MainThread) [aiohomekit.controller.abstract] callback ev:{(117, 10): {'value': 72}, (117, 9): {'value': 1}}
2024-02-11 23:42:16.330 DEBUG (MainThread) [homeassistant.components.homekit_controller.connection] Called async_set_available_state with True for MAC
2024-02-11 23:42:16.390 DEBUG (MainThread) [aiohomekit.controller.abstract] callback ev:{(117, 10): {'value': 72}}
2024-02-11 23:42:16.390 DEBUG (MainThread) [homeassistant.components.homekit_controller.connection] Called async_set_available_state with True for MAC
2024-02-11 23:42:18.686 DEBUG (MainThread) [aiohomekit.controller.abstract] callback ev:{(117, 10): {'value': 100}}
2024-02-11 23:42:18.686 DEBUG (MainThread) [homeassistant.components.homekit_controller.connection] Called async_set_available_state with True for MAC
2024-02-11 23:42:19.979 DEBUG (MainThread) [aiohomekit.controller.ip.connection] IP: raw request: b'PUT /characteristics HTTP/1.1\r\nHost: IP\r\nContent-Length: 83\r\nContent-Type: application/hap+json\r\n\r\n{"characteristics":[{"aid":117,"iid":10,"value":27},{"aid":117,"iid":9,"value":1}]}'
2024-02-11 23:42:21.919 DEBUG (MainThread) [aiohomekit.controller.ip.connection] IP: raw response: bytearray(b'')
2024-02-11 23:42:21.920 DEBUG (MainThread) [aiohomekit.controller.abstract] callback ev:{(117, 10): {'value': 27}, (117, 9): {'value': 1}}
2024-02-11 23:42:21.920 DEBUG (MainThread) [homeassistant.components.homekit_controller.connection] Called async_set_available_state with True for MAC
2024-02-11 23:42:21.940 DEBUG (MainThread) [aiohomekit.controller.abstract] callback ev:{(117, 10): {'value': 27}}
2024-02-11 23:42:21.940 DEBUG (MainThread) [homeassistant.components.homekit_controller.connection] Called async_set_available_state with True for MAC
2024-02-11 23:42:24.200 DEBUG (MainThread) [aiohomekit.controller.abstract] callback ev:{(117, 10): {'value': 100}}
2024-02-11 23:42:24.202 DEBUG (MainThread) [homeassistant.components.homekit_controller.connection] Called async_set_available_state with True for MAC
2024-02-11 23:42:26.685 DEBUG (MainThread) [homeassistant.components.homekit_controller.connection] Starting HomeKit device update: MAC
2024-02-11 23:42:26.687 DEBUG (MainThread) [aiohomekit.controller.ip.connection] IP: raw request: b'GET /characteristics?id=118.9,131.9,122.9,117.10,120.9,109.9,100.9,133.9,111.9,102.9,108.10,113.9,104.9,115.9,117.9,119.9,118.10,108.9,132.9 HTTP/1.1\r\nHost: IP\r\n\r\n'
2024-02-11 23:42:26.882 DEBUG (MainThread) [aiohomekit.controller.ip.connection] IP: raw response: bytearray(b'{"characteristics":[{"aid":118,"iid":9,"value":false},{"aid":131,"iid":9,"value":false},{"aid":122,"iid":9,"value":false},{"aid":117,"iid":10,"value":100},{"aid":120,"iid":9,"value":false},{"aid":109,"iid":9,"value":false},{"aid":100,"iid":9,"value":false},{"aid":133,"iid":9,"value":false},{"aid":111,"iid":9,"value":false},{"aid":102,"iid":9,"value":false},{"aid":108,"iid":10,"value":0},{"aid":113,"iid":9,"value":false},{"aid":104,"iid":9,"value":false},{"aid":115,"iid":9,"value":false},{"aid":117,"iid":9,"value":true},{"aid":119,"iid":9,"value":false},{"aid":118,"iid":10,"value":0},{"aid":108,"iid":9,"value":false},{"aid":132,"iid":9,"value":false}]}')
2024-02-11 23:42:26.882 DEBUG (MainThread) [homeassistant.components.homekit_controller.connection] Called async_set_available_state with True for MAC
2024-02-11 23:42:26.882 DEBUG (MainThread) [homeassistant.components.homekit_controller.connection] Finished HomeKit device update: MAC

Additional information

No response

home-assistant[bot] commented 4 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!

Code owner commands Code owners of `homekit_controller` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign homekit_controller` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


homekit_controller documentation homekit_controller source (message by IssueLinks)

Jc2k commented 4 months ago

I need the diagnostic JSON data the template asks for so that I can map the iid data in the log to characteristics uuids.

Jc2k commented 4 months ago

Guessing that iid 10 is brightness.

I see us write the value you request. Then there are 3 callbacks. One is because the write was accepted. The next 2 are events from the device. It acknowledges the brightness and then reverts to 100%. We never request 100%, the device just jumps to it.

The doesn't happen with other lights, so it seems to be a quirk of these lights.

Lastless commented 4 months ago

The problem occurs on all the lights, not just this one, I am now attaching the JSON diagnostic.

config_entry-homekit_controller-cc7ac6e106bec50cbaa6f1ace37364ec.json

Jc2k commented 4 months ago

I meant it doesn't happen with eg Hue, Nanoleaf, Koogeek, Ikea.. so it's a quirk of Vimar. Vimar are handling the spec different to all the other manufacturers.

Are you able to test with the iOS Home app to confirm it works as expected there?

My hunch is that when we send the "on" command it sets the brightness to 100. And so when we send brightness and on together, most devices process the "on" first, then set the brightness.

Lastless commented 3 months ago

I'm waiting for a friend with an iphone... so there isn't nothing i can do?

Lastless commented 3 months ago

Hello there,

I tested with an iPad, everything is ok, even in Alexa or in the Vimar app, only Home Assistant has this problem.

issue-triage-workflows[bot] commented 2 weeks ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.