question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

I had to manually enter the HS103 switch type

See original GitHub issue

Expected Behavior

Using the minimalist config, the plugin should find all the devices on the network.

Current Behavior

When using the minimal config, the plugin crashes when it finds an HS103 (US) plug.

Steps to Reproduce (for bugs)

After a fresh install, use the minimal config for the plugin with an HS103 plug on the network and it will crash. Simply add "switchModels" : "HS103" to get it to work

Versions

  • Node: v10.15.2
  • Homebridge: v0.4.50
  • OS: Linux homebridge 4.19.0-6-686-pae #1 SMP Debian 4.19.67-2+deb10u2 (2019-11-11) i686 GNU/Linux (running in VMware Fusion)
  • homebridge-tplink-smarthome: v5.0.0

Configuration

To get it to work, I used this:

  "platforms": [
    {
      "platform" : "TplinkSmarthome",
      "name" : "TplinkSmarthome",
      "switchModels" : "HS103"
    }

If I just use the minimal config below, it doesn’t work

  "platforms": [
    {
      "platform" : "TplinkSmarthome",
      "name" : "TplinkSmarthome",
    }

Homebridge Log / Command Output

jake@homebridge:~/.homebridge$ homebridge --debug
[1/9/2020, 4:20:45 PM] Loaded config.json with 0 accessories and 1 platforms.
[1/9/2020, 4:20:45 PM] Loaded plugin: homebridge-tplink-smarthome
[1/9/2020, 4:20:45 PM] Registering platform 'homebridge-tplink-smarthome.TplinkSmarthome'
[1/9/2020, 4:20:45 PM] Loading 1 platforms...
[1/9/2020, 4:20:45 PM] [TplinkSmarthome] Initializing TplinkSmarthome platform...
[1/9/2020, 4:20:45 PM] [TplinkSmarthome] homebridge-tplink-smarthome v5.0.0, node v10.15.2, homebridge v0.4.50
[1/9/2020, 4:20:45 PM] [TplinkSmarthome] config.json: {"platform":"TplinkSmarthome","name":"TplinkSmarthome"}
[1/9/2020, 4:20:45 PM] [TplinkSmarthome] config: {"platform":"TplinkSmarthome","name":"TplinkSmarthome","addCustomCharacteristics":true,"deviceTypes":[],"switchModels":["HS200","HS210"],"discoveryOptions":{"discoveryInterval":10000,"deviceTypes":[],"deviceOptions":{"defaultSendOptions":{"timeout":15000}},"macAddresses":[],"excludeMacAddresses":[]},"defaultSendOptions":{"timeout":15000}}

[1/9/2020, 4:20:45 PM] [TplinkSmarthome] didFinishLaunching
[1/9/2020, 4:20:45 PM] [TplinkSmarthome.API] client.startDiscovery({"discoveryInterval":10000,"deviceTypes":[],"deviceOptions":{"defaultSendOptions":{"timeout":15000}},"macAddresses":[],"excludeMacAddresses":[]})
[1/9/2020, 4:20:45 PM] Homebridge is running on port 51826.
[1/9/2020, 4:20:45 PM] [TplinkSmarthome.API] client.socket: UDP IPv4 listening on 0.0.0.0:36904
[1/9/2020, 4:20:45 PM] [TplinkSmarthome.API] client.sendDiscovery(255.255.255.255, [], 3)
[1/9/2020, 4:20:45 PM] [TplinkSmarthome.API] client.startDiscovery(): socket:message From: 192.168.2.104 9999 Message: {"system":{"get_sysinfo":{"sw_ver":"1.1.2 Build 191113 Rel.095623","hw_ver":"2.1","model":"HS103(US)","deviceId":"80066B251464DC8B17860A551F7140021C1154BA","oemId":"24B27E003E98D053CF8B51CE8086FDA8","hwId":"18967AEED1C89BED1BBC7F62FD06468A","rssi":-42,"longitude_i":-1140786,"latitude_i":509403,"alias":"Plug #1","status":"new","mic_type":"IOT.SMARTPLUGSWITCH","feature":"TIM","mac":"50:D4:F7:EB:52:5B","updating":0,"led_off":0,"relay_state":1,"on_time":839,"active_mode":"none","icon_hash":"","dev_name":"Smart Wi-Fi Plug Lite","next_action":{"type":-1},"err_code":0}},"emeter":{"err_code":-1,"err_msg":"module not support"},"smartlife.iot.common.emeter":{"err_code":-1,"err_msg":"module not support"}}
[1/9/2020, 4:20:45 PM] [TplinkSmarthome.API] device.constructor({"defaultSendOptions":{"timeout":15000},"client":"not shown","host":"192.168.2.104","port":9999,"sysInfo":{"sw_ver":"1.1.2 Build 191113 Rel.095623","hw_ver":"2.1","model":"HS103(US)","deviceId":"80066B251464DC8B17860A551F7140021C1154BA","oemId":"24B27E003E98D053CF8B51CE8086FDA8","hwId":"18967AEED1C89BED1BBC7F62FD06468A","rssi":-42,"longitude_i":-1140786,"latitude_i":509403,"alias":"Plug #1","status":"new","mic_type":"IOT.SMARTPLUGSWITCH","feature":"TIM","mac":"50:D4:F7:EB:52:5B","updating":0,"led_off":0,"relay_state":1,"on_time":839,"active_mode":"none","icon_hash":"","dev_name":"Smart Wi-Fi Plug Lite","next_action":{"type":-1},"err_code":0}})
[1/9/2020, 4:20:45 PM] [TplinkSmarthome.API] plug.constructor()
[1/9/2020, 4:20:45 PM] [TplinkSmarthome.API] [Plug #1] device sysInfo set
[1/9/2020, 4:20:45 PM] [TplinkSmarthome.API] [Plug #1] plug sysInfo set
[1/9/2020, 4:20:45 PM] [TplinkSmarthome] New Device Online: [Plug #1] plug [80066B251464DC8B17860A551F7140021C1154BA] 192.168.2.104 9999
[1/9/2020, 4:20:45 PM] [TplinkSmarthome] Adding: [Plug #1] plug [80066B251464DC8B17860A551F7140021C1154BA]
[1/9/2020, 4:20:45 PM] [TplinkSmarthome] [Plug #1] Existing Accessory found [80066B251464DC8B17860A551F7140021C1154BA] [2b30bbe5-bb4d-42f4-8d9b-a8cdc676cbc8] category: OUTLET
[1/9/2020, 4:20:45 PM] [TplinkSmarthome] [Plug #1] getCharacteristicProps Name
[1/9/2020, 4:20:45 PM] [TplinkSmarthome] [Plug #1] setCharacteristicUpdateCallback [Name] 
[1/9/2020, 4:20:45 PM] [TplinkSmarthome] [Plug #1] getCharacteristicProps On
[1/9/2020, 4:20:45 PM] [TplinkSmarthome] [Plug #1] setCharacteristicUpdateCallback [On] 
[1/9/2020, 4:20:45 PM] [TplinkSmarthome] [Plug #1] getCharacteristicProps OutletInUse
[1/9/2020, 4:20:45 PM] [TplinkSmarthome] [Plug #1] setCharacteristicUpdateCallback [OutletInUse] 
[1/9/2020, 4:20:45 PM] TypeError: Cannot read property 'UUID' of undefined
    at HomeKitDevicePlug.getCharacteristic (/usr/local/lib/node_modules/homebridge-tplink-smarthome/lib/homekit-device/index.js:75:48)
    at HomeKitDevicePlug.supportsCharacteristic (/usr/local/lib/node_modules/homebridge-tplink-smarthome/lib/homekit-device/index.js:58:17)
    at characteristics.forEach.characteristic (/usr/local/lib/node_modules/homebridge-tplink-smarthome/lib/tplink-accessory.js:181:25)
    at Array.forEach (<anonymous>)
    at TplinkAccessory.setupCharacteristics (/usr/local/lib/node_modules/homebridge-tplink-smarthome/lib/tplink-accessory.js:180:21)
    at new TplinkAccessory (/usr/local/lib/node_modules/homebridge-tplink-smarthome/lib/tplink-accessory.js:110:12)
    at createTplinkAccessory (/usr/local/lib/node_modules/homebridge-tplink-smarthome/lib/platform.js:74:10)
    at TplinkSmarthomePlatform.addAccessory (/usr/local/lib/node_modules/homebridge-tplink-smarthome/lib/platform.js:252:23)
    at Client.TplinkSmarthomePlatform.client.on.device (/usr/local/lib/node_modules/homebridge-tplink-smarthome/lib/platform.js:132:12)
    at Client.emit (events.js:189:13)
[1/9/2020, 4:20:45 PM] Got SIGTERM, shutting down Homebridge...
[1/9/2020, 4:20:45 PM] [TplinkSmarthome] shutdown

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
Vampiercommented, Jan 10, 2020

First of all thanks for this great plugin. As above I had to add all the devices into the JSON file for homebridge to work again. “switchModels” : [“HS200”,“HS210”,“HS220”,“HS103”,“HS105”] it seems that it cannot detect the models itself and it will adjust to the switch instead of outlet description once it finds these.

[Front] Correcting Accessory Category from: OUTLET to: SWITCH [Front] Removing stale Service: [Outlet] uuid:[00000047-0000-1000-8000-xxxxxxxxxxxxxxx1] subtype:[]

0reactions
plasticrakecommented, Oct 13, 2020

A little hard to follow exactly what’s going on. First the config option takes an array ["HS200"], not a string "HS200". So when its set to a string I think its not making ANYTHING a switch. Also I see setting all your outlets to switches seems to fix it for you. The difference between a switch and an outlet is mostly that an outlet has an additional characteristic of OutletInUse. I assume the issue is that the device was originally created with that characteristic missing, and when it is then configured to be an Outlet is causes a problem.

I just released a complete rewrite of this plugin. Please try v5.2.0 and let me know if this has been fixed. If not I can probably find a fix.

Read more comments on GitHub >

github_iconTop Results From Across the Web

User Guide - Kasa Smart Wi-Fi Plug Mini HS103 - TP-Link
Open the Kasa Smart app and log in with your TP-Link ID. If you don't have an account, create one first. 3. Add...
Read more >
tp-link HS103 Kasa Smart Wi-Fi Plug Mini User Guide
Open the Kasa Smart app and log in with your TP-Link ID. If you don't have an account, create one first. Log in...
Read more >
Kasa Wi-Fi Smart Plug Mini Installation
What should I do when I can't turn devices on or off using Kasa? ... Factory reset the Kasa Wi-Fi Smart Plug Mini...
Read more >
Help with connecting to Kasa TP-Link Wi-Fi Plug - Configuration
I have HA running on rPI 4B and trying to add this Kasa device to be ... Switch -> TP-Link Kasa Smart ->...
Read more >
Kasa Smart Wi-Fi Plug Mini
(HS103). 12ffb4dc5519ae56ab5cd4cf3f80f4d28ed433e2,hs103p2,setup-images,01-2pack ... Turn your smart plug on and off, set schedules or scenes from anywhere ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found