hycken / homebridge-fujitsu-hvac

Homebridge plugin for devices compatible with the FGLAir app.
MIT License
2 stars 0 forks source link

Lost connection to accessory. Rediscovering... #9

Open Carnego opened 1 year ago

Carnego commented 1 year ago

Hey,

first of all thank you for this great plugin! I'm usingen 6 units around my house and one of them is usually turned off unless I need it. After todays update I have the following issue:

[3/29/2023, 4:13:45 PM] [Fujitsu AC] Lost connection to accessory. Rediscovering... [3/29/2023, 4:13:45 PM] [Fujitsu AC] Lost connection to accessory. Rediscovering... [3/29/2023, 4:13:45 PM] [Fujitsu AC] Lost connection to accessory. Rediscovering... [3/29/2023, 4:13:45 PM] [Fujitsu AC] Lost connection to accessory. Rediscovering... [3/29/2023, 4:13:45 PM] [Fujitsu AC] Lost connection to accessory. Rediscovering... TypeError: devices.filter is not a function at FGLAir.getDevices (file:///homebridge/node_modules/homebridge-fujitsu-hvac/dist/api/fglair.js:109:14) at processTicksAndRejections (node:internal/process/task_queues:95:5) at FujitsuHVACPlatform.discoverDevices (file:///homebridge/node_modules/homebridge-fujitsu-hvac/dist/platform.js:34:25) [3/29/2023, 4:13:45 PM] [Fujitsu AC] Child bridge process ended [3/29/2023, 4:13:45 PM] [Fujitsu AC] Process Ended. Code: 1, Signal: null [3/29/2023, 4:13:52 PM] [Fujitsu AC] Restarting Process... [3/29/2023, 4:13:53 PM] [Fujitsu AC] Launched child bridge with PID 28654 [3/29/2023, 4:13:53 PM] Registering platform 'homebridge-fujitsu-hvac.FujitsuHVAC' [3/29/2023, 4:13:53 PM] [Fujitsu AC] Loaded homebridge-fujitsu-hvac v1.1.1 child bridge successfully [3/29/2023, 4:13:53 PM] Loaded 6 cached accessories from cachedAccessories.0E5EAD6A3757. [3/29/2023, 4:13:53 PM] [Fujitsu AC] Loading accessory from cache: Schlafzimmer [3/29/2023, 4:13:53 PM] [Fujitsu AC] Loading accessory from cache: Büro [3/29/2023, 4:13:53 PM] [Fujitsu AC] Loading accessory from cache: Man Cave [3/29/2023, 4:13:53 PM] [Fujitsu AC] Loading accessory from cache: Ankleidezimmer [3/29/2023, 4:13:53 PM] [Fujitsu AC] Loading accessory from cache: Gästezimmer [3/29/2023, 4:13:53 PM] [Fujitsu AC] Loading accessory from cache: Wohnzimmer [3/29/2023, 4:13:54 PM] Homebridge v1.6.0 (HAP v0.11.0) (Fujitsu AC) is running on port 34303. [3/29/2023, 4:13:56 PM] [Fujitsu AC] Lost connection to accessory. Rediscovering... [3/29/2023, 4:13:56 PM] [Fujitsu AC] Lost connection to accessory. Rediscovering... [3/29/2023, 4:13:56 PM] [Fujitsu AC] Lost connection to accessory. Rediscovering... [3/29/2023, 4:13:57 PM] [Fujitsu AC] Lost connection to accessory. Rediscovering...

And it just repeats crashing and restarting the childbridge. Turning on the unit without power did not resolve the issue, however, after clearing the device cache everything seemed to work until I turned the unit back off, which immediately led to the error described above. It seems that in it's current state the plugin does not survive an unavailable unit. For now I just keep all units turned on but it would be great if you could look into it, maybe there is a simple solution to fix that behavior.

Thank you for your support and please let me know if there is anything I can do to help.

hycken commented 1 year ago

Thanks for the report. That is definitely not a use case I had considered. I don't think there's even a way to turn off my heat pump without flipping a breaker. :)

I'll add some throttling to wait a bit before trying to reconnect and maybe a toggle to not show the rediscovering message. Would that help? Without trying to rediscover the plugin will never pick up your turned off unit after it comes back.

Carnego commented 1 year ago

I know it's a bit unusual :-) the unit in my livingroom is plugged into an outdoor power outlet, that's why I turn it off when it's getting cold outside.

That sounds great, right now rediscovering is happening a few times a second and that is probably not really necessary :-) every few seconds with an option to turn the rediscovering message off would be perfect!

Thank you for your support!

hycken commented 1 year ago

Please try out 1.2.0. I've added throttling so it only tries to reconnect every 5 minutes. It also reconnect each device individually and the log message only shows up if you have debugging enabled. Hope this works better.

Carnego commented 1 year ago

Hey,

I had a few duplicate cached devices and some issues with it so in the end I just deleted the plugin and started from scratch. I did some testing the last 2 days and everything seems to be working as expected now. Every few hours I get the following message in the log though:

[4/6/2023, 10:49:29 AM] [Fujitsu AC] Unexpected end of JSON input

And in homekit the powered off unit is still shown as online/available but other than that no more crashes so the major issue seems to be fixed! :-)

Thanks again for your support!

hycken commented 1 year ago

Nice. I'm looking into it but I'm seeing maybe one error per day or two so it's taking some time to debug. :)

I'll look into what I can do about showing a different status when a unit is not available.