fjs21 / homebridge-kumo

Control your Kumo cloud devices using Homebridge.
https://www.npmjs.com/package/homebridge-kumo
Apache License 2.0
35 stars 8 forks source link

Wrong IP Address being used for queryDevice_Direct #45

Closed esetnik closed 2 years ago

esetnik commented 2 years ago

[11/3/2021, 5:02:53 PM] [homebridge-kumo] queryDevice_Direct error: FetchError: request to http://192.168.1.205/api?m=24f1068d5ae939f69281368e4f9cb0320bc0e720e4a5ab9111a0ab6a292ae9d7 failed, reason: connect ECONNREFUSED 192.168.1.205:80

IMG_D1E84FAED824-1

The actual Kumo device is located at 192.168.1.200. I'm not sure where the plugin is getting the 205 address from.

fjs21 commented 2 years ago

It must have changed from an original setting of 205. Are you by any chance using DHCP in your wifi router?

I strongly recommend if you want to use direct access that the devices are kept on static IPs. If not, whenever the router decides to give out a different IP address you will get this error for a period of time. Unfortunately, I have not found out a way to override the Kumo derived IP address and it can take minutes/hours or longer to update.

I had this problem once and moved to static IPs and its been good since. If you are unable to change to static IP addresses for your Kumo devices then I suggest unchecking the direct access button and just using the cloud based API.

esetnik commented 2 years ago

I already have the IP reservation (static IP) set to 200 for this device. And it has been connected to the 200 address for over a week. So is this a kumo cloud issue that they do not update their own cached IP address associated with the device?

esetnik commented 2 years ago

I moved the reservation to 205 and now it's working. Still seems like a bug in that it never updates the IP address if it changes.

fjs21 commented 2 years ago

Yeah it's not ideal. The plugin gets the IP address reported from the Kumo cloud. So if the two are out of sync, you get the error.

In v1.8.14, I included code to catch an error in the directAccess approach (that can be caused by incorrect IP address) and revert to the Kumo Cloud API. This is marked in the log as an error so that it is easier to spot.

I have also updated the readme to make it clear that the direct connection should be used with static IPs.

esetnik commented 2 years ago

@fjs21 is there a log line which shows the directAccess IP being attempted?

fjs21 commented 2 years ago

If you turn on debug in the homebridge UI. You should be able to tell.

For now hold off as I think I found a bug in my new code that means that it won't wait until you get authenticated before proceeding. I need to add an "await".

fjs21 commented 2 years ago

Ok. I have added additional logging so you can tell if directAccess (via local IP) was successful and additional log entries to demonstrate that a connection was successfully completed. These should appear shortly after homebridge is restarted.

eleventhaus commented 1 year ago

@esetnik just curious, what app that?

esetnik commented 1 year ago

@esetnik just curious, what app that?

Eero iOS