ch3rn1k / homebridge-multipurpose-kettle

Homebridge plugin for Xiaomi Multipurpose Kettle
MIT License
11 stars 0 forks source link

Siri control first attempt failures #4

Closed ch3rn1k closed 4 years ago

ch3rn1k commented 4 years ago

I can reproduce the error. When talking to Siri on HomePod or iPhone the first time Siri can not turn the Kettle on. Trying, waiting, device not responding. When I immediately after this ask again, turn on the Kettle, Siri is turning on the Kettle immediately. This is working a few minutes. Asking first time Siri is doing it instant. Only after a while 10+ Minutes or so, the first attempt is not working again. Second attempt its working. Without having the knowledge it feels like there is a timeout. Siri is waiting the first time and it takes probably only a few seconds to long and then the error message of that the Kettle is not responding. But because it is, just taking a few seconds more, the second time it works instant.

Hope this helps. :)

Originally posted by @DJay-X in https://github.com/ch3rn1k/homebridge-multipurpose-kettle/issues/3#issuecomment-621223951

ch3rn1k commented 4 years ago

Trying to figure what's wrong.

The problem is like "No response" on first command and after failing it - Home App updates list and you can control with seconds SAME command.

DJay-X commented 4 years ago

Thanks a lot. It seems to me that it's all mostly about the first connect after a while not using the kettle. Even in Home App turning the kettle on 1st time is not working sometimes. 2nd try is working instant. This issue then is with using the app and Siri voice as well.

RPReplay_Final1588235972 2020-04-30 10_49_01

ScreenFlow 2020-04-30 15_55_26

ScreenFlow 2020-05-05 12_40_08

DJay-X commented 4 years ago

@ch3rn1k I hope you are doing well. Any news on the issues? Anything I can do to help from my side? Thanks again. 🙏

ch3rn1k commented 4 years ago

Hey, no time to do something now, hope maybe in 2-3 days.

DJay-X commented 4 years ago

No worries. Thanks for your reply. And for sure I don't want to bother.

But of course I hope you'll find the time to investigate and fix the issue. You/Your Plugin was the reason for me to buy this kettle 😅

Thanks again for keeping in touch and trying to help.

Maybe you'll find here also something helpful? https://github.com/fineemb/xiaomi-smart-multipurpose-kettle

philmue1988 commented 4 years ago

hi ch3rnik,

first of all thanks for your work with that plugin. It´s was also the reason for me to buy the kettle :) I also discover the same issue as DJay and would be very nice if can fix that issue

DJay-X commented 4 years ago

Congrats to you new Kettle @philmue1988 😉 @ch3rn1k did a great job with this plugin. I totally agree.

At the moment it is recommend to run the homebridge-multipurpose-kettle in a separate homebridge instance. Otherwise due to the current bug it is slowing down the whole system and other devices in the first 10 sec or so.

This will not fix the current problem in response for this plugin and the kettle reachability but at least it will not "block" all other devices in your homebridge in this time.

But I'm sure thanks to @ch3rn1k this will be fixed soon and is perfect then. 👍

DJay-X commented 4 years ago

@ch3rn1k

I hope you're well! I absolutely don't want to bother you but I am checking in here nearly every day to see if you could manage something. At the moment setup is slowing down the whole system.

Do you think you will find the time in the near future to research and work on it again? Otherwise of course no problem at all. Then I wouldn't spend any more time with the kettle as well and use a different appliance. Just let us know where we stand.

Clarity is always beneficial.. We know time is precious. Thanks a lot.

ch3rn1k commented 4 years ago

Hey ya! I will try to reproduce this error, but with "slowing down the whole system" - I have tested on raspberry pi w and raspberry pi 4b (4gb ram) and everything ok. Maybe you can explain which slowness you have?

ch3rn1k commented 4 years ago

Can you try 2.1.4? Thanks

philmue1988 commented 4 years ago

What will be the command? Than i Can also Try it

ch3rn1k commented 4 years ago

What will be the command? Than i Can also Try it

Same as before - “Siri start %DEVICE NAME% 100 Celsius”. You need to understand, that this plugin isn’t something new for HomeKit, Apple haven’t got a lot of tools for this, so every command is just out of the box. ¯_(ツ)_/¯

philmue1988 commented 4 years ago

I mean to install Version 2.1.4:)

ch3rn1k commented 4 years ago

I mean to install Version 2.1.4:)

Ah... Are you using homebridge config ui x?

philmue1988 commented 4 years ago

yes, but i saw the update comes automatically. I will try as soon as my HB is working again....had a power outage :D

philmue1988 commented 4 years ago

i just tested...i have still the same problem that its not responding in the first 10 secs after not using the kettle for about 15 min

DJay-X commented 4 years ago

Hey ya! I will try to reproduce this error, but with "slowing down the whole system" - I have tested on raspberry pi w and raspberry pi 4b (4gb ram) and everything ok. Maybe you can explain which slowness you have?

@ch3rn1k
First of all thanks for getting back to us. If there is anything else we can support you with than just with our experience and information - Coffee, PayPal - let us know. :)

I maybe wasn't clear about "slowing down". It is best to see in this screen.

I run your plugin in a separate instance of Homebridge, but together with a few other plugins. Like the homeconnect coffee maker. And when the Kettle was not in use for 30 min or so, and it turn it on in the app (Eve or Home) it is not responding 10 Seconds at first try. See the first three tiles in the example. Kettle, Kettle Temp, (Coffee Maker other Plugin) And in this 10 seconds, everything else is also not responding as well. Nearly exactly after this 10 seconds the Kettle is reachable, can then be turned on, and all other devices from other plugins are also reachable again.

So the problem is that the Kettle (Plugin) has this 10 seconds of not responding in every first try. And because of this, also Siri can't turn on the Kettle at the first try because she thinks it's not reachable. What is correct, in the first 10 seconds. But directly after this time, the Kettle can be turned on immediately.

I installed the latest 2.1.4 and will check over the evening if it is making a difference.

If there is anything I or we can do to help investigate please of course let us know.

Thanks a lot Alex.

ch3rn1k commented 4 years ago

I'm alive, thank you! My main work getting too much time so I will try it solve problems asap. I think I have found bug with performance, trying to figure what's wrong now :)

DJay-X commented 4 years ago

Just a quick feedback. Using 2.1.4 for the last few hours I notice a difference. When I now ask Siri to turn the kettle on it is working instant, even after not using the kettle for a while. Same instant turn on by App or with starting a scene.

Of course I will have to try for the next day but something you did with 2.1.4 was in the right direction. 👍
I will let you know tomorrow when the kettle was not used for a couple of hours after the night.

DJay-X commented 4 years ago

@ch3rn1k I think all-in-all its a great improvement with 2.1.4. It is working more reliable now and instant. Even after not using the kettle for a couple of hours.

Although I noticed that when the kettle is turned on on the base, HomeKit doesn't notice until you open the app. Same when the kettle is turning off and was turned on before on the base. Seems not auto refresh in background.

I had some errors in the log but they didn't seem to have a big negative impact.

Mai 20 08:23:08 raspberrypi-3BPlus homebridge[3155]: [2020-5-20 8:23:08] [Wasserkocher] setWork Error: error
Mai 20 08:23:08 raspberrypi-3BPlus homebridge[3155]:     at MiMultipurposeKettle.setWork (/usr/local/lib/node_modules/homebridge-multipurpose-kettle/index.js:117:34)
Mai 20 08:23:25 raspberrypi-3BPlus homebridge[3155]: [2020-5-20 8:23:25] [Wasserkocher] setWork Error: error
Mai 20 08:23:25 raspberrypi-3BPlus homebridge[3155]:     at MiMultipurposeKettle.setWork (/usr/local/lib/node_modules/homebridge-multipurpose-kettle/index.js:117:34)
Mai 20 08:23:48 raspberrypi-3BPlus homebridge[3155]: [2020-5-20 8:23:48] [Wasserkocher] setWork Error: error
Mai 20 08:23:48 raspberrypi-3BPlus homebridge[3155]:     at MiMultipurposeKettle.setWork (/usr/local/lib/node_modules/homebridge-multipurpose-kettle/index.js:117:34)
Mai 20 08:23:59 raspberrypi-3BPlus homebridge[3155]: [2020-5-20 8:23:59] [Wasserkocher] setWork Error: error
Mai 20 08:23:59 raspberrypi-3BPlus homebridge[3155]:     at MiMultipurposeKettle.setWork (/usr/local/lib/node_modules/homebridge-multipurpose-kettle/index.js:117:34)
Mai 20 08:24:19 raspberrypi-3BPlus homebridge[3155]: [2020-5-20 8:24:19] [Wasserkocher] setWork Error: error
Mai 20 08:24:19 raspberrypi-3BPlus homebridge[3155]:     at MiMultipurposeKettle.setWork (/usr/local/lib/node_modules/homebridge-multipurpose-kettle/index.js:117:34)
Mai 20 08:24:30 raspberrypi-3BPlus homebridge[3155]: [2020-5-20 8:24:30] [Wasserkocher] setWork Error: error
Mai 20 08:24:30 raspberrypi-3BPlus homebridge[3155]:     at MiMultipurposeKettle.setWork (/usr/local/lib/node_modules/homebridge-multipurpose-kettle/index.js:117:34)
ch3rn1k commented 4 years ago

Have a look today, thanks

ch3rn1k commented 4 years ago

I have added some debug messages (debug, not info, you needs to activate debug in homebridge), if you have any problems show them to me please (:

изображение

DJay-X commented 4 years ago

FYI Got this error today and homebridge was shutting down.. After restart sudo systemctl start homebridge-2nd-Instance it was working again instantly. Probably the plugin shouldn't stopp/crash whole homebridge when kettle is not reachable for a moment, for whatever reason. 🤷🏼‍♂️

Everything else seems to work fine now. Still 4-5 seconds until the kettle responds but that doesn't seem to bother HomeKit or Siri thinking its a time-out. Improvement is of course welcome but man, you did a great job. 👍

[2020-5-21 15:18:39] [Wasserkocher] getTemperature Error: send ENETUNREACH xxx.xxx.xxx.xx:xxxxx
    at doSend (dgram.js:697:16)
    at defaultTriggerAsyncIdScope (internal/async_hooks.js:296:12)
    at afterDns (dgram.js:643:5)
    at processTicksAndRejections (internal/process/task_queues.js:85:21)
    at runNextTicks (internal/process/task_queues.js:66:3)
    at listOnTimeout (internal/timers.js:518:9)
    at processTimers (internal/timers.js:492:7) {
  errno: 'ENETUNREACH',
  code: 'ENETUNREACH',
  syscall: 'send',
  address: 'xxx.xxx.xxx.xx',
  port: xxxxx
}
[2020-5-21 15:18:39] [Wasserkocher] getWorkStatus Error: send ENETUNREACH xxx.xxx.xxx.xx:xxxxx
    at doSend (dgram.js:697:16)
    at defaultTriggerAsyncIdScope (internal/async_hooks.js:296:12)
    at afterDns (dgram.js:643:5)
    at processTicksAndRejections (internal/process/task_queues.js:85:21) {
  errno: 'ENETUNREACH',
  code: 'ENETUNREACH',
  syscall: 'send',
  address: 'xxx.xxx.xxx.xx',
  port: xxxxx
}
TypeError: miioDelayPromise is not a function
    at /usr/local/lib/node_modules/homebridge-multipurpose-kettle/index.js:257:25
TypeError: miioDelayPromise is not a function
    at /usr/local/lib/node_modules/homebridge-multipurpose-kettle/index.js:257:25
[2020-5-21 15:18:40] Got SIGTERM, shutting down Homebridge...
ch3rn1k commented 4 years ago

Wow, I was thinking that I handle this tricky thing, thanks for your feedback, will fix today! 😉

DJay-X commented 4 years ago

Thanks a lot Alex. I really appreciate your work and the time you are investing. Feeling bad not to know how to support you, other than talking a lot about you in the forum I'm the host. 😃 I hope you share the enthusiasm how your plugin enhances the kettles use. Fantastic job. 🥳

You can close this Issue at any time if you like. I think the main problem with delay and time-out >10 sec is solved.

I will follow you if you maybe make changes or improvements over time. Really love your work and how you did this, and your great assistance. Maybe more to come in the future from you with this and/or other plugins. 😇

If you like you can join our community forum.smartapfel.de Although it's German, you can join also in English of if you are interested. You are more than welcome to say hi. And with the help of deepl we all get along quite well in general. 😬 https://forum.smartapfel.de/forum/thread/5317-homebridge-multipurpose-kettle-xiaomi-mijia-smart-multipurpose-wi-fi-kettle-wass/

Thanks again.

ch3rn1k commented 4 years ago

Fixed in 2.1.7, thanks for feedbacks! :)

philmue1988 commented 4 years ago

HI Ch3rn1k,

thank you so much for your great work! Plugin works now good. There is only a few sec of response time. Much less than before.