apatsufas / homebridge-tapo-p100

Homebridge TP-LINK Tapo P100 Platform Plugin
Apache License 2.0
65 stars 14 forks source link

Authetification Broken since P100 Update 1.2.2 #46

Open AH-IT-SLTN opened 1 year ago

AH-IT-SLTN commented 1 year ago

Sinsce the Firmware Update of the P100 the Auhthetification FAils with:

97 Error Code: 1003, undefined 52 - Get Device Info

Try to Control a P100 Outlet with 1.2.1 Firmware

Expected behavior: Working Control through Homekit

Logs: [9/12/2023, 10:14:54 AM] [Tapo Smart Platform] 97 Error Code: 1003, undefined 10.123.0.76 [9/12/2023, 10:14:54 AM] [Tapo Smart Platform] 52 - Get Device Info failed [9/12/2023, 10:14:54 AM] [Tapo Smart Platform] 97 Error Code: 1003, undefined 10.123.0.71 [9/12/2023, 10:14:54 AM] [Tapo Smart Platform] 52 - Get Device Info failed [9/12/2023, 10:14:54 AM] [Tapo Smart Platform] 97 Error Code: 1003, undefined 10.123.0.78 [9/12/2023, 10:14:54 AM] [Tapo Smart Platform] 52 - Get Device Info failed [9/12/2023, 10:14:54 AM] [Tapo Smart Platform] 97 Error Code: 1003, undefined 10.123.0.79 [9/12/2023, 10:14:54 AM] [Tapo Smart Platform] 52 - Get Device Info failed Show the Homebridge logs here, remove any sensitive information.


**Plugin Config:**
"platforms": [
        {
            "name": "Tapo Smart Platform",
            "username": "tplink@***",
            "password": "***",
            "platform": "TapoP100",
            "devices": [
                {
                    "name": "Plug",
                    "host": "10.123.0.76",
                    "type": "Plug",
                    "updateInterval": 30,
                    "timeout": 2
                },
Show your Homebridge config.json here, remove any sensitive information.

Screenshots:

Environment:

Yunkie commented 1 year ago

Hello,

it seems there are dependencies on hardware-version too. We have four P100 hardware-version 2.0 with firmware 1.2.1 Build 230804 Rel. 190922 that doesn't work and one P100 hardware-version 1.20.0 with firmware 1.4.18 Build 20230711 Rel. 55651 that works fine.

Cr0wTom commented 1 year ago

Seems like https://github.com/dswd/OctoPrint-PSUControl-Tapo/issues/10 was fixed yesterday.

Can the fix get incorporated here?

modda4711 commented 1 year ago

Seems like dswd/OctoPrint-PSUControl-Tapo#10 was fixed yesterday.

Can the fix get incorporated here?

I would very appreciate that. I have 8 adapters not working :(

FLgator86 commented 12 months ago

I’m afraid I’ve got the same issue with three L510 series smart bulbs which have been updated to firmware 1.3.0. Adding it to this P100 thread instead of duplicating since it’s exactly the same error: IMG_4451

bvelkov commented 12 months ago

I’m afraid I’ve got the same issue with three L510 series smart bulbs which have been updated to firmware 1.3.0. Adding it to this P100 thread instead of duplicating since it’s exactly the same error: IMG_4451

I got the same issue with my L530 lights. It was working perfectly fine with 1.1.9 but now on 1.3.0 I can't control any of the states, hopefully they'll fix this soon!

f0rkth1s commented 11 months ago

I am also seeing the same failure

jhogan05 commented 11 months ago

I have installed the 1.5.0-beta3 and my P100 switches are back up and working. Have seen a few error messages (see below)

Thanks!


[18/10/2023, 10:12:09 pm] [Tapo Smart Platform] Get Characteristic On -> false [18/10/2023, 10:12:09 pm] [Tapo Smart Platform] Received request on host response: 192.168.1.55 [18/10/2023, 10:12:09 pm] [Tapo Smart Platform] 372 Error Code: Unexpected token ~ in JSON at position 15, undefined 192.168.1.55 [18/10/2023, 10:12:09 pm] [Tapo Smart Platform] Device Info: { devhce_id: 'xxxx', fw_ver: '1.2.1 Build 230804 Rel.190922', hw_ver: '2.0', type: 'SMART.TAPOPLUG', model: 'P100', mac: '9C-53-22-A2-A2-91', hw_id: 'xxxx', fw_id: 'xxxx', oem_id: 'xxxx', ip: '192.168.1.55', time_diff: 570, ssid: 'xxxxxx', rssi: -47, signal_level: 3, auto_off_status: 'off', auto_off_remain_time: 0, latitude: 0, longitude: 0, lang: 'en_US', avatar: 'humidifier', region: 'Australia/Adelaide', specs: '', nickname: 'xxxx', has_set_location_info: false, device_on: true, on_time: 0, default_states: { type: 'last_states', state: {} }, overheated: false, last_update: 1697629329633 }

apatsufas commented 11 months ago

Please try the beta 1.5.0-beta3, it should fix the issues with the new Firmware for all supported devices.

modda4711 commented 11 months ago

Please try the beta 1.5.0-beta3, it should fix the issues with the new Firmware for all supported devices.

How to do that? I tried google but I didn't find anythind.

byOsta commented 11 months ago

Please try the beta 1.5.0-beta3, it should fix the issues with the new Firmware for all supported devices.

How to do that? I tried google but I didn't find anythind. @modda4711 image

@apatsufas Tried it, same error I think: image

It shows the error, but seems to work!

f0rkth1s commented 11 months ago

Just tried it myself and get the same error as above

apatsufas commented 11 months ago

Please try the beta 1.5.0-beta3, it should fix the issues with the new Firmware for all supported devices.

How to do that? I tried google but I didn't find anythind. @modda4711 image

@apatsufas Tried it, same error I think: image

It shows the error, but seems to work!

The error is shown because the plugin first tries the old login method, which is still in place for backwards compatibility, and fails and then continues to the new login method, which is why you see that it is working.

f0rkth1s commented 11 months ago

I can confirm that the above is accurate, I tested it and they are functional even with the initial error.

Another issue now is that if the bulb is powered off at the switch, this plugin is never able to reconnect without restarting homebridge.

This issue also exists in the other Tapo plugin on the plugin store.

Is this because a token is cached and is made invalid once the bulb restarts?

apatsufas commented 11 months ago

I can confirm that the above is accurate, I tested it and they are functional even with the initial error.

Another issue now is that if the bulb is powered off at the switch, this plugin is never able to reconnect without restarting homebridge.

This issue also exists in the other Tapo plugin on the plugin store.

Is this because a token is cached and is made invalid once the bulb restarts?

Good point, when I find some time again I will investigate it.

FLgator86 commented 11 months ago

@apatsufas Thanks for publishing the beta… I’d like to give it a try but I’ve not been able to install it. Also tried via terminal with npm install -g homebridge-tapo@1.5.0-beta3 and not had any joy. Perhaps I’m missing something obvious?

image
FLgator86 commented 11 months ago

So, I've managed to resolve the above error. Updating to the latest node.js had no effect, but from looking up the ENOTEMPTY error it seems this sometimes happens with partial installs/uninstalls so I deleted the homebridge-tapo directory from /var/lib/homebridge/node_modules and then successfully installed the beta. Unfortunately the beta has not resolved my issue. I'm still getting the 97 Error Code: 1003 issue (which I expected, based on the comment above saying this is related to the old login method) but now am also getting a 322 and 371 error (presumably linked to the new protocol) and the end result is the same - my L510 bulbs cannot be controlled via homebridge. image

mrsilver76 commented 11 months ago

Installed the beta and, after a bunch of "KLAP handshake failed" messages, it seemed to be up and running - so I removed my home and attempted to add everything back again.

All four P100 plugs were recognised and added to "My Home" but, sadly, all of them are reporting "No Response".

I'm not sure quite what to do now as I can't toggle anything on or off within iOS and there is (quite literally) nothing in the logs.

huw commented 10 months ago

I’d like to +1 to the situation where I was facing the error, I upgraded, I still get the error in the logs, but my switches work again now. Not sure what’s going on but thank you!

gibbsjoh commented 10 months ago

Another +1 here, oddly this worked fine on HB on Linux w/ the beta plugin, but I moved to macOS yesterday and I'm getting these infernal KLAP errors again!

bonesoul commented 10 months ago

same issue here.

gibbsjoh commented 10 months ago

Oddly I migrated back to Linux (different distro) and it works again! I still see the errors. I’ll post a log when I can. Sent from my iPhoneOn 1 Dec 2023, at 10:07, Hüseyin Uslu @.***> wrote: same issue here.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>

mrtargaryen commented 9 months ago

Please try the beta 1.5.0-beta3, it should fix the issues with the new Firmware for all supported devices.

How to do that? I tried google but I didn't find anythind. @modda4711 image

@apatsufas Tried it, same error I think: image It shows the error, but seems to work!

The error is shown because the plugin first tries the old login method, which is still in place for backwards compatibility, and fails and then continues to the new login method, which is why you see that it is working.

I had the same 1003 error that others were having here, I tried the P100 Tapo plugin for my Tapo Smart Plug and this is the result:

[12/22/2023, 11:14:58 AM] AssertionError [ERR_ASSERTION]: Accessories must be created with a non-empty displayName.
    at new Accessory (/opt/homebrew/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:491:11)
    at new PlatformAccessory (/opt/homebrew/lib/node_modules/homebridge/src/platformAccessory.ts:71:9)
    at TapoPlatform.discoverDevices (/opt/homebrew/lib/node_modules/homebridge-tapo/src/platform.ts:159:25)
    at HomebridgeAPI.<anonymous> (/opt/homebrew/lib/node_modules/homebridge-tapo/src/platform.ts:59:12)
    at HomebridgeAPI.emit (node:events:531:35)
    at HomebridgeAPI.signalFinished (/opt/homebrew/lib/node_modules/homebridge/src/api.ts:275:10)
    at Server.start (/opt/homebrew/lib/node_modules/homebridge/src/server.ts:190:14)
(node:61172) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
[12/22/2023, 11:14:58 AM] Got SIGTERM, shutting down Homebridge...
[12/22/2023, 11:14:58 AM] AssertionError [ERR_ASSERTION]: Cannot generate setupURI on an accessory that isn't published yet!
    at Bridge.Accessory.setupURI (/opt/homebrew/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:994:11)
    at Server.setServerStatus (/opt/homebrew/lib/node_modules/homebridge/src/server.ts:155:45)
    at Server.teardown (/opt/homebrew/lib/node_modules/homebridge/src/server.ts:199:10)
    at signalHandler (/opt/homebrew/lib/node_modules/homebridge/src/cli.ts:93:12)
    at process.emit (node:events:519:28)
    at process.emit (/opt/homebrew/lib/node_modules/homebridge/node_modules/source-map-support/source-map-support.js:516:21)
[12/22/2023, 11:14:58 AM] [Tapo Smart Platform] 97 Error Code: 1003, undefined 192.168.50.222

Any idea what's going wrong? I just installed Homebridge for the first time this morning, I got the bulbs working but not the smart plug.

OpenRiseANZ commented 9 months ago

Can you post your config for the Plugin?

Epirr commented 9 months ago

same issue here, just installed homebridge and trying this out as my first plugin for my tapo l510 bulbs

77317013 commented 9 months ago

Same issue with P100 plugs, plugin works fine for hours, sometimes over a day, but then fails.

Screenshot 2024-01-05 at 12 17 31

Any idea what's going wrong?

ggudjonsson commented 7 months ago

Any news concerning this problem? [12/02/2024, 22:37:52] [Tapo Smart Platform] 97 Error Code: 1003, KLAP 192.168.1.235 [12/02/2024, 22:37:52] [Tapo Smart Platform] 322 Error: socket hang up [12/02/2024, 22:37:52] [Tapo Smart Platform] KLAP Handshake failed

JonasvonBlohn commented 5 months ago

Problem still exists....any help?

klautusi commented 4 months ago

Similar issue here 322 Error: Request failed with status code 403

Started a month or so ago and hasnt worked since.

Any thoughts?