RaresAil / homebridge-tp-link-tapo

A platform to implement the tp-link tapo device and Adaptive Lighting for light bulbs
https://www.npmjs.com/package/homebridge-tp-link-tapo
Apache License 2.0
66 stars 5 forks source link

Tapo Plugin Restarting Homebridge #66

Closed parryg closed 10 months ago

parryg commented 11 months ago

Describe The Bug

Randomly the Tapo plugin has started to reboot my home bridge so that it's unusable, the two lines in the log before reboot are below. It's strange as I haven't added the IP address for either of these devices to my config.

Expected behavior

Does not reboot.

Logs

[10/22/2023, 4:53:27 PM] [Tapo] Adding new child accessory: Temp & Humidity [10/22/2023, 4:53:27 PM] [Tapo] Failed to register child accessory "Temp & Humidity" of type "Unknown" (SMART.TAPOSENSOR) [10/22/2023, 4:53:27 PM] [Tapo] Restoring existing child accessory from cache: Garage Door Sensor [10/22/2023, 4:53:27 PM] [Tapo] Restoring existing child accessory from cache: Back Door Sensor [10/22/2023, 4:53:27 PM] [Tapo] Restoring existing child accessory from cache: Front Door Sensor [10/22/2023, 4:53:27 PM] [Tapo] Restoring existing child accessory from cache: Smart Button [10/22/2023, 4:53:28 PM] TypeError: Cannot read properties of undefined (reading 'timestamp') at ButtonAccessory.setup (/usr/local/lib/node_modules/homebridge-tp-link-tapo/src/accessories/Button/index.ts:119:44) at processTicksAndRejections (node:internal/process/task_queues:95:5) [10/22/2023, 4:53:28 PM] Got SIGTERM, shutting down Homebridge...

Plugin Config

[10/22/2023, 4:53:27 PM] [Tapo] Adding new child accessory: Temp & Humidity [10/22/2023, 4:53:27 PM] [Tapo] Failed to register child accessory "Temp & Humidity" of type "Unknown" (SMART.TAPOSENSOR) [10/22/2023, 4:53:27 PM] [Tapo] Restoring existing child accessory from cache: Garage Door Sensor [10/22/2023, 4:53:27 PM] [Tapo] Restoring existing child accessory from cache: Back Door Sensor [10/22/2023, 4:53:27 PM] [Tapo] Restoring existing child accessory from cache: Front Door Sensor [10/22/2023, 4:53:27 PM] [Tapo] Restoring existing child accessory from cache: Smart Button [10/22/2023, 4:53:28 PM] TypeError: Cannot read properties of undefined (reading 'timestamp') at ButtonAccessory.setup (/usr/local/lib/node_modules/homebridge-tp-link-tapo/src/accessories/Button/index.ts:119:44) at processTicksAndRejections (node:internal/process/task_queues:95:5) [10/22/2023, 4:53:28 PM] Got SIGTERM, shutting down Homebridge...

Plugin Version

homebridge-tp-link-tapo v4.0.0

Homebridge Version

v1.6.1

Node.js Version

v18.16.0

NPM Version

Unknown

Operating System

Mac Sonoma 14

RaresAil commented 11 months ago

Do you run the plugin as a child bridge? And since you added the os macos, do you run the plugin on your laptop?

parryg commented 11 months ago

It's not currently run as a child bridge, should I try that?

No, it's set up on my iMac.

RaresAil commented 11 months ago

It's not currently run as a child bridge, should I try that?

No, it's set up on my iMac.

Try as a child bridge

parryg commented 11 months ago

Still the same problem unfortunately:

[10/23/2023, 6:33:59 AM] [homebridge-tp-link-tapo] This plugin generated a warning from the characteristic 'Contact Sensor State': Characteristic not in required or optional characteristic section for service Outlet. Adding anyway.. See https://homebridge.io/w/JtMGR for more info. [10/23/2023, 6:33:59 AM] [Tapo] Command error: getCurrentPower > -1002 [10/23/2023, 6:33:59 AM] [Tapo] Command error: getCurrentPower > 1002 [10/23/2023, 6:33:59 AM] [Tapo] Restoring existing accessory from cache: Upstairs Strip [10/23/2023, 6:33:59 AM] [Tapo] Restoring existing accessory from cache: Microwave [10/23/2023, 6:33:59 AM] [homebridge-tp-link-tapo] This plugin generated a warning from the characteristic 'Contact Sensor State': Characteristic not in required or optional characteristic section for service Outlet. Adding anyway.. See https://homebridge.io/w/JtMGR for more info. [10/23/2023, 6:33:59 AM] [Tapo] Command error: getCurrentPower > 1002 [10/23/2023, 6:34:00 AM] [Tapo] Restoring existing accessory from cache: Downstairs Strip [10/23/2023, 6:34:00 AM] [Tapo] Adding new child accessory: Temp & Humidity [10/23/2023, 6:34:00 AM] [Tapo] Failed to register child accessory "Temp & Humidity" of type "Unknown" (SMART.TAPOSENSOR) [10/23/2023, 6:34:00 AM] [Tapo] Restoring existing child accessory from cache: Garage Door Sensor [10/23/2023, 6:34:00 AM] [Tapo] Restoring existing child accessory from cache: Back Door Sensor [10/23/2023, 6:34:00 AM] [Tapo] Restoring existing child accessory from cache: Front Door Sensor [10/23/2023, 6:34:00 AM] [Tapo] Restoring existing child accessory from cache: Smart Button TypeError: Cannot read properties of undefined (reading 'timestamp') at ButtonAccessory.setup (/usr/local/lib/node_modules/homebridge-tp-link-tapo/src/accessories/Button/index.ts:119:44) at processTicksAndRejections (node:internal/process/task_queues:95:5) [10/23/2023, 6:34:00 AM] [Tapo] Child bridge process ended [10/23/2023, 6:34:00 AM] [Tapo] Process Ended. Code: 1, Signal: null [10/23/2023, 6:34:07 AM] [Tapo] Restarting Process...

RaresAil commented 11 months ago

Show me the config of the plugin without email and password

RaresAil commented 11 months ago

the name [Tapo] is wrong, you have bad configuration it you are using a diff plugin

parryg commented 11 months ago

{ "addresses": [ "192.168.0.26", "192.168.0.27", "192.168.0.38", "192.168.0.42", "192.168.0.61", "192.168.0.47", "192.168.0.52", "192.168.0.57", "192.168.0.58", "192.168.0.59", "192.168.0.29", "192.168.0.62", "192.168.0.22", "192.168.0.64", "192.168.0.49" ], "name": "Tapo", "email": "", "password": "", "platform": "HomebridgeTPLinkTapo" }

RaresAil commented 11 months ago

{

    "addresses": [

        "192.168.0.26",

        "192.168.0.27",

        "192.168.0.38",

        "192.168.0.42",

        "192.168.0.61",

        "192.168.0.47",

        "192.168.0.52",

        "192.168.0.57",

        "192.168.0.58",

        "192.168.0.59",

        "192.168.0.29",

        "192.168.0.62",

        "192.168.0.22",

        "192.168.0.64",

        "192.168.0.49"

    ],

    "name": "Tapo",

    "email": "",

    "password": "",

    "platform": "HomebridgeTPLinkTapo"

}

Try with 1 light and see if it works

parryg commented 11 months ago

One light appears to have worked, so I can only assume it's one of the devices causing an issue. Based on the above though, it brings up contact sensors and a humidity sensor, which I didn't think were supported?

EDIT: It's now saying unavailable.

RaresAil commented 10 months ago

Could be the macbook, never used so many with a macbook, i have a Debian Server for this so i don;t know what could be the cause, i recommend using a Raspberry Pi 4 or 5

parryg commented 10 months ago

I've figured this out just now, it was the Tapo Hub causing the issues as Homebridge was trying to 'connect'? to devices that are attached to it such as the temp & humidity sensor and this was in turn causing the shut down.

Since removing the Hub IP, I've had no problems.

RaresAil commented 10 months ago

The hub uses a lot of bandwidth based on how many devices it has, i have only 2 and i don't have issues