Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HomeKit integration sets wrong state after recent update #104643

Open
ansman opened this issue Nov 28, 2023 · 6 comments
Open

HomeKit integration sets wrong state after recent update #104643

ansman opened this issue Nov 28, 2023 · 6 comments
Assignees

Comments

@ansman
Copy link

ansman commented Nov 28, 2023

The problem

After some recent update (not sure which one) I've been noticing strange issues with the HomeKit integration. I've noticed issues with two separate device types. One being a Vizio TV and one being a Z-wave smart plug.

I'm not sure if these are actually separate issues but it feels to me like they might be due to the same root issue.

TV
The TV is exposed to HomeKit so that I can change the volume in the Apple TV remote app. This has worked great until recently. At first I thought it might be an issue with Vizio since the TV just had a major update but now I'm not so sure.

The issue is that any action taken in the Apple TV remote app will turn the TV off.

As you can see in the logbook, the TV turns off when I take an action. Strangely enough HomeKit is sending a turn_on command which turns off the TV.

I think the issue here is twofold. The first issue is that the TV turns off when turn_on is sent and it's already turned on. I think this is an issue with Vizio.

The second issue is that HomeKit doesn't seem to understand the TV is turned on which is why it sends turn_on when it is, in fact, already on.

I've also seen messages like Den TV turned off triggered by HomeKit send command volume_down for Den TV.

Lastly I'll note that changing the volume in the HA app works fine.

IMG_9891

Smart Plug
Another issue that happened was similar. Both me and my wife asked Siri to turn off the bedroom lights. This caused it to turn off only to turn back on directly after a short delay. Looking at the logbook you see a similar log to what Vizio logged.

IMG_9887

What version of Home Assistant Core has the issue?

2023.11.3

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

Link to integration documentation on our website

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

Diagnostics information

home-assistant_homekit_2023-11-28T14-36-44.724Z.log
home-assistant_vizio_2023-11-28T14-36-42.242Z.log

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

@home-assistant
Copy link

Hey there @bdraco, mind taking a look at this issue as it has been labeled with an integration (homekit) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of homekit 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 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 documentation
homekit source
(message by IssueLinks)

@sundar2012
Copy link

I have encountered a similar issue. I had an input_button that triggered an automation and then exposed the button to homekit. Homekit would then randomly trigger the automation via the stateless button/switch.

My theory is that homekit is requesting the state of the device. Since a button press is just a timestamp of its current state when pushed, my theory is that by requesting the state from home assistant it then updates the state and triggers the button push automation.

My solution in this case was just to create dummy stateless switches in homebridge and then have homekit use those buttons to call my automations via a web hook. Would be great to avoid that work around.

@issue-triage-workflows
Copy link

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.

@ansman
Copy link
Author

ansman commented Apr 28, 2024

This is still an issue

@stevelee916a
Copy link

stevelee916a commented May 30, 2024

This happens on one of my devices too when i use a homekit scene to turn off a bunch of stuff.

Removing and re-adding in the homebridge plugin has not helped, sadly.
Update: removing and re-adding the device in zigbee2mqtt or in home assistant has not fixed the issue.

the device itself is actually off, even though home assistant shows a state of on.
update: after home assistant sets state to “on”, this state is also reflected in zigbee2mqtt (looking at the z2mqtt ui, separate from home assistant). However the device itself is physically off, regardless of the state being reported in z2mqtt.

Is it even possible to write the device state to “on” while not actually turning the device on?? This seems to be what home assistant is doing…

Note: Controlling the device individually (through HomeKit or home assistant or the z2mqtt ui) works as intended.

The device in question is a ThirdReality RealitySwitch (i have multiple and the others behave normally).

HAOS running as a Synology Virtual Machine

log states: “Dining Room Light turned on triggered by HomeKit send command turn_off for Dining Room Light”

versions:
Core
2024.5.4
Supervisor
2024.06.0
Operating System
12.3
Frontend
20240501.1

I recently migrated from conbee/deconz and ha in docker containers. Never had this issue with that setup.
now running uzg/z2mqtt in docker with haos in a vm.

@stevelee916a
Copy link

stevelee916a commented Jun 8, 2024

Seems like this has been a small but recurring issue for years? Skimming through the threads, it’s not clear to me whether this is a homebridge, ha, or z2mqtt issue

Homebridge bug thread (closed but not resolved): homebridge/homebridge#3073

homebridge-z2mqtt bug thread (also closed but not resolved): itavero/homebridge-z2m#383

zigbee2mqtt bug thread (closed but not resolved): Koenkk/zigbee2mqtt#10409

zigbee2mqtt bug thread (open):
Koenkk/zigbee2mqtt#22030

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants