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

Siri power control "failed to respond" (Active characteristic in Switch service) #10

Closed
DJay-X opened this issue Jan 12, 2020 · 20 comments

Comments

@DJay-X
Copy link

DJay-X commented Jan 12, 2020

I noticed that when switch on the coffee maker Siri is giving feedback that the device is not responding. However the device is turning on and cleaning. It seems Siri/HomeKit is not noticing the "on" progress and assume too quick as not responding. Maybe the timeout could be a few seconds longer?Not sure if this could be a solution or even possible?
Thanks in advance.

@thoukydides
Copy link
Owner

The timeout is implemented by HomeKit, not by this plugin. I think its limit is 10 seconds for each request. If the appliance is taking longer than the HomeKit timeout then the only way to avoid it would be to indicate success without waiting for the Home Connect response, but that would hide real failures.

Which Home Connect API requests are taking a long time, and how long are they taking?

A log with debug enabled (homebridge -D) would be helpful...

@DJay-X
Copy link
Author

DJay-X commented Jan 12, 2020

Thanks for your fast reply @thoukydides
First here is a video that's shows that Siri on HomePod is switching on and off the coffee maker, but nearly instant is announcing "One of your devices is not responding", "Eines Deiner Geräte antwortet nicht".
The time for the "error" is only a few seconds after turning on/off and far under 10 seconds limit which is strange.

https://youtu.be/Ysj5zPEMQJ0

With the log. I wouldn't want to post it public, because of other plugins there are a lot of other things in it. Any Idea? Sorry not so familiar with the logs.

@thoukydides
Copy link
Owner

First here is a video that's shows that Siri on HomePod is switching on and off the coffee maker, but nearly instant is announcing "One of your devices is not responding", "Eines Deiner Geräte antwortet nicht".

Unfortunately the video doesn't tell me anything useful.

The time for the "error" is only a few seconds after turning on/off and far under 10 seconds limit which is strange.

This suggests that it is not actually a timeout. It is more likely that the plugin is returning an actual error to HomeKit.

With the log. I wouldn't want to post it public, because of other plugins there are a lot of other things in it. Any Idea? Sorry not so familiar with the logs.

If you are comfortable sharing the log with me then you can send it via email (the envelope icon on https://www.thouky.co.uk/contact.html).

Otherwise you will need to read the log yourself to identify the problem. I do not see this issue with either my physical appliances or the simulators, so without the log there isn't much I can do to resolve it.

@DJay-X
Copy link
Author

DJay-X commented Jan 12, 2020

Thanks @thoukydides Mail is out and happy to hear from you. I appreciate the time and friendly help you give.

@thoukydides
Copy link
Owner

Thank you for the log. Unfortunately, it looks like it had HAP debug enabled (using DEBUG=*) rather than plugin debug (the -D switch). Hence, it does not include any of the information about API requests issued by this plugin.

However, an initial inspection suggests that the plugin is responding to the HomeKit requests within a reasonable time period and with successful result. The first ON took 1 second (although the appliance then took a further 48 seconds before it was finally ready). The OFF took 6 seconds, and the second ON took 5 seconds.

I will see what else I can conclude from a more careful examination of the log...

@DJay-X
Copy link
Author

DJay-X commented Jan 12, 2020

I'm running an Instance so I edited the /etc/default file

If there is another way to give you more info I'm happy to follow your instruction.

At the moment I tried several times turn on and off the machine with Siri HomePod, also on Siri voice command on iPhone 11 Pro and every time the coffee machine is turning on/of but Siri is always announcing that the device is not giving any response.

@thoukydides
Copy link
Owner

It looks like the Home Connect servers stopped working around 17:02 GMT today. In my own logs I started getting Internal Server Error responses around that time, and those have subsequently morphed into Proxy Error, Gateway Time-out, and Service Temporarily Unavailable.

I am now unable to establish any connection to the Home Connect servers, so it looks like that's the end of development for today...

@DJay-X
Copy link
Author

DJay-X commented Jan 12, 2020

Enjoy your evening. We will talk later. ;) Thanks. And again, if you use https://www.buymeacoffee.com or accept PayPal happy to help with a beverage.

@thoukydides
Copy link
Owner

OK, I have managed to reproduce this issue. It only occurs when using Siri to control the appliance power, resulting in the response that The <appliance> failed to respond.

This problem does not happen when starting a program, not even with the response delayed to take 8 seconds. (Increasing the delay beyond 9 seconds starts to give a Sorry, I didn't hear back from your devices error.) Hence, it is not a timeout issue.

Neither does it occur when using a HomeKit app (whether Apple Home or a third-party app) to control the appliance power. I normally test the plugin using the Home+ app, not using Siri, which is why I hadn't noticed the problem myself, and why I failed to reproduce it yesterday...

Using exactly the same code to handle the On characteristic of the power and program Switch services does not change the behaviour - the power Switch service still gives the failed to respond error, but the program Switch service continues to work. This suggests that it is a difference between the two Switch services that is the cause.

My current suspicion is that the cause is the addition of non-standard characteristics into the power Switch service in the most recent (0.13.0) release. (Previously they were contained in a custom service, with the power Switch service used as-is, but I changed that to improve how the characteristics are displayed in the Home+ app.)

More investigation required...

@thoukydides
Copy link
Owner

By a process of elimination, the problem is caused by the Active characteristic.

It appears that when Siri is instructed to turn the appliance on or off it writes to both the (standard) On and (non-standard, for a Switch service) Active characteristics of the power Switch service.

This plugin uses the Active characteristic to indicate whether a program is running, with writes used to pause/resume the program. For appliances that do not support pause/resume the Active service is made read-only to just indicate the status. Siri then gets upset by not being able to write it.

Clearly adding an Active characteristic to a Switch is a bad idea. As read-only status it prevents Siri from controlling the Switch. As a writable characteristic it cannot be used for anything different to the On characteristic since Siri writes the same value to both.

@thoukydides thoukydides changed the title Longer Timeout for Coffee Maker Siri power control "failed to respond" (Active characteristic in Switch service) Jan 13, 2020
@thoukydides
Copy link
Owner

I will fix this in the next release (once I have figured out the best way to do so). However, this may be a week or two since I am in the middle of some other changes that will take a while to complete...

@DJay-X
Copy link
Author

DJay-X commented Jan 13, 2020

You are awesome. What a great investigation and thanks for the background info.
I'll try to be patient waiting for the next release. Thank you so much. 👍

@thoukydides
Copy link
Owner

My current thinking is that it would be best to add a new "current program" Switch service to replace the Active characteristic. Its On characteristic will indicate whether any program is running (as Active does currently). Writing to the switch could start/stop or pause/resume the program (or some combination thereof; more thought required...). This would apply to all cooking appliance types except Hood, and all cleaning appliance types.

Remaining Duration, Status Active, and Status Fault characteristics would all move to the new Switch since they mostly provide information about the running program, and are not relevant to appliances without programs.

Hood appliances would lose these characteristics since the plugin handles their programs differently... although it may make sense to add Remaining Duration to the Fan service in that case.

Current Door State would remain on the power Switch since it applies to cooling appliances (which do not support programs), and it doesn't have anything to do with the running program. Similarly for Program Mode which indicates local/remote control.

@thoukydides
Copy link
Owner

This should be fixed in v0.14.0 which I have just released.

@thoukydides thoukydides added the waiting for feedback Further information is requested label Jan 18, 2020
@Kohle81
Copy link

Kohle81 commented Jan 18, 2020

@thoukydides

Thanks for this update, I use the homebridge-alexa plugin with your plugin, but the power switch was not working.

Now, with this update, it works great!

@thoukydides
Copy link
Owner

Thanks for this update, I use the homebridge-alexa plugin with your plugin, but the power switch was not working.

Now, with this update, it works great!

Thanks @Kohle81 for letting me know that this change also helps with homebridge-alexa. I don’t use that plug-in or Alexa myself, so please raise an issue if I break it again.

I will close this issue once @DJay-X has confirmed that it also fixes power control from Siri.

@DJay-X
Copy link
Author

DJay-X commented Jan 19, 2020

@thoukydides Thanks a lot. After a few tries I can also confirm that turning on/off the coffee maker with Siri on HomePod works instant and without any issue now. Fantastic work with the entire plugin in such short time.♡ Awesome. Thanks for sharing with us.

@thoukydides
Copy link
Owner

Thanks @DJay-X.

It looks like this issue is now resolved, so I will close it.
Please open new issues if you discover any problems.

@DJay-X
Copy link
Author

DJay-X commented Mar 1, 2020

@thoukydides I have the same issue again "I noticed that when switch on the coffee maker Siri is giving feedback that the device is not responding." Or when I ask to something like "Espresso".
Siri HomePod is giving feedback that the device is not responding.
However, when I open the Apple Home App or preferably Eve App and select Espresso, everything is working and the coffee maker is doing it's thing.
Thanks.

@thoukydides
Copy link
Owner

I have just tested Siri control if appliance power with v0.17.2 and it is working fine for me using a HomePod.

Regardless, it cannot be the same as the problem you originally reported in this issue because that was due to the plugin adding an Active characteristic to a Switch service. It no longer does that, and in fact there have not been any changes to what services and characteristics are used in recent versions of the plugin. That problem also did not affect the program switches, which you say have also stopped working.

If this is reproducible then please create a new issue for it and provide a debug log.

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

No branches or pull requests

3 participants