Siri will not control a device if already in desired state

Posted on
Sat Sep 22, 2018 6:46 pm
DVDDave offline
Posts: 341
Joined: Feb 26, 2006
Location: San Jose, CA

Siri will not control a device if already in desired state

Webdeck,

I posted this problem a few days ago in the Homekit Bridge forum, but I just realized it probably belongs here.

After upgrading to iOS 12 (although probably not an iOS 12 issue), Siri now will not send an on or off command to a device if she thinks the device is already in that state. This affects all of my X10 light switches after I turn them off manually as well as manually controlled locks, rolling shades, etc. I don't see any attempt to control them in the Indigo log or anywhere else except that Siri responds as if she controlled the device. I don't think there is any Siri or Homekit log available so I don't know how to check further.

It also just occurred to me that it's possible, but unlikely, that the commands are being filtered by Homebridge; ie, does Homebridge look at the device state and inhibit a request if the device is already in that state? Is there any Homebridge or Homekit log available that might shed light on this?

I've made a forceful case to Apple that Siri is causing this new behavior and I hope I won't end up with egg on my face. :oops:

Thanks.

--Dave

Posted on
Tue Oct 02, 2018 7:59 pm
DVDDave offline
Posts: 341
Joined: Feb 26, 2006
Location: San Jose, CA

Re: Siri will not control a device if already in desired sta

After hours of discussion with Apple and getting a response from their engineering group, I've gotten nowhere with this. They say I need to talk with the device manufacturer which obviously wouldn't help. I strongly suspect that Homekit changed its behavior but I can't rule out that Homekit-Bridge or homebridge-indigo isn't filtering out the commands when the device is already reportedly in the desired state.

Does anyone know how I could tell if Homekit is actually sending the command to my network?

Posted on
Tue Oct 02, 2018 9:38 pm
webdeck offline
Posts: 388
Joined: May 07, 2005

Re: Siri will not control a device if already in desired sta

Yes, that is working as intended. The homebridge-indigo2 plugin will ignore requests that don't change anything. I just tried it myself with debugging turned on to confirm - I asked Siri to turn on the Office Hall Light, which was already on:

Code: Select all
Wed, 03 Oct 2018 03:32:26 GMT HAPServer [redacted] HAP Request: PUT /characteristics
Wed, 03 Oct 2018 03:32:26 GMT Accessory [HomeKit Bridge] Processing characteristic set: [{"aid":46,"iid":10,"value":true}]
Wed, 03 Oct 2018 03:32:26 GMT Accessory [HomeKit Bridge] Setting Characteristic "On" to value true
[2018-10-2 20:32:26] [HomeKit Bridge Server] Office Hall Light: set(On) true - ignored unchanged value


This was a safeguard put in to prevent potential infinite looping of updates between Indigo and homebridge.

Posted on
Tue Oct 02, 2018 10:18 pm
DVDDave offline
Posts: 341
Joined: Feb 26, 2006
Location: San Jose, CA

Re: Siri will not control a device if already in desired sta

Thanks for the answer, webdeck, but now I'm really confused. Has it always worked like this? I just noticed it and it's been causing all sorts of problems with lights, locks, shades and anything else that we use manual controls for that doesn't alter status to Indigo. In any event, I have major egg on my face with Apple after coming on so strong with them. (I never learn not to do that) :(

I looked in the Homekit Bridge log and saw no indication of any response to this type of request which led me to believe nothing was coming in from Homekit. I don't see it in the Homebridge log either. Which log are you showing in your message?

I must confess that I'm confused with how all this fits together. Is homebridge-indigo2 still in play if I am using Homekit Bridge? If not, maybe Homekit Bridge does the same thing, but I haven't had a response from Colorado4Wheeler yet. I converted from Homebridge Buddy to Homekit Bridge a while ago and think I would have noticed the problem at that time;.

In any event, this gives me hope now that this significant issue can be resolved. Any suggestions at all would be appreciated.

Thanks!

--Dave

Posted on
Tue Oct 02, 2018 10:25 pm
webdeck offline
Posts: 388
Joined: May 07, 2005

Re: Siri will not control a device if already in desired sta

homebridge-indigo2 is what is included with the HomeKit Bridge plugin.

To see full debugging in the logs, you need to enable homebridge debugging. Double-click on the device you created for HomeKit Bridge, then click Edit Device Settings, then choose Server Parameters (Advanced) option screen, then set Debugging to Debug Homebridge and Indigo Script. That enables maximum debugging within homebridge and homebridge-indigo2. To see that log file, you then have to go to Plugins -> HomeKit Bridge -> Advanced Plugin Actions and choose action Show Homebridge Log and click Execute Action - that will dump the log into the Event Log window.

HomeKit Bridge (and homebridge-indigo2) have always behaved this way. Perhaps you're thinking of the older, deprecated, standalone homebridge-indigo or Homebridge Buddy?

Posted on
Tue Oct 02, 2018 10:29 pm
webdeck offline
Posts: 388
Joined: May 07, 2005

Re: Siri will not control a device if already in desired sta

As for how to resolve the issue, as I said, it's working as intended. Homebridge is reflecting the state as Indigo knows it. I can't control what happens outside of Indigo. The way homebridge-indigo2 and HomeKit Bridge work together is such that all state is kept in sync and redundant state updates are ignored to prevent loops between the two systems.

Posted on
Tue Oct 02, 2018 11:01 pm
DVDDave offline
Posts: 341
Joined: Feb 26, 2006
Location: San Jose, CA

Re: Siri will not control a device if already in desired sta

Yes, it is possible I'm thinking about Homebridge Buddy. There was a relatively short period of time between when I converted to Homekit Bridge and then updated to iOS 12. Perhaps I became more aware looking for iOS 12 effects and noticed it at that time.

I want to make sure we're talking about the same issue. I'm talking about changing the state of a device, not just keeping its status in sync. When I ask Siri to turn the device off, I see a detailed sequence of log entries. When I ask her a second time to turn the device off, I see absolutely nothing in the log, even when I set it into the debug state. I do not see any log entry like the one you posted that indicates the request was ignored.

That aside, I don't really understand what the risk would be in implementing a user's second request to turn the device off. It seems to me that this would cause significant issues for many users. Most of us have a mix of devices, some of which do not return status when manually controlled. Perhaps the most common case are X10 wall switches. If switched on manually, the light cannot be turned off with Siri. Big nuisance. There are some workarounds, like, after having the command fail, telling Siri to turn on the light and then off again, requiring 3 commands to do this simple task. (Hmmm, maybe I could set up a virtual device to always send the opposite command first)

Assuming I am now understanding this correctly, of course it's up to you to decide if this is really an issue that needs solving. Any advice that you can offer on suitable workarounds would be much appreciated.

Thanks.

--Dave

Posted on
Tue Oct 02, 2018 11:12 pm
webdeck offline
Posts: 388
Joined: May 07, 2005

Re: Siri will not control a device if already in desired sta

You won't see the entries in the log unless you turn on the debugging - see post #5.

This isn't something I'm going to change. If you're feeling brave, you can edit the code to remove the check. The file to edit is
Code: Select all
EPS HomeKit Bridge.indigoPlugin/Contents/Server Plugin/bin/hb/node/lib/node_modules/homebridge-indigo2/index.js
Line 524 should be
Code: Select all
if (value !== oldValue) {
you can change that to
Code: Select all
if (true) {
but I'm not responsible if it breaks things.

Posted on
Tue Oct 02, 2018 11:16 pm
DVDDave offline
Posts: 341
Joined: Feb 26, 2006
Location: San Jose, CA

Re: Siri will not control a device if already in desired sta

I did have the detailed logging turned on. There is definitely no log entry generated when I tell the light to turn off a second time.

Brave or stupid, I will try to implement the change and will let you know what happens. I really appreciate all the help and especially this super useful plugin!

Thanks.

--Dave

Posted on
Tue Oct 02, 2018 11:18 pm
webdeck offline
Posts: 388
Joined: May 07, 2005

Re: Siri will not control a device if already in desired sta

After you enable the debug logging, to view the log file, you have to go to Plugins -> HomeKit Bridge -> Advanced Plugin Actions and choose action Show Homebridge Log and click Execute Action

That dumps the current state of the log at that point in time. It doesn't keep logging to the Event Log window - it's a one time dump. You have to do it again if you want to see newer entries.

Posted on
Tue Oct 02, 2018 11:31 pm
DVDDave offline
Posts: 341
Joined: Feb 26, 2006
Location: San Jose, CA

Re: Siri will not control a device if already in desired sta

Yes, I see it now. I was looking at the log file on the server before and it was updating with implemented control requests so I thought it was complete. The ignored requests did not show until I executed the plug in action. Sorry 'bout that.

Posted on
Wed Oct 03, 2018 12:12 am
DVDDave offline
Posts: 341
Joined: Feb 26, 2006
Location: San Jose, CA

Re: Siri will not control a device if already in desired sta

The change worked and Siri commands are now implemented as expected. I'll watch for any glitches. Please let me know if there is something I should be looking out for. Thanks again!

--Dave

Posted on
Wed Oct 03, 2018 1:39 am
Londonmark offline
Posts: 325
Joined: Feb 29, 2012

Re: Siri will not control a device if already in desired sta

Thanks guys for this thread. Will also be implementing the change.

Would obviously be wonderful if there was a way of configuring it as an option via C4W’s plugin but appreciate that’s more complex. The benefit would be that we wouldn’t need to redo the change each time there’s an update to the software.

Posted on
Wed Oct 03, 2018 7:25 am
Colorado4Wheeler offline
User avatar
Posts: 2754
Joined: Jul 20, 2009
Location: Colorado

Re: Siri will not control a device if already in desired sta

I'll look into setting this as an option for the plugin to toggle between those modes. I'm in Webdecks camp on this, I think the original way is the best way but I certainly see where there are some cases when that could be an issue.

My Modest Contributions to Indigo:

HomeKit Bridge | Device Extensions | Security Manager | LCD Creator | Room-O-Matic | Smart Dimmer | Scene Toggle | Powermiser | Homebridge Buddy

Check Them Out Here

Posted on
Fri Oct 05, 2018 3:30 am
Londonmark offline
Posts: 325
Joined: Feb 29, 2012

Re: Siri will not control a device if already in desired sta

Have tried making the change, but it doesn't seem to have worked. I'm still finding that if I manually switch on lights, Siri won't switch them off.

Who is online

Users browsing this forum: No registered users and 0 guests