core icon indicating copy to clipboard operation
core copied to clipboard

Unable to adjust brightness with Vimar 14595.0 via Homekit

Open delli87 opened this issue 8 months ago • 3 comments

The problem

When I try to adjust the brightness from the associated entity the brightness goes down (or up) and then goes back up at the previous level. For example, if I set the brightness to 80% via the physical buttons and then set it to 40% via HA, the brightness will set itself to 40% for a second, then return to 80%.

What version of Home Assistant Core has the issue?

2025.3.4

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

config_entry-homekit_controller-01JQ517DBR38V0YVPJKZ803KDY-1.json

Example YAML snippet


Anything in the logs that might be useful for us?


Additional information

No response

delli87 avatar Mar 24 '25 22:03 delli87

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)

home-assistant[bot] avatar Mar 24 '25 22:03 home-assistant[bot]

Please add debug logs

bdraco avatar Mar 24 '25 22:03 bdraco

Please add debug logs

error_log-2.zip

@bdraco Do you mean these?

home-assistant.log

Entity id is: "light.luce_sala_da_pranzo"

delli87 avatar Mar 24 '25 23:03 delli87

Hi, is there anything new?

delli87 avatar Apr 02 '25 23:04 delli87

@bdraco, @Jc2k, I see that the "label" is still present missing-diagnostics-and-logs", but I have already uploaded logs and diagnostics. Please if anything else is missing you can let me know. I'm sorry but I'm not very practical.

delli87 avatar Apr 06 '25 10:04 delli87

There is no need to ping us. We will get to your issue when we have time. I only get 1 or 2 days a month to look at homekit_controller issues as this is something I do in my spare time.

bdraco avatar Apr 06 '25 10:04 bdraco

The log you posted doesn't have debug enabled.

Please follow the steps at https://www.home-assistant.io/docs/configuration/troubleshooting/#enabling-debug-logging

Make sure to reproduce the problem when debug logging is enabled

bdraco avatar Apr 06 '25 10:04 bdraco

2025-04-06 12:55:33.026 DEBUG (MainThread) [aiohomekit.controller.ip.connection] 192.168.178.68: raw request: b'PUT /characteristics HTTP/1.1\r\nHost: 192.168.178.68\r\nContent-Length: 83\r\nContent-Type: application/hap+json\r\n\r\n{"characteristics":[{"aid":141,"iid":10,"value":32},{"aid":141,"iid":9,"value":1}]}'
2025-04-06 12:55:34.150 DEBUG (MainThread) [aiohomekit.controller.ip.connection] 192.168.178.68: raw response: bytearray(b'')
2025-04-06 12:55:34.151 DEBUG (MainThread) [aiohomekit.controller.abstract] callback ev:{(141, 10): {'value': 32}, (141, 9): {'value': 1}}
2025-04-06 12:55:34.151 DEBUG (MainThread) [homeassistant.components.homekit_controller.connection] Called async_set_available_state with True for 68:E1:8B:48:31:91
2025-04-06 12:55:34.227 DEBUG (MainThread) [aiohomekit.controller.abstract] callback ev:{(141, 10): {'value': 32}}
2025-04-06 12:55:34.227 DEBUG (MainThread) [homeassistant.components.homekit_controller.connection] Called async_set_available_state with True for 68:E1:8B:48:31:91
2025-04-06 12:55:37.221 DEBUG (MainThread) [aiohomekit.controller.abstract] callback ev:{(141, 10): {'value': 81}}
2025-04-06 12:55:37.221 DEBUG (MainThread) [homeassistant.components.homekit_controller.connection] Called async_set_available_state with True for 68:E1:8B:48:31:91

bdraco avatar Apr 07 '25 01:04 bdraco

aid 141, iid 9

              {
                "type": "00000025-0000-1000-8000-0026BB765291",
                "iid": 9,
                "perms": [
                  "pr",
                  "pw",
                  "ev"
                ],
                "format": "bool",
                "value": true,
                "description": "On"
              },

aid 141, iid 10

              {
                "type": "00000008-0000-1000-8000-0026BB765291",
                "iid": 10,
                "perms": [
                  "pr",
                  "pw",
                  "ev"
                ],
                "format": "int",
                "value": 81,
                "description": "Brightness",
                "unit": "percentage",
                "minValue": 0,
                "maxValue": 100,
                "minStep": 1
              },

bdraco avatar Apr 07 '25 01:04 bdraco

In this case you made a service call and it set the brightness to 32, and the power state to 1 (on)

2025-04-06 12:55:33.026 DEBUG (MainThread) [aiohomekit.controller.ip.connection] 192.168.178.68: raw request: b'PUT /characteristics HTTP/1.1\r\nHost: 192.168.178.68\r\nContent-Length: 83\r\nContent-Type: application/hap+json\r\n\r\n{"characteristics":[{"aid":141,"iid":10,"value":32},{"aid":141,"iid":9,"value":1}]}'

The device accepts the PUT request and we get a callback from aiohomekit

2025-04-06 12:55:34.151 DEBUG (MainThread) [aiohomekit.controller.abstract] callback ev:{(141, 10): {'value': 32}, (141, 9): {'value': 1}}

A few microseconds later, the device sends and event that its been set to 32

2025-04-06 12:55:34.227 DEBUG (MainThread) [aiohomekit.controller.abstract] callback ev:{(141, 10): {'value': 32}}

3 seconds later, without any commands being sent to the device it sends back that the brightness is now 81

2025-04-06 12:55:37.221 DEBUG (MainThread) [aiohomekit.controller.abstract] callback ev:{(141, 10): {'value': 81}}

It seems like the physical buttons are overriding the state. This is something you'll need to bring up with the device manufacturer as I expect the exact same issue is going to happen if you unpair it from Home Assistant and pair to iOS directly.

bdraco avatar Apr 07 '25 01:04 bdraco

It works fine with IOS. The issue is only present on HA

delli87 avatar Apr 07 '25 01:04 delli87

I don't see anything wrong with what we're sending; everything looks good to me. Maybe one of my colleagues will spot something I missed.

bdraco avatar Apr 07 '25 01:04 bdraco

Maybe iOS doesn't send on if its already on

You could try this patch and see if it makes a difference:

diff --git a/homeassistant/components/homekit_controller/light.py b/homeassistant/components/homekit_controller/light.py
index 5409df7c1a8..e249690c13e 100644
--- a/homeassistant/components/homekit_controller/light.py
+++ b/homeassistant/components/homekit_controller/light.py
@@ -206,6 +206,7 @@ class HomeKitLight(HomeKitEntity, LightEntity):
             characteristics[CharacteristicsTypes.HUE] = hs_color[0]
             characteristics[CharacteristicsTypes.SATURATION] = hs_color[1]
 
+        if not self.service.value(CharacteristicsTypes.ON):
             characteristics[CharacteristicsTypes.ON] = True
 
         await self.async_put_characteristics(characteristics)

bdraco avatar Apr 07 '25 01:04 bdraco

Ok, How do I insert it?

delli87 avatar Apr 07 '25 02:04 delli87

Fwiw, I'm getting the same behaviour on a LIFX bulb over HomeKit integration (it still works over SmartThings perfectly fine). Colour changes don't work either, and this is a regression that only started happening in the past two months (after over a year of working perfectly fine)

JohnnyWestlake avatar Apr 09 '25 17:04 JohnnyWestlake

Maybe iOS doesn't send on if its already on

You could try this patch and see if it makes a difference:

diff --git a/homeassistant/components/homekit_controller/light.py b/homeassistant/components/homekit_controller/light.py index 5409df7c1a8..e249690c13e 100644 --- a/homeassistant/components/homekit_controller/light.py +++ b/homeassistant/components/homekit_controller/light.py @@ -206,6 +206,7 @@ class HomeKitLight(HomeKitEntity, LightEntity): characteristics[CharacteristicsTypes.HUE] = hs_color[0] characteristics[CharacteristicsTypes.SATURATION] = hs_color[1]

  •    if not self.service.value(CharacteristicsTypes.ON):
           characteristics[CharacteristicsTypes.ON] = True
    
       await self.async_put_characteristics(characteristics)
    

I didn't understand where to insert this patch. I tried on the terminal but it gives me some errors. Can anyone help me?

delli87 avatar Apr 12 '25 15:04 delli87

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.