apatsufas / homebridge-tapo-p100

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

add support for new auth #47

Open apatsufas opened 10 months ago

akudev commented 9 months ago

I am using this plugin inside the Homebridge Accessory Manager adapter in iobroker and can confirm that this (1.5.0-beta3) allows my L510 bulbs to be controlled again.

But this only works for "the rest of the day": next morning state changes do not change the physical lamp anymore. However, a restart of the Homebridge Accessory Manager fixes this and everything works again. So I guess there is some initialization code which needs to be run again once there is some sort of session expiry.

Edit: other Homebridge plugins I use within HAM do not require this restart, hence my assumption that this behavior is TAPO-specific.

akudev commented 9 months ago

Even worse: I believe that once this happens, the plugin goes wild until my Raspberry becomes unresponsive. /var/log/syslog contains literally hundreds of these message per second:

Nov 16 10:09:06 pi bash[538]: [16/11/2023, 10:09:06] [Tapo Smart Platform] 322 Error: connect ECONNRESET 192.168.178.79:80
Nov 16 10:09:06 pi bash[538]: [16/11/2023, 10:09:06] [Tapo Smart Platform] 322 Error: connect ECONNRESET 192.168.178.79:80
Nov 16 10:09:06 pi bash[538]: [16/11/2023, 10:09:06] [Tapo Smart Platform] 322 Error: connect ECONNRESET 192.168.178.79:80
Nov 16 10:09:06 pi bash[538]: [16/11/2023, 10:09:06] [Tapo Smart Platform] 322 Error: connect ECONNRESET 192.168.178.79:80
Nov 16 10:09:06 pi bash[538]: [16/11/2023, 10:09:06] [Tapo Smart Platform] 322 Error: connect ECONNRESET 192.168.178.79:80
Nov 16 10:09:06 pi bash[538]: [16/11/2023, 10:09:06] [Tapo Smart Platform] 322 Error: connect ECONNRESET 192.168.178.79:80
Nov 16 10:09:06 pi bash[538]: [16/11/2023, 10:09:06] [Tapo Smart Platform] 322 Error: connect ECONNRESET 192.168.178.79:80
Nov 16 10:09:06 pi bash[538]: [16/11/2023, 10:09:06] [Tapo Smart Platform] 322 Error: connect ECONNRESET 192.168.178.79:80
Nov 16 10:09:06 pi bash[538]: [16/11/2023, 10:09:06] [Tapo Smart Platform] 322 Error: connect ECONNRESET 192.168.178.79:80
Nov 16 10:09:06 pi bash[538]: [16/11/2023, 10:09:06] [Tapo Smart Platform] 322 Error: connect ECONNRESET 192.168.178.79:80`

And then the syslog content ends. That's the last entries, nothing else for hours until I force-rebooted it. (It did not even respond to ping.)

In the iobroker log at the same time:

2023-11-16 10:07:00.611  - debug: ham.0 (18081) Char change event: false --> false
2023-11-16 10:07:00.612  - debug: ham.0 (18081) handleCharValue = false
2023-11-16 10:07:00.630  - debug: ham.0 (18081) setState tapo-lampe-2.Lightbulb.On: set value = false
2023-11-16 10:07:00.631  - debug: ham.0 (18081) Char change event: 15 --> 15
2023-11-16 10:07:00.631  - debug: ham.0 (18081) handleCharValue = 15
2023-11-16 10:07:00.646  - debug: ham.0 (18081) setState tapo-lampe-2.Lightbulb.Brightness: set value = 15
2023-11-16 10:07:00.681  - info: ham.0 (18081) stateChange ham.0.tapo-lampe-2.Lightbulb.On {"val":false,"ack":true,"ts":1700125620675,"q":0,"from":"system.adapter.ham.0","user":"system.user.admin","lc":1700117754129}
2023-11-16 10:07:00.685  - info: ham.0 (18081) stateChange ham.0.tapo-lampe-2.Lightbulb.Brightness {"val":15,"ack":true,"ts":1700125620676,"q":0,"from":"system.adapter.ham.0","user":"system.user.admin","lc":1700117749125}
2023-11-16 10:07:02.651  - debug: ham.0 (18081) Char change event: false --> false
2023-11-16 10:07:02.652  - debug: ham.0 (18081) handleCharValue = false
2023-11-16 10:07:02.661  - debug: ham.0 (18081) setState tapo-lampe-2.Lightbulb.On: set value = false
2023-11-16 10:07:02.661  - debug: ham.0 (18081) Char change event: 15 --> 15
2023-11-16 10:07:02.661  - debug: ham.0 (18081) handleCharValue = 15
2023-11-16 10:07:02.667  - debug: ham.0 (18081) setState tapo-lampe-2.Lightbulb.Brightness: set value = 15
2023-11-16 10:07:02.681  - info: ham.0 (18081) stateChange ham.0.tapo-lampe-2.Lightbulb.On {"val":false,"ack":true,"ts":1700125622679,"q":0,"from":"system.adapter.ham.0","user":"system.user.admin","lc":1700117754129}
2023-11-16 10:07:02.684  - info: ham.0 (18081) stateChange ham.0.tapo-lampe-2.Lightbulb.Brightness {"val":15,"ack":true,"ts":1700125622679,"q":0,"from":"system.adapter.ham.0","user":"system.user.admin","lc":1700117749125}
2023-11-16 10:07:05.003  - debug: ham.0 (18081) Char change event: false --> false
2023-11-16 10:07:05.004  - debug: ham.0 (18081) handleCharValue = false
2023-11-16 10:07:05.021  - debug: ham.0 (18081) setState tapo-lampe-2.Lightbulb.On: set value = false
2023-11-16 10:07:05.022  - debug: ham.0 (18081) Char change event: 15 --> 15
2023-11-16 10:07:05.022  - debug: ham.0 (18081) handleCharValue = 15
2023-11-16 10:07:05.047  - debug: ham.0 (18081) setState tapo-lampe-2.Lightbulb.Brightness: set value = 15

"Change" between equal states.

I can't tell whether this is caused by embedding inside iobroker or by the plugin itself, so I don't open an issue, but I wanted to let you know within this PR that something might be wrong.

Heisenberg2018 commented 8 months ago

Is there any new information when the update will be released?