Skip to content

Doesn't work with newer HS100 switches hardware 5.26 #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
nikhilsharmac opened this issue Nov 18, 2024 · 31 comments
Closed

Doesn't work with newer HS100 switches hardware 5.26 #4

nikhilsharmac opened this issue Nov 18, 2024 · 31 comments
Assignees
Labels
question Further information is requested

Comments

@nikhilsharmac
Copy link

nikhilsharmac commented Nov 18, 2024

I recently bought some more HS100 switches from amazon, I have 3 more which I bought earlier this year which work perfectly fine, the new ones with the new hardware version are not discoverable and can't be detected.

[Logs:]

Plugin Config:
{
"name": "KasaPython",
"enableCredentials": true,
"username": "",
"password": "",
"powerStrip": false,
"platform": "KasaPython"
}

Environment:

  • Plugin Version: ---- v2.5.6
  • Homebridge Version:
  • Node.js Version: ----[v20.12.2]
  • NPM Version:
  • Operating System: <!-- Raspbian
@nikhilsharmac nikhilsharmac added the question Further information is requested label Nov 18, 2024
@ZeliardM ZeliardM self-assigned this Nov 19, 2024
@ZeliardM
Copy link
Owner

Please make sure to scrub personal information from any of this before submitting as the username and password are in clear text here like that from the logs and information.

I will look into this as to why it wasn't finding it, there was an error in the device discovery, so I may need to add some more logging to find out what was going on.

In the meantime, would you be able to do the following for me from the Homebridge Web UI Terminal:
cd kasa-python
source .venv/bin/activate
kasa --version
kasa discover
kasa --username (your kasa username) --password (your kasa password) discover

Don't use the (), just your information there.

If you could post the outputs here all of that and let me know.

Thanks!

@nikhilsharmac
Copy link
Author

Here you go, hidden the personal info also. Appreciate your help, it looks like it can discover those devices on the network.

pi@homebridge:/var/lib/homebridge $ cd kasa-python
pi@homebridge:/var/lib/homebridge/kasa-python $ source .venv/bin/activate
(.venv) pi@homebridge:/var/lib/homebridge/kasa-python $ kasa --version
kasa, version 0.7.7
(.venv) pi@homebridge:/var/lib/homebridge/kasa-python $ kasa discover
Discovering devices on 255.255.255.255 for 10 seconds
== Master Bedroom Light - HS210(US) ==
Host: 192.168.0.165
Port: 9999
Device state: False
Time: 2024-11-19 13:28:10-05:00 (tz: EST)
Hardware: 3.0
Software: 1.0.10 Build 240122 Rel.193635
MAC (rssi): 20:23:51:F5:76:31 (-36)

== Primary features ==
State (state): False

== Information ==
On since (on_since): None
Cloud connection (cloud_connection): True

== Configuration ==
LED (led): True

== Debug ==
RSSI (rssi): -36 dBm
Reboot (reboot):

== Front Porch Lights - HS200(US) ==
Host: 192.168.0.170
Port: 9999
Device state: False
Time: 2024-11-19 13:28:10-05:00 (tz: EST)
Hardware: 5.0
Software: 1.0.11 Build 230908 Rel.160526
MAC (rssi): A8:42:A1:77:D4:4F (-43)

== Primary features ==
State (state): False

== Information ==
On since (on_since): None
Cloud connection (cloud_connection): True

== Configuration ==
LED (led): True

== Debug ==
RSSI (rssi): -43 dBm
Reboot (reboot):

== Deck Lights - HS210(US) ==
Host: 192.168.0.166
Port: 9999
Device state: False
Time: 2024-11-19 13:28:10-05:00 (tz: EST)
Hardware: 3.0
Software: 1.0.10 Build 240122 Rel.193635
MAC (rssi): 20:23:51:F5:6D:E1 (-41)

== Primary features ==
State (state): False

== Information ==
On since (on_since): None
Cloud connection (cloud_connection): True

== Configuration ==
LED (led): True

== Debug ==
RSSI (rssi): -41 dBm
Reboot (reboot):

== Authentication failed for device ==
== Discovery Result ==
Device Type: SMART.KASASWITCH
Device Model: HS200(US)
IP: 192.168.0.163
MAC: 74-FE-CE-38-43-FA
Device Id (hash): 4de3ba4dcc90cd469417249d80cfcdff
Owner (hash): A5FE6DD4CFF31AE7497560B62051C1DD
Supports IOT Cloud: True
OBD Src: A5FE6DD4CFF31AE7497560B62051C1DD
Encrypt Type: KLAP
HTTP Port: 80

== Hallway West - HS210(US) ==
Host: 192.168.0.167
Port: 9999
Device state: False
Time: 2024-11-19 13:28:10-05:00 (tz: EST)
Hardware: 3.0
Software: 1.0.10 Build 240122 Rel.193635
MAC (rssi): 20:23:51:F5:6D:DF (-47)

== Primary features ==
State (state): False

== Information ==
On since (on_since): None
Cloud connection (cloud_connection): True

== Configuration ==
LED (led): True

== Debug ==
RSSI (rssi): -47 dBm
Reboot (reboot):

== Kitchen Fan - HS200(US) ==
Host: 192.168.0.139
Port: 9999
Device state: False
Time: 2024-11-19 13:28:11-05:00 (tz: EST)
Hardware: 5.0
Software: 1.0.11 Build 230908 Rel.160526
MAC (rssi): A8:42:A1:77:CF:F7 (-40)

== Primary features ==
State (state): False

== Information ==
On since (on_since): None
Cloud connection (cloud_connection): True

== Configuration ==
LED (led): True

== Debug ==
RSSI (rssi): -40 dBm
Reboot (reboot):

== Unsupported device ==
Unable to parse discovery from device: 192.168.0.105: 1 validation error for DiscoveryResult
mgt_encrypt_schm
field required (type=value_error.missing)

== Unsupported device ==
Unable to parse discovery from device: 192.168.0.103: 1 validation error for DiscoveryResult
mgt_encrypt_schm
field required (type=value_error.missing)

== Unsupported device ==
Unable to parse discovery from device: 192.168.0.100: 1 validation error for DiscoveryResult
mgt_encrypt_schm
field required (type=value_error.missing)

== Authentication failed for device ==
== Discovery Result ==
Device Type: SMART.KASASWITCH
Device Model: HS200(US)
IP: 192.168.0.158
MAC: 74-FE-CE-38-63-65
Device Id (hash): b8b8ad06cb51ef0bcaea9bc0a824e884
Owner (hash): A5FE6DD4CFF31AE7497560B62051C1DD
Supports IOT Cloud: True
OBD Src: A5FE6DD4CFF31AE7497560B62051C1DD
Encrypt Type: KLAP
HTTP Port: 80

== Hallway East - HS210(US) ==
Host: 192.168.0.113
Port: 9999
Device state: False
Time: 2024-11-19 13:28:14-05:00 (tz: EST)
Hardware: 3.0
Software: 1.0.10 Build 240122 Rel.193635
MAC (rssi): 20:23:51:F5:75:57 (-41)

== Primary features ==
State (state): False

== Information ==
On since (on_since): None
Cloud connection (cloud_connection): True

== Configuration ==
LED (led): True

== Debug ==
RSSI (rssi): -41 dBm
Reboot (reboot):

== Garage Lights - HS200(US) ==
Host: 192.168.0.119
Port: 9999
Device state: False
Time: 2024-11-19 13:28:13-05:00 (tz: EST)
Hardware: 5.0
Software: 1.0.11 Build 230908 Rel.160526
MAC (rssi): A8:42:A1:77:AC:7E (-54)

== Primary features ==
State (state): False

== Information ==
On since (on_since): None
Cloud connection (cloud_connection): True

== Configuration ==
LED (led): True

== Debug ==
RSSI (rssi): -54 dBm
Reboot (reboot):

Found 9 devices
Found 3 unsupported devices
Found 2 devices that failed to authenticate
(.venv) pi@homebridge:/var/lib/homebridge/kasa-python $ kasa --username MYUSERNAME --password THEPASSOFMYUSERNAME discover
Discovering devices on 255.255.255.255 for 10 seconds
== Master Bedroom Light - HS210(US) ==
Host: 192.168.0.165
Port: 9999
Device state: False
Time: 2024-11-19 13:29:44-05:00 (tz: EST)
Hardware: 3.0
Software: 1.0.10 Build 240122 Rel.193635
MAC (rssi): 20:23:51:F5:76:31 (-36)

== Primary features ==
State (state): False

== Information ==
On since (on_since): None
Cloud connection (cloud_connection): True

== Configuration ==
LED (led): True

== Debug ==
RSSI (rssi): -36 dBm
Reboot (reboot):

== Front Porch Lights - HS200(US) ==
Host: 192.168.0.170
Port: 9999
Device state: False
Time: 2024-11-19 13:29:45-05:00 (tz: EST)
Hardware: 5.0
Software: 1.0.11 Build 230908 Rel.160526
MAC (rssi): A8:42:A1:77:D4:4F (-43)

== Primary features ==
State (state): False

== Information ==
On since (on_since): None
Cloud connection (cloud_connection): True

== Configuration ==
LED (led): True

== Debug ==
RSSI (rssi): -43 dBm
Reboot (reboot):

== Hallway East - HS210(US) ==
Host: 192.168.0.113
Port: 9999
Device state: False
Time: 2024-11-19 13:29:45-05:00 (tz: EST)
Hardware: 3.0
Software: 1.0.10 Build 240122 Rel.193635
MAC (rssi): 20:23:51:F5:75:57 (-41)

== Primary features ==
State (state): False

== Information ==
On since (on_since): None
Cloud connection (cloud_connection): True

== Configuration ==
LED (led): True

== Debug ==
RSSI (rssi): -41 dBm
Reboot (reboot):

== Kitchen Fan - HS200(US) ==
Host: 192.168.0.139
Port: 9999
Device state: False
Time: 2024-11-19 13:29:45-05:00 (tz: EST)
Hardware: 5.0
Software: 1.0.11 Build 230908 Rel.160526
MAC (rssi): A8:42:A1:77:CF:F7 (-40)

== Primary features ==
State (state): False

== Information ==
On since (on_since): None
Cloud connection (cloud_connection): True

== Configuration ==
LED (led): True

== Debug ==
RSSI (rssi): -40 dBm
Reboot (reboot):

== Authentication failed for device ==
== Discovery Result ==
Device Type: SMART.KASASWITCH
Device Model: HS200(US)
IP: 192.168.0.163
MAC: 74-FE-CE-38-43-FA
Device Id (hash): 4de3ba4dcc90cd469417249d80cfcdff
Owner (hash): A5FE6DD4CFF31AE7497560B62051C1DD
Supports IOT Cloud: True
OBD Src: A5FE6DD4CFF31AE7497560B62051C1DD
Encrypt Type: KLAP
HTTP Port: 80

== Authentication failed for device ==
== Discovery Result ==
Device Type: SMART.KASASWITCH
Device Model: HS200(US)
IP: 192.168.0.158
MAC: 74-FE-CE-38-63-65
Device Id (hash): b8b8ad06cb51ef0bcaea9bc0a824e884
Owner (hash): A5FE6DD4CFF31AE7497560B62051C1DD
Supports IOT Cloud: True
OBD Src: A5FE6DD4CFF31AE7497560B62051C1DD
Encrypt Type: KLAP
HTTP Port: 80

== Deck Lights - HS210(US) ==
Host: 192.168.0.166
Port: 9999
Device state: False
Time: 2024-11-19 13:29:45-05:00 (tz: EST)
Hardware: 3.0
Software: 1.0.10 Build 240122 Rel.193635
MAC (rssi): 20:23:51:F5:6D:E1 (-41)

== Primary features ==
State (state): False

== Information ==
On since (on_since): None
Cloud connection (cloud_connection): True

== Configuration ==
LED (led): True

== Debug ==
RSSI (rssi): -41 dBm
Reboot (reboot):

== Hallway West - HS210(US) ==
Host: 192.168.0.167
Port: 9999
Device state: False
Time: 2024-11-19 13:29:45-05:00 (tz: EST)
Hardware: 3.0
Software: 1.0.10 Build 240122 Rel.193635
MAC (rssi): 20:23:51:F5:6D:DF (-47)

== Primary features ==
State (state): False

== Information ==
On since (on_since): None
Cloud connection (cloud_connection): True

== Configuration ==
LED (led): True

== Debug ==
RSSI (rssi): -47 dBm
Reboot (reboot):

== Authentication failed for device ==
== Discovery Result ==
Device Type: SMART.KASASWITCH
Device Model: HS200(US)
IP: 192.168.0.164
MAC: 74-FE-CE-38-70-8A
Device Id (hash): 9e46b3590b6d7d3a8c3c1ac1cb333f29
Owner (hash): A5FE6DD4CFF31AE7497560B62051C1DD
Supports IOT Cloud: True
OBD Src: A5FE6DD4CFF31AE7497560B62051C1DD
Encrypt Type: KLAP
HTTP Port: 80

== Unsupported device ==
Unable to parse discovery from device: 192.168.0.100: 1 validation error for DiscoveryResult
mgt_encrypt_schm
field required (type=value_error.missing)

== Unsupported device ==
Unable to parse discovery from device: 192.168.0.105: 1 validation error for DiscoveryResult
mgt_encrypt_schm
field required (type=value_error.missing)

== Unsupported device ==
Unable to parse discovery from device: 192.168.0.103: 1 validation error for DiscoveryResult
mgt_encrypt_schm
field required (type=value_error.missing)

== Garage Lights - HS200(US) ==
Host: 192.168.0.119
Port: 9999
Device state: False
Time: 2024-11-19 13:29:48-05:00 (tz: EST)
Hardware: 5.0
Software: 1.0.11 Build 230908 Rel.160526
MAC (rssi): A8:42:A1:77:AC:7E (-53)

== Primary features ==
State (state): False

== Information ==
On since (on_since): None
Cloud connection (cloud_connection): True

== Configuration ==
LED (led): True

== Debug ==
RSSI (rssi): -53 dBm
Reboot (reboot):

Found 10 devices
Found 3 unsupported devices
Found 3 devices that failed to authenticate

@ZeliardM
Copy link
Owner

Ok, so it's finding devices. That's the good part. It looks like the three device ip's 100, 103, and 105 are not supported by the python-kasa library. Unfortunately there nothing I can do until they do support them. I can't wait try to get some more information from you and see if we can submit the device for support and that might speed things up.

3 device ip's 158, 163, and 164 are still failing authentication with the credentials provided, going to see if there's a better way or different way to pass credentials for authentication.

Will let you know what I need for the device submission and when I have another version to test for authentication.

@ZeliardM
Copy link
Owner

@nikhilsharmac can you try v2.5.8?

@nikhilsharmac
Copy link
Author

That did not work, I will attach the terminal logs just like last time below.

Discovering devices on 255.255.255.255 for 10 seconds
== Garage Lights - HS200(US) ==
Host: 192.168.0.119
Port: 9999
Device state: False
Time: 2024-11-21 15:44:33-05:00 (tz: EST)
Hardware: 5.0
Software: 1.0.11 Build 230908 Rel.160526
MAC (rssi): A8:42:A1:77:AC:7E (-55)

== Primary features ==
State (state): False

== Information ==
On since (on_since): None
Cloud connection (cloud_connection): True

== Configuration ==
LED (led): True

== Debug ==
RSSI (rssi): -55 dBm
Reboot (reboot):

== Kitchen Fan - HS200(US) ==
Host: 192.168.0.139
Port: 9999
Device state: False
Time: 2024-11-21 15:44:33-05:00 (tz: EST)
Hardware: 5.0
Software: 1.0.11 Build 230908 Rel.160526
MAC (rssi): A8:42:A1:77:CF:F7 (-41)

== Primary features ==
State (state): False

== Information ==
On since (on_since): None
Cloud connection (cloud_connection): True

== Configuration ==
LED (led): True

== Debug ==
RSSI (rssi): -41 dBm
Reboot (reboot):

== Hallway West - HS210(US) ==
Host: 192.168.0.167
Port: 9999
Device state: False
Time: 2024-11-21 15:44:33-05:00 (tz: EST)
Hardware: 3.0
Software: 1.0.10 Build 240122 Rel.193635
MAC (rssi): 20:23:51:F5:6D:DF (-48)

== Primary features ==
State (state): False

== Information ==
On since (on_since): None
Cloud connection (cloud_connection): True

== Configuration ==
LED (led): True

== Debug ==
RSSI (rssi): -48 dBm
Reboot (reboot):

== Deck Lights - HS210(US) ==
Host: 192.168.0.166
Port: 9999
Device state: False
Time: 2024-11-21 15:44:33-05:00 (tz: EST)
Hardware: 3.0
Software: 1.0.10 Build 240122 Rel.193635
MAC (rssi): 20:23:51:F5:6D:E1 (-42)

== Primary features ==
State (state): False

== Information ==
On since (on_since): None
Cloud connection (cloud_connection): True

== Configuration ==
LED (led): True

== Debug ==
RSSI (rssi): -42 dBm
Reboot (reboot):

== Master Bedroom Light - HS210(US) ==
Host: 192.168.0.165
Port: 9999
Device state: False
Time: 2024-11-21 15:44:33-05:00 (tz: EST)
Hardware: 3.0
Software: 1.0.10 Build 240122 Rel.193635
MAC (rssi): 20:23:51:F5:76:31 (-36)

== Primary features ==
State (state): False

== Information ==
On since (on_since): None
Cloud connection (cloud_connection): True

== Configuration ==
LED (led): True

== Debug ==
RSSI (rssi): -36 dBm
Reboot (reboot):

== Authentication failed for device ==
== Discovery Result ==
Device Type: SMART.KASASWITCH
Device Model: HS200(US)
IP: 192.168.0.158
MAC: 74-FE-CE-38-63-65
Device Id (hash): b8b8ad06cb51ef0bcaea9bc0a824e884
Owner (hash): A5FE6DD4CFF31AE7497560B62051C1DD
Supports IOT Cloud: True
OBD Src: A5FE6DD4CFF31AE7497560B62051C1DD
Encrypt Type: KLAP
HTTP Port: 80

== Authentication failed for device ==
== Discovery Result ==
Device Type: SMART.KASASWITCH
Device Model: HS200(US)
IP: 192.168.0.164
MAC: 74-FE-CE-38-70-8A
Device Id (hash): 9e46b3590b6d7d3a8c3c1ac1cb333f29
Owner (hash): A5FE6DD4CFF31AE7497560B62051C1DD
Supports IOT Cloud: True
OBD Src: A5FE6DD4CFF31AE7497560B62051C1DD
Encrypt Type: KLAP
HTTP Port: 80

== Authentication failed for device ==
== Discovery Result ==
Device Type: SMART.KASASWITCH
Device Model: HS200(US)
IP: 192.168.0.163
MAC: 74-FE-CE-38-43-FA
Device Id (hash): 4de3ba4dcc90cd469417249d80cfcdff
Owner (hash): A5FE6DD4CFF31AE7497560B62051C1DD
Supports IOT Cloud: True
OBD Src: A5FE6DD4CFF31AE7497560B62051C1DD
Encrypt Type: KLAP
HTTP Port: 80

== Front Porch Lights - HS200(US) ==
Host: 192.168.0.170
Port: 9999
Device state: False
Time: 2024-11-21 15:44:34-05:00 (tz: EST)
Hardware: 5.0
Software: 1.0.11 Build 230908 Rel.160526
MAC (rssi): A8:42:A1:77:D4:4F (-43)

== Primary features ==
State (state): False

== Information ==
On since (on_since): None
Cloud connection (cloud_connection): True

== Configuration ==
LED (led): True

== Debug ==
RSSI (rssi): -43 dBm
Reboot (reboot):

== Hallway East - HS210(US) ==
Host: 192.168.0.113
Port: 9999
Device state: False
Time: 2024-11-21 15:44:33-05:00 (tz: EST)
Hardware: 3.0
Software: 1.0.10 Build 240122 Rel.193635
MAC (rssi): 20:23:51:F5:75:57 (-39)

== Primary features ==
State (state): False

== Information ==
On since (on_since): None
Cloud connection (cloud_connection): True

== Configuration ==
LED (led): True

== Debug ==
RSSI (rssi): -39 dBm
Reboot (reboot):

== Unsupported device ==
Unable to parse discovery from device: 192.168.0.103: 1 validation error for DiscoveryResult
mgt_encrypt_schm
field required (type=value_error.missing)

== Unsupported device ==
Unable to parse discovery from device: 192.168.0.105: 1 validation error for DiscoveryResult
mgt_encrypt_schm
field required (type=value_error.missing)

== Unsupported device ==
Unable to parse discovery from device: 192.168.0.100: 1 validation error for DiscoveryResult
mgt_encrypt_schm
field required (type=value_error.missing)

Found 10 devices
Found 3 unsupported devices
Found 3 devices that failed to authenticate
Discovering devices on 255.255.255.255 for 10 seconds
== Kitchen Fan - HS200(US) ==
Host: 192.168.0.139
Port: 9999
Device state: False
Time: 2024-11-21 15:44:43-05:00 (tz: EST)
Hardware: 5.0
Software: 1.0.11 Build 230908 Rel.160526
MAC (rssi): A8:42:A1:77:CF:F7 (-41)

== Primary features ==
State (state): False

== Information ==
On since (on_since): None
Cloud connection (cloud_connection): True

== Configuration ==
LED (led): True

== Debug ==
RSSI (rssi): -41 dBm
Reboot (reboot):

== Deck Lights - HS210(US) ==
Host: 192.168.0.166
Port: 9999
Device state: False
Time: 2024-11-21 15:44:43-05:00 (tz: EST)
Hardware: 3.0
Software: 1.0.10 Build 240122 Rel.193635
MAC (rssi): 20:23:51:F5:6D:E1 (-42)

== Primary features ==
State (state): False

== Information ==
On since (on_since): None
Cloud connection (cloud_connection): True

== Configuration ==
LED (led): True

== Debug ==
RSSI (rssi): -42 dBm
Reboot (reboot):

== Garage Lights - HS200(US) ==
Host: 192.168.0.119
Port: 9999
Device state: False
Time: 2024-11-21 15:44:43-05:00 (tz: EST)
Hardware: 5.0
Software: 1.0.11 Build 230908 Rel.160526
MAC (rssi): A8:42:A1:77:AC:7E (-55)

== Primary features ==
State (state): False

== Information ==
On since (on_since): None
Cloud connection (cloud_connection): True

== Configuration ==
LED (led): True

== Debug ==
RSSI (rssi): -55 dBm
Reboot (reboot):

== Hallway West - HS210(US) ==
Host: 192.168.0.167
Port: 9999
Device state: False
Time: 2024-11-21 15:44:43-05:00 (tz: EST)
Hardware: 3.0
Software: 1.0.10 Build 240122 Rel.193635
MAC (rssi): 20:23:51:F5:6D:DF (-48)

== Primary features ==
State (state): False

== Information ==
On since (on_since): None
Cloud connection (cloud_connection): True

== Configuration ==
LED (led): True

== Debug ==
RSSI (rssi): -48 dBm
Reboot (reboot):

== Front Porch Lights - HS200(US) ==
Host: 192.168.0.170
Port: 9999
Device state: False
Time: 2024-11-21 15:44:44-05:00 (tz: EST)
Hardware: 5.0
Software: 1.0.11 Build 230908 Rel.160526
MAC (rssi): A8:42:A1:77:D4:4F (-43)

== Primary features ==
State (state): False

== Information ==
On since (on_since): None
Cloud connection (cloud_connection): True

== Configuration ==
LED (led): True

== Debug ==
RSSI (rssi): -43 dBm
Reboot (reboot):

== Master Bedroom Light - HS210(US) ==
Host: 192.168.0.165
Port: 9999
Device state: False
Time: 2024-11-21 15:44:44-05:00 (tz: EST)
Hardware: 3.0
Software: 1.0.10 Build 240122 Rel.193635
MAC (rssi): 20:23:51:F5:76:31 (-36)

== Primary features ==
State (state): False

== Information ==
On since (on_since): None
Cloud connection (cloud_connection): True

== Configuration ==
LED (led): True

== Debug ==
RSSI (rssi): -36 dBm
Reboot (reboot):

== Hallway East - HS210(US) ==
Host: 192.168.0.113
Port: 9999
Device state: False
Time: 2024-11-21 15:44:43-05:00 (tz: EST)
Hardware: 3.0
Software: 1.0.10 Build 240122 Rel.193635
MAC (rssi): 20:23:51:F5:75:57 (-39)

== Primary features ==
State (state): False

== Information ==
On since (on_since): None
Cloud connection (cloud_connection): True

== Configuration ==
LED (led): True

== Debug ==
RSSI (rssi): -39 dBm
Reboot (reboot):

== Authentication failed for device ==
== Discovery Result ==
Device Type: SMART.KASASWITCH
Device Model: HS200(US)
IP: 192.168.0.158
MAC: 74-FE-CE-38-63-65
Device Id (hash): b8b8ad06cb51ef0bcaea9bc0a824e884
Owner (hash): A5FE6DD4CFF31AE7497560B62051C1DD
Supports IOT Cloud: True
OBD Src: A5FE6DD4CFF31AE7497560B62051C1DD
Encrypt Type: KLAP
HTTP Port: 80

== Authentication failed for device ==
== Discovery Result ==
Device Type: SMART.KASASWITCH
Device Model: HS200(US)
IP: 192.168.0.164
MAC: 74-FE-CE-38-70-8A
Device Id (hash): 9e46b3590b6d7d3a8c3c1ac1cb333f29
Owner (hash): A5FE6DD4CFF31AE7497560B62051C1DD
Supports IOT Cloud: True
OBD Src: A5FE6DD4CFF31AE7497560B62051C1DD
Encrypt Type: KLAP
HTTP Port: 80

== Authentication failed for device ==
== Discovery Result ==
Device Type: SMART.KASASWITCH
Device Model: HS200(US)
IP: 192.168.0.163
MAC: 74-FE-CE-38-43-FA
Device Id (hash): 4de3ba4dcc90cd469417249d80cfcdff
Owner (hash): A5FE6DD4CFF31AE7497560B62051C1DD
Supports IOT Cloud: True
OBD Src: A5FE6DD4CFF31AE7497560B62051C1DD
Encrypt Type: KLAP
HTTP Port: 80

== Unsupported device ==
Unable to parse discovery from device: 192.168.0.100: 1 validation error for DiscoveryResult
mgt_encrypt_schm
field required (type=value_error.missing)

== Unsupported device ==
Unable to parse discovery from device: 192.168.0.105: 1 validation error for DiscoveryResult
mgt_encrypt_schm
field required (type=value_error.missing)

== Unsupported device ==
Unable to parse discovery from device: 192.168.0.103: 1 validation error for DiscoveryResult
mgt_encrypt_schm
field required (type=value_error.missing)

Found 10 devices
Found 3 unsupported devices
Found 3 devices that failed to authenticate

And im attaching screenshots of the devices i see on my network. I believe the unsupported devices are my tplink access points ending in 100,105,103. The new hardware switches are ending in 163, 164, 158
IMG_C37D0609503A-1

@ZeliardM
Copy link
Owner

ZeliardM commented Nov 21, 2024

@nikhilsharmac Ok, what about the plugin logs? Can you scrub any personal information from them and post them as well, the terminal information shows me that there's an authentication error, now I need to figure out why in the plugin.

@ZeliardM
Copy link
Owner

@nikhilsharmac if you have the ability to set up a test machine, you will need to make sure that git and python are installed and run the following commands to get a json file to upload to the developer of the plugin for your device that is having the authentication errors, 163, 164, or 158:
$ git clone https://github.com/python-kasa/python-kasa.git
$ cd python-kasa
$ pip install uv
$ uv sync --all-extras
$ source .venv/bin/activate
$ python -m devtools.dump_devinfo --username --password --host

You can do this all from the WSL on a windows machine if you have it as well. Please let me know if you need assistance with this. Upload the json file here after you get it if possible or you should be able to copy and paste the information from the WSL Terminal here as well. You should not do this from the Homebridge Web UI Terminal, you cannot install things through that terminal so it would not work either way.

@nikhilsharmac
Copy link
Author

homebridge-kasa-python.log (1).txt
here is the plugin logs

@nikhilsharmac
Copy link
Author

Okay I will try to set that test machine up, I did the update and some of the switches are now missing in the Apple Home App. I've tried restarting homebridge also.
Screenshot 2024-11-21 at 5 59 17 PM

@ZeliardM
Copy link
Owner

ZeliardM commented Nov 22, 2024

@nikhilsharmac Can you run the following commands from the Homebridge Web UI Terminal:
cd kasa-python
source .venv/bin/activate
kasa --json --host 192.168.0.119 --debug discover
kasa --json --username "user" --password "pass" --host 192.168.0.163 --debug discover

Can you post that output here?

@nikhilsharmac
Copy link
Author

pi@homebridge:/var/lib/homebridge $ cd kasa-python
pi@homebridge:/var/lib/homebridge/kasa-python $ source .venv/bin/activate
(.venv) pi@homebridge:/var/lib/homebridge/kasa-python $ kasa --json --host 192.168.0.119 --debug discover
DEBUG:kasa.discover:[DISCOVERY] 192.168.0.119 >> {'system': {'get_sysinfo': {}}}
DEBUG:kasa.discover:Waiting a total of 10 seconds for responses...
DEBUG:kasa.discover:[DISCOVERY] 192.168.0.119 << {'system': {'get_sysinfo': {'active_mode': 'none',
'alias': '#MASKED_NAME#',
'dev_name': 'Smart Wi-Fi Light Switch',
'deviceId': 'REDACTED_CBC1119EA1E8410F686E8C7221CA6D8',
'err_code': 0,
'feature': 'TIM',
'hwId': '6F710464613C9F1EA67305BD422BC2D0',
'hw_ver': '5.0',
'icon_hash': '',
'latitude_i': 0,
'led_off': 0,
'longitude_i': 0,
'mac': 'A8:42:A1:00:00:00',
'mic_type': 'IOT.SMARTPLUGSWITCH',
'model': 'HS200(US)',
'next_action': {'type': -1},
'obd_src': 'tplink',
'oemId': 'REDACTED_1F1BCDAEC5B68B74FFFA7E0',
'on_time': 0,
'relay_state': 0,
'rssi': -56,
'status': 'new',
'sw_ver': '1.0.11 Build 230908 Rel.160526',
'updating': 0}}}
DEBUG:kasa.device:Initializing 192.168.0.119 of type <class 'kasa.iot.iotplug.IotWallSwitch'>
{
"system": {
"get_sysinfo": {
"sw_ver": "1.0.11 Build 230908 Rel.160526",
"hw_ver": "5.0",
"model": "HS200(US)",
"deviceId": "8006CCEC2CBC1119EA1E8410F686E8C7221CA6D8",
"oemId": "8754F01961F1BCDAEC5B68B74FFFA7E0",
"hwId": "6F710464613C9F1EA67305BD422BC2D0",
"rssi": -56,
"latitude_i": 407933,
"longitude_i": -778494,
"alias": "Garage Lights",
"status": "new",
"obd_src": "tplink",
"mic_type": "IOT.SMARTPLUGSWITCH",
"feature": "TIM",
"mac": "A8:42:A1:77:AC:7E",
"updating": 0,
"led_off": 0,
"relay_state": 0,
"on_time": 0,
"icon_hash": "",
"dev_name": "Smart Wi-Fi Light Switch",
"active_mode": "none",
"next_action": {
"type": -1
},
"err_code": 0
}
}
}
(.venv) pi@homebridge:/var/lib/homebridge/kasa-python $ kasa --json --username ****************** --password ************** --host 192.168.0.163 --debug discover
DEBUG:kasa.discover:[DISCOVERY] 192.168.0.163 >> {'system': {'get_sysinfo': {}}}
DEBUG:kasa.discover:Waiting a total of 10 seconds for responses...
DEBUG:kasa.klaptransport:Created KLAP transport for 192.168.0.163
DEBUG:kasa.discover:[DISCOVERY] 192.168.0.163 << {'error_code': 0,
'result': {'device_id': 'REDACTED_c90cd469417249d80cfcdff',
'device_model': 'HS200(US)',
'device_type': 'SMART.KASASWITCH',
'factory_default': False,
'ip': '192.168.0.163',
'is_support_iot_cloud': True,
'mac': '74-FE-CE-00-00-00',
'mgt_encrypt_schm': {'encrypt_type': 'KLAP',
'http_port': 80,
'is_support_https': False,
'lv': 2},
'obd_src': 'tplink',
'owner': 'REDACTED_FF31AE7497560B62051C1DD',
'protocol_version': 1}}
DEBUG:kasa.device:Initializing 192.168.0.163 of type <class 'kasa.smart.smartdevice.SmartDevice'>

@nikhilsharmac
Copy link
Author

$ source .venv/bin/activate
$ python -m devtools.dump_devinfo --username --password --host

these two commands did not work.
image

@ZeliardM
Copy link
Owner

ZeliardM commented Nov 22, 2024

@nikhilsharmac Ok, let's try the following from the Web UI:
cd kasa-python
source .venv/bin/activate
kasa --json --username "user" --password "pass" --debug discover

Did you put the username and password in quotes last time or just plain?

I don't think the other commands will work in Windows, I think it has to be a Linux machine, Ubuntu or Debian

@nikhilsharmac
Copy link
Author

nikhilsharmac commented Nov 22, 2024

Just plain. entering the one you sent above rn, i put them in quotes next time

That command is producing a very long output that it won't let me scroll up all the way

@nikhilsharmac
Copy link
Author

We can setup a team viewer session if that would help debugging this issue better.

@ZeliardM
Copy link
Owner

I can't right now but I have time tomorrow.

@nikhilsharmac
Copy link
Author

Okay, I really appreciate your help, let me know when at your earliest convenience.

@ZeliardM
Copy link
Owner

@nikhilsharmac do you have discord? We could communicate there quicker for trying to get this issue resolved during a remote connection.

@nikhilsharmac
Copy link
Author

@ZeliardM
Copy link
Owner

I've submitted an issue and pull request to the python-kasa library for the issues we're still having with the last three devices.

I'll update you once I know more.

@ZeliardM
Copy link
Owner

@nikhilsharmac can you clear your Homebridge log and restart Homebridge?

I'd like to get a clean log of the plug-in for the issue with the library. When getting the log, open the plug-in logs, let it finish discovering devices, then close the plug-in logs, then open them again and download.

@ZeliardM
Copy link
Owner

@nikhilsharmac going to make the changes from our discussion earlier and update the issue here once I have something to test. Thanks!

@ZeliardM
Copy link
Owner

@nikhilsharmac v2.6.0 is out now, please let me know if all 10 devices are found now.

@nikhilsharmac
Copy link
Author

Updated it. Those three are still missing from HomeKit app and homebridge ui

@ZeliardM
Copy link
Owner

ZeliardM commented Nov 24, 2024

@nikhilsharmac Can you post a log after restarting?

@nikhilsharmac
Copy link
Author

@ZeliardM
Copy link
Owner

@nikhilsharmac Ok, it's an issue with the deviceId on my end, it finds and connects correctly now though. Just doesn't populate yet. I'll push another update later today.

@ZeliardM
Copy link
Owner

@nikhilsharmac please give v2.6.2 a shot and see if you can control access the device and control it in Homebridge and Home App and in the Kasa/Tapo App.

@ZeliardM
Copy link
Owner

Try v2.6.3 and let me know.

@ZeliardM
Copy link
Owner

Give v2.6.8 a shot and if you're good, close out the issue please.

@nikhilsharmac
Copy link
Author

All devices are working now with the new update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants