plasticrake / homebridge-tplink-smarthome

TP-Link Smarthome Plugin for Homebridge
MIT License
470 stars 69 forks source link

Able to see status of devices (on/off), but I can't turn them on: `Error: connect ECONNREFUSED` #250

Open mven opened 2 years ago

mven commented 2 years ago

Is there an existing issue for this?

What happened?

I'm running into an issue where I can see the statuses of my devices on the iOS Home app, but I can't toggle them. I've a mix of Kasa devices, but mostly KL125. I've tried rolling back to v6 of the plugin, but I'm still experiencing the issue.

What, if anything, has recently changed?

Nothing in terms of the devices (maybe firmware updates happened OTA). I've kept homebridge up to date and it's plugins.

Homebridge info:

System Information
Timezone    GMT-0800
OS  Alpine Linux (3.12.9)
Hostname    homebridge
IPv4 (eth0)     192.168.1.35
Node.js Version v16.14.0
Npm Version v8.3.1
User    root
Storage Path    /homebridge
Config Path /homebridge/config.json
Plugin Path /homebridge/node_modules

Plugins:

Version

7.0.1

Node Version

v16.14.0

Homebridge Version

1.4.0

Which OS/Platform?

Docker (Linux)

Relevant log output

Loading logs using native method...
File: /homebridge/homebridge.log

alias":"Office Desk Lamp","status":"new","description":"Smart Wi-Fi LED Bulb with Color Changing","mic_type":"IOT.SMARTBULB","mic_mac":"E848B8554F38","dev_state":"normal","is_factory":false,"disco_ver":"1.0","ctrl_protocols":{"name":"Linkie","version":"1.0"},"active_mode":"schedule","is_dimmable":1,"is_color":1,"is_variable_color_temp":1,"light_state":{"on_off":1,"mode":"normal","hue":0,"saturation":0,"color_temp":2700,"brightness":100},"preferred_state":[{"index":0,"hue":0,"saturation":0,"color_temp":2700,"brightness":50},{"index":1,"hue":0,"saturation":100,"color_temp":0,"brightness":100},{"index":2,"hue":120,"saturation":100,"color_temp":0,"brightness":100},{"index":3,"hue":240,"saturation":100,"color_temp":0,"brightness":100}],"err_code":0},"host":"192.168.1.116","port":62968,"defaultSendOptions":{"timeout":15000}})
[2/12/2022, 10:14:21 AM] [TplinkSmarthome.API] [Office Desk Lamp] device sysInfo set
[2/12/2022, 10:14:21 AM] [TplinkSmarthome] Device First Online: [Office Desk Lamp] bulb [8012213D83E6F211EEFAC9EE4D6732C21E556C81] 192.168.1.116 62968
[2/12/2022, 10:14:21 AM] [TplinkSmarthome] Adding: [Office Desk Lamp] bulb [8012213D83E6F211EEFAC9EE4D6732C21E556C81]
[2/12/2022, 10:14:21 AM] [TplinkSmarthome] [Office Desk Lamp] Existing Accessory found [8012213D83E6F211EEFAC9EE4D6732C21E556C81] [2b4fc73f-ad68-46e3-8c26-9816bbe599d8] category: LIGHTBULB
[2/12/2022, 10:14:21 AM] [TplinkSmarthome] [Office Desk Lamp] getCharacteristicProps [Name]
[2/12/2022, 10:14:21 AM] [TplinkSmarthome] [Office Desk Lamp] setCharacteristicUpdateCallback [Name] 
[2/12/2022, 10:14:21 AM] [TplinkSmarthome] [Office Desk Lamp] getCharacteristicProps [On]
[2/12/2022, 10:14:21 AM] [TplinkSmarthome] [Office Desk Lamp] setCharacteristicUpdateCallback [On] 
[2/12/2022, 10:14:21 AM] [TplinkSmarthome] [Office Desk Lamp] getCharacteristicProps [Brightness]
[2/12/2022, 10:14:21 AM] [TplinkSmarthome] [Office Desk Lamp] setCharacteristicUpdateCallback [Brightness] 
[2/12/2022, 10:14:21 AM] [TplinkSmarthome] [Office Desk Lamp] getCharacteristicProps [Color Temperature]
[2/12/2022, 10:14:21 AM] [TplinkSmarthome] [Office Desk Lamp] setCharacteristicUpdateCallback [Color Temperature] 
[2/12/2022, 10:14:21 AM] [TplinkSmarthome] [Office Desk Lamp] getCharacteristicProps [Hue]
[2/12/2022, 10:14:21 AM] [TplinkSmarthome] [Office Desk Lamp] setCharacteristicUpdateCallback [Hue] 
[2/12/2022, 10:14:21 AM] [TplinkSmarthome] [Office Desk Lamp] getCharacteristicProps [Saturation]
[2/12/2022, 10:14:21 AM] [TplinkSmarthome] [Office Desk Lamp] setCharacteristicUpdateCallback [Saturation] 
[2/12/2022, 10:14:21 AM] [TplinkSmarthome] [Office Desk Lamp] getCharacteristicProps [Consumption]
[2/12/2022, 10:14:21 AM] [TplinkSmarthome] [Office Desk Lamp] setCharacteristicUpdateCallback [Consumption] 
[2/12/2022, 10:14:21 AM] [TplinkSmarthome.API] client.startDiscovery(): socket:message From: 192.168.1.195 25289 Message: {"system":{"get_sysinfo":{"sw_ver":"1.0.7 Build 211009 Rel.172044","hw_ver":"1.20","model":"KL125(US)","deviceId":"801271A9E8A2734DD542E942AC0352CC1DA4E819","oemId":"E260847F622C8C11C5CD258C3D0BA048","hwId":"B4AA8A24294C772C6D70D0AFB805FF38","rssi":-48,"latitude_i":360843,"longitude_i":-1153258,"alias":"Living Room floor lamp","status":"new","description":"Smart Wi-Fi LED Bulb with Color Changing","mic_type":"IOT.SMARTBULB","mic_mac":"E4C32A824850","dev_state":"normal","is_factory":false,"disco_ver":"1.0","ctrl_protocols":{"name":"Linkie","version":"1.0"},"active_mode":"schedule","is_dimmable":1,"is_color":1,"is_variable_color_temp":1,"light_state":{"on_off":0,"dft_on_state":{"mode":"normal","hue":0,"saturation":0,"color_temp":2700,"brightness":75}},"preferred_state":[{"index":0,"hue":0,"saturation":0,"color_temp":2700,"brightness":75},{"index":1,"hue":0,"saturation":100,"color_temp":0,"brightness":100},{"index":2,"hue":120,"saturation":100,"color_temp":0,"brightness":100},{"index":3,"hue":240,"saturation":100,"color_temp":0,"brightness":100}],"err_code":0}}}
[2/12/2022, 10:14:21 AM] [TplinkSmarthome.API] device.constructor({"client":"not shown","_sysInfo":{"sw_ver":"1.0.7 Build 211009 Rel.172044","hw_ver":"1.20","model":"KL125(US)","deviceId":"801271A9E8A2734DD542E942AC0352CC1DA4E819","oemId":"E260847F622C8C11C5CD258C3D0BA048","hwId":"B4AA8A24294C772C6D70D0AFB805FF38","rssi":-48,"latitude_i":360843,"longitude_i":-1153258,"alias":"Living Room floor lamp","status":"new","description":"Smart Wi-Fi LED Bulb with Color Changing","mic_type":"IOT.SMARTBULB","mic_mac":"E4C32A824850","dev_state":"normal","is_factory":false,"disco_ver":"1.0","ctrl_protocols":{"name":"Linkie","version":"1.0"},"active_mode":"schedule","is_dimmable":1,"is_color":1,"is_variable_color_temp":1,"light_state":{"on_off":0,"dft_on_state":{"mode":"normal","hue":0,"saturation":0,"color_temp":2700,"brightness":75}},"preferred_state":[{"index":0,"hue":0,"saturation":0,"color_temp":2700,"brightness":75},{"index":1,"hue":0,"saturation":100,"color_temp":0,"brightness":100},{"index":2,"hue":120,"saturation":100,"color_temp":0,"brightness":100},{"index":3,"hue":240,"saturation":100,"color_temp":0,"brightness":100}],"err_code":0},"host":"192.168.1.195","port":25289,"defaultSendOptions":{"timeout":15000}})
[2/12/2022, 10:14:21 AM] [TplinkSmarthome.API] [Living Room floor lamp] device sysInfo set
[2/12/2022, 10:14:21 AM] [TplinkSmarthome] Device First Online: [Living Room floor lamp] bulb [801271A9E8A2734DD542E942AC0352CC1DA4E819] 192.168.1.195 25289
[2/12/2022, 10:14:21 AM] [TplinkSmarthome] Adding: [Living Room floor lamp] bulb [801271A9E8A2734DD542E942AC0352CC1DA4E819]
[2/12/2022, 10:14:21 AM] [TplinkSmarthome] [Living Room floor lamp] Existing Accessory found [801271A9E8A2734DD542E942AC0352CC1DA4E819] [9165f9ab-be24-44da-ba4a-572e83f7dcac] category: LIGHTBULB
[2/12/2022, 10:14:21 AM] [TplinkSmarthome] [Living Room floor lamp] getCharacteristicProps [Name]
[2/12/2022, 10:14:21 AM] [TplinkSmarthome] [Living Room floor lamp] setCharacteristicUpdateCallback [Name] 
[2/12/2022, 10:14:21 AM] [TplinkSmarthome] [Living Room floor lamp] getCharacteristicProps [On]
[2/12/2022, 10:14:21 AM] [TplinkSmarthome] [Living Room floor lamp] setCharacteristicUpdateCallback [On] 
[2/12/2022, 10:14:21 AM] [TplinkSmarthome] [Living Room floor lamp] getCharacteristicProps [Brightness]
[2/12/2022, 10:14:21 AM] [TplinkSmarthome] [Living Room floor lamp] setCharacteristicUpdateCallback [Brightness] 
[2/12/2022, 10:14:21 AM] [TplinkSmarthome] [Living Room floor lamp] getCharacteristicProps [Color Temperature]
[2/12/2022, 10:14:21 AM] [TplinkSmarthome] [Living Room floor lamp] setCharacteristicUpdateCallback [Color Temperature] 
[2/12/2022, 10:14:21 AM] [TplinkSmarthome] [Living Room floor lamp] getCharacteristicProps [Hue]
[2/12/2022, 10:14:21 AM] [TplinkSmarthome] [Living Room floor lamp] setCharacteristicUpdateCallback [Hue] 
[2/12/2022, 10:14:21 AM] [TplinkSmarthome] [Living Room floor lamp] getCharacteristicProps [Saturation]
[2/12/2022, 10:14:21 AM] [TplinkSmarthome] [Living Room floor lamp] setCharacteristicUpdateCallback [Saturation] 
[2/12/2022, 10:14:21 AM] [TplinkSmarthome] [Living Room floor lamp] getCharacteristicProps [Consumption]
[2/12/2022, 10:14:21 AM] [TplinkSmarthome] [Living Room floor lamp] setCharacteristicUpdateCallback [Consumption] 
[2/12/2022, 10:14:21 AM] [TplinkSmarthome.API] client.startDiscovery(): socket:message From: 192.168.1.202 21005 Message: {"system":{"get_sysinfo":{"sw_ver":"1.0.4 Build 210705 Rel.190840","hw_ver":"1.0","model":"KP405(US)","deviceId":"80066DBA128692EACBC1D1E262E01B6C1EE7ECFD","oemId":"E9165433D6D94C1965BE3679A3229F2A","hwId":"5EFDF205FE8736717A16344F608DD9E4","rssi":-40,"latitude_i":360843,"longitude_i":-1153258,"alias":"String lights outlet","status":"new","mic_type":"IOT.SMARTPLUGSWITCH","feature":"TIM","mac":"10:27:F5:9C:7E:82","updating":0,"led_off":0,"relay_state":0,"brightness":75,"on_time":0,"icon_hash":"","dev_name":"Kasa Smart Wi-Fi Outdoor Plug-In Dimmer","active_mode":"schedule","next_action":{"type":1,"id":"00E1310510E7323013E728B313E46929","schd_time":59400,"action":3,"dimmer":{"on_off":1,"brightness":75,"transition_period":1000}},"preferred_state":[{"index":0,"brightness":100},{"index":1,"brightness":75},{"index":2,"brightness":50},{"index":3,"brightness":25}],"ntc_state":0,"err_code":0}}}
[2/12/2022, 10:14:21 AM] [TplinkSmarthome.API] device.constructor({"client":"not shown","_sysInfo":{"sw_ver":"1.0.4 Build 210705 Rel.190840","hw_ver":"1.0","model":"KP405(US)","deviceId":"80066DBA128692EACBC1D1E262E01B6C1EE7ECFD","oemId":"E9165433D6D94C1965BE3679A3229F2A","hwId":"5EFDF205FE8736717A16344F608DD9E4","rssi":-40,"latitude_i":360843,"longitude_i":-1153258,"alias":"String lights outlet","status":"new","mic_type":"IOT.SMARTPLUGSWITCH","feature":"TIM","mac":"10:27:F5:9C:7E:82","updating":0,"led_off":0,"relay_state":0,"brightness":75,"on_time":0,"icon_hash":"","dev_name":"Kasa Smart Wi-Fi Outdoor Plug-In Dimmer","active_mode":"schedule","next_action":{"type":1,"id":"00E1310510E7323013E728B313E46929","schd_time":59400,"action":3,"dimmer":{"on_off":1,"brightness":75,"transition_period":1000}},"preferred_state":[{"index":0,"brightness":100},{"index":1,"brightness":75},{"index":2,"brightness":50},{"index":3,"brightness":25}],"ntc_state":0,"err_code":0},"host":"192.168.1.202","port":21005,"defaultSendOptions":{"timeout":15000}})
[2/12/2022, 10:14:21 AM] [TplinkSmarthome.API] plug.constructor()
[2/12/2022, 10:14:21 AM] [TplinkSmarthome.API] [String lights outlet] device sysInfo set
[2/12/2022, 10:14:21 AM] [TplinkSmarthome.API] [String lights outlet] plug.dimmer brightness set
[2/12/2022, 10:14:21 AM] [TplinkSmarthome.API] [String lights outlet] plug.dimmer.emitEvents() brightness: 75 lastState: {"brightness":-1}
[2/12/2022, 10:14:21 AM] [TplinkSmarthome.API] [String lights outlet] plug sysInfo set
[2/12/2022, 10:14:21 AM] [TplinkSmarthome.API] [String lights outlet] plug.emitEvents() inUse: false relayState: false lastState: {"inUse":false,"relayState":false}
[2/12/2022, 10:14:21 AM] [TplinkSmarthome.API] [String lights outlet] plug.dimmer.emitEvents() brightness: 75 lastState: {"brightness":75}
[2/12/2022, 10:14:21 AM] [TplinkSmarthome] Device First Online: [String lights outlet] plug [80066DBA128692EACBC1D1E262E01B6C1EE7ECFD] 192.168.1.202 21005
[2/12/2022, 10:14:21 AM] [TplinkSmarthome] Adding: [String lights outlet] plug [80066DBA128692EACBC1D1E262E01B6C1EE7ECFD]
[2/12/2022, 10:14:21 AM] [TplinkSmarthome] [String lights outlet] Existing Accessory found [80066DBA128692EACBC1D1E262E01B6C1EE7ECFD] [cca6b083-d6be-40f1-b025-6c5c7010a852] category: LIGHTBULB
[2/12/2022, 10:14:21 AM] [TplinkSmarthome] [String lights outlet] getCharacteristicProps [Name]
[2/12/2022, 10:14:21 AM] [TplinkSmarthome] [String lights outlet] setCharacteristicUpdateCallback [Name] 
[2/12/2022, 10:14:21 AM] [TplinkSmarthome] [String lights outlet] getCharacteristicProps [On]
[2/12/2022, 10:14:21 AM] [TplinkSmarthome] [String lights outlet] setCharacteristicUpdateCallback [On] 
[2/12/2022, 10:14:21 AM] [TplinkSmarthome] [String lights outlet] getCharacteristicProps [Brightness]
[2/12/2022, 10:14:21 AM] [TplinkSmarthome] [String lights outlet] setCharacteristicUpdateCallback [Brightness] 
[2/12/2022, 10:14:21 AM] [TplinkSmarthome.API] client.startDiscovery(): socket:message From: 192.168.1.197 10944 Message: {"system":{"get_sysinfo":{"sw_ver":"1.0.7 Build 211009 Rel.172044","hw_ver":"1.20","model":"KL125(US)","deviceId":"80123AAB28A92212C85CF43FF387621C1DA305E4","oemId":"E260847F622C8C11C5CD258C3D0BA048","hwId":"B4AA8A24294C772C6D70D0AFB805FF38","rssi":-50,"latitude_i":360843,"longitude_i":-1153258,"alias":"Master Bedroom Table Lamp","status":"new","description":"Smart Wi-Fi LED Bulb with Color Changing","mic_type":"IOT.SMARTBULB","mic_mac":"E4C32A822D38","dev_state":"normal","is_factory":false,"disco_ver":"1.0","ctrl_protocols":{"name":"Linkie","version":"1.0"},"active_mode":"none","is_dimmable":1,"is_color":1,"is_variable_color_temp":1,"light_state":{"on_off":0,"dft_on_state":{"mode":"normal","hue":0,"saturation":0,"color_temp":2700,"brightness":17}},"preferred_state":[{"index":0,"hue":0,"saturation":0,"color_temp":2700,"brightness":50},{"index":1,"hue":0,"saturation":100,"color_temp":0,"brightness":100},{"index":2,"hue":120,"saturation":100,"color_temp":0,"brightness":100},{"index":3,"hue":240,"saturation":100,"color_temp":0,"brightness":100}],"err_code":0}}}
[2/12/2022, 10:14:21 AM] [TplinkSmarthome.API] device.constructor({"client":"not shown","_sysInfo":{"sw_ver":"1.0.7 Build 211009 Rel.172044","hw_ver":"1.20","model":"KL125(US)","deviceId":"80123AAB28A92212C85CF43FF387621C1DA305E4","oemId":"E260847F622C8C11C5CD258C3D0BA048","hwId":"B4AA8A24294C772C6D70D0AFB805FF38","rssi":-50,"latitude_i":360843,"longitude_i":-1153258,"alias":"Master Bedroom Table Lamp","status":"new","description":"Smart Wi-Fi LED Bulb with Color Changing","mic_type":"IOT.SMARTBULB","mic_mac":"E4C32A822D38","dev_state":"normal","is_factory":false,"disco_ver":"1.0","ctrl_protocols":{"name":"Linkie","version":"1.0"},"active_mode":"none","is_dimmable":1,"is_color":1,"is_variable_color_temp":1,"light_state":{"on_off":0,"dft_on_state":{"mode":"normal","hue":0,"saturation":0,"color_temp":2700,"brightness":17}},"preferred_state":[{"index":0,"hue":0,"saturation":0,"color_temp":2700,"brightness":50},{"index":1,"hue":0,"saturation":100,"color_temp":0,"brightness":100},{"index":2,"hue":120,"saturation":100,"color_temp":0,"brightness":100},{"index":3,"hue":240,"saturation":100,"color_temp":0,"brightness":100}],"err_code":0},"host":"192.168.1.197","port":10944,"defaultSendOptions":{"timeout":15000}})
[2/12/2022, 10:14:21 AM] [TplinkSmarthome.API] [Master Bedroom Table Lamp] device sysInfo set
[2/12/2022, 10:14:21 AM] [TplinkSmarthome] Device First Online: [Master Bedroom Table Lamp] bulb [80123AAB28A92212C85CF43FF387621C1DA305E4] 192.168.1.197 10944
[2/12/2022, 10:14:21 AM] [TplinkSmarthome] Adding: [Master Bedroom Table Lamp] bulb [80123AAB28A92212C85CF43FF387621C1DA305E4]
[2/12/2022, 10:14:21 AM] [TplinkSmarthome] [Master Bedroom Table Lamp] Existing Accessory found [80123AAB28A92212C85CF43FF387621C1DA305E4] [3e6b200f-40c5-49ce-9631-7a25a1e5a99f] category: LIGHTBULB
[2/12/2022, 10:14:21 AM] [TplinkSmarthome] [Master Bedroom Table Lamp] getCharacteristicProps [Name]
[2/12/2022, 10:14:21 AM] [TplinkSmarthome] [Master Bedroom Table Lamp] setCharacteristicUpdateCallback [Name] 
[2/12/2022, 10:14:21 AM] [TplinkSmarthome] [Master Bedroom Table Lamp] getCharacteristicProps [On]
[2/12/2022, 10:14:21 AM] [TplinkSmarthome] [Master Bedroom Table Lamp] setCharacteristicUpdateCallback [On] 
[2/12/2022, 10:14:21 AM] [TplinkSmarthome] [Master Bedroom Table Lamp] getCharacteristicProps [Brightness]
[2/12/2022, 10:14:21 AM] [TplinkSmarthome] [Master Bedroom Table Lamp] setCharacteristicUpdateCallback [Brightness] 
[2/12/2022, 10:14:21 AM] [TplinkSmarthome] [Master Bedroom Table Lamp] getCharacteristicProps [Color Temperature]
[2/12/2022, 10:14:21 AM] [TplinkSmarthome] [Master Bedroom Table Lamp] setCharacteristicUpdateCallback [Color Temperature] 
[2/12/2022, 10:14:21 AM] [TplinkSmarthome] [Master Bedroom Table Lamp] getCharacteristicProps [Hue]
[2/12/2022, 10:14:21 AM] [TplinkSmarthome] [Master Bedroom Table Lamp] setCharacteristicUpdateCallback [Hue] 
[2/12/2022, 10:14:21 AM] [TplinkSmarthome] [Master Bedroom Table Lamp] getCharacteristicProps [Saturation]
[2/12/2022, 10:14:21 AM] [TplinkSmarthome] [Master Bedroom Table Lamp] setCharacteristicUpdateCallback [Saturation] 
[2/12/2022, 10:14:21 AM] [TplinkSmarthome] [Master Bedroom Table Lamp] getCharacteristicProps [Consumption]
[2/12/2022, 10:14:21 AM] [TplinkSmarthome] [Master Bedroom Table Lamp] setCharacteristicUpdateCallback [Consumption] 
[2/12/2022, 10:14:22 AM] [TplinkSmarthome] [String lights outlet] get [Name]
[2/12/2022, 10:14:22 AM] [TplinkSmarthome] [String lights outlet] getCharacteristicValue [Name]
[2/12/2022, 10:14:22 AM] [TplinkSmarthome] [String lights outlet] get [On]
[2/12/2022, 10:14:22 AM] [TplinkSmarthome] [String lights outlet] getCharacteristicValue [On]
[2/12/2022, 10:14:22 AM] [TplinkSmarthome] [String lights outlet] get [Brightness]
[2/12/2022, 10:14:22 AM] [TplinkSmarthome] [String lights outlet] getCharacteristicValue [Brightness]
[2/12/2022, 10:14:22 AM] [TplinkSmarthome] [Office Desk Lamp] get [Name]
[2/12/2022, 10:14:22 AM] [TplinkSmarthome] [Office Desk Lamp] getCharacteristicValue [Name]
[2/12/2022, 10:14:22 AM] [TplinkSmarthome] [Office Desk Lamp] get [On]
[2/12/2022, 10:14:22 AM] [TplinkSmarthome] [Office Desk Lamp] getCharacteristicValue [On]
[2/12/2022, 10:14:22 AM] [TplinkSmarthome] [Office Desk Lamp] get [Brightness]
[2/12/2022, 10:14:22 AM] [TplinkSmarthome] [Office Desk Lamp] getCharacteristicValue [Brightness]
[2/12/2022, 10:14:22 AM] [TplinkSmarthome] [Office Desk Lamp] get [Color Temperature]
[2/12/2022, 10:14:22 AM] [TplinkSmarthome] [Office Desk Lamp] getCharacteristicValue [Color Temperature]
[2/12/2022, 10:14:22 AM] [TplinkSmarthome] [Office Desk Lamp] get [Hue]
[2/12/2022, 10:14:22 AM] [TplinkSmarthome] [Office Desk Lamp] getCharacteristicValue [Hue]
[2/12/2022, 10:14:22 AM] [TplinkSmarthome] [Office Desk Lamp] get [Saturation]
[2/12/2022, 10:14:22 AM] [TplinkSmarthome] [Office Desk Lamp] getCharacteristicValue [Saturation]
[2/12/2022, 10:14:22 AM] [TplinkSmarthome] [Office Desk Lamp] get [Consumption]
[2/12/2022, 10:14:22 AM] [TplinkSmarthome] [Office Desk Lamp] getCharacteristicValue [Consumption]
[2/12/2022, 10:14:22 AM] [TplinkSmarthome] [Office Desk Lamp] getValue: Invalid Watts: undefined
[2/12/2022, 10:14:22 AM] [TplinkSmarthome] [Living Room floor lamp] get [Name]
[2/12/2022, 10:14:22 AM] [TplinkSmarthome] [Living Room floor lamp] getCharacteristicValue [Name]
[2/12/2022, 10:14:22 AM] [TplinkSmarthome] [Living Room floor lamp] get [On]
[2/12/2022, 10:14:22 AM] [TplinkSmarthome] [Living Room floor lamp] getCharacteristicValue [On]
[2/12/2022, 10:14:22 AM] [TplinkSmarthome] [Living Room floor lamp] get [Brightness]
[2/12/2022, 10:14:22 AM] [TplinkSmarthome] [Living Room floor lamp] getCharacteristicValue [Brightness]
[2/12/2022, 10:14:22 AM] [TplinkSmarthome] [Living Room floor lamp] get [Color Temperature]
[2/12/2022, 10:14:22 AM] [TplinkSmarthome] [Living Room floor lamp] getCharacteristicValue [Color Temperature]
[2/12/2022, 10:14:22 AM] [TplinkSmarthome] [Living Room floor lamp] get [Hue]
[2/12/2022, 10:14:22 AM] [TplinkSmarthome] [Living Room floor lamp] getCharacteristicValue [Hue]
[2/12/2022, 10:14:22 AM] [TplinkSmarthome] [Living Room floor lamp] get [Saturation]
[2/12/2022, 10:14:22 AM] [TplinkSmarthome] [Living Room floor lamp] getCharacteristicValue [Saturation]
[2/12/2022, 10:14:22 AM] [TplinkSmarthome] [Living Room floor lamp] get [Consumption]
[2/12/2022, 10:14:22 AM] [TplinkSmarthome] [Living Room floor lamp] getCharacteristicValue [Consumption]
[2/12/2022, 10:14:22 AM] [TplinkSmarthome] [Living Room floor lamp] getValue: Invalid Watts: undefined
[2/12/2022, 10:14:22 AM] [TplinkSmarthome] [Master Bedroom Table Lamp] get [Name]
[2/12/2022, 10:14:22 AM] [TplinkSmarthome] [Master Bedroom Table Lamp] getCharacteristicValue [Name]
[2/12/2022, 10:14:22 AM] [TplinkSmarthome] [Master Bedroom Table Lamp] get [On]
[2/12/2022, 10:14:22 AM] [TplinkSmarthome] [Master Bedroom Table Lamp] getCharacteristicValue [On]
[2/12/2022, 10:14:22 AM] [TplinkSmarthome] [Master Bedroom Table Lamp] get [Brightness]
[2/12/2022, 10:14:22 AM] [TplinkSmarthome] [Master Bedroom Table Lamp] getCharacteristicValue [Brightness]
[2/12/2022, 10:14:22 AM] [TplinkSmarthome] [Master Bedroom Table Lamp] get [Color Temperature]
[2/12/2022, 10:14:22 AM] [TplinkSmarthome] [Master Bedroom Table Lamp] getCharacteristicValue [Color Temperature]
[2/12/2022, 10:14:22 AM] [TplinkSmarthome] [Master Bedroom Table Lamp] get [Hue]
[2/12/2022, 10:14:22 AM] [TplinkSmarthome] [Master Bedroom Table Lamp] getCharacteristicValue [Hue]
[2/12/2022, 10:14:22 AM] [TplinkSmarthome] [Master Bedroom Table Lamp] get [Saturation]
[2/12/2022, 10:14:22 AM] [TplinkSmarthome] [Master Bedroom Table Lamp] getCharacteristicValue [Saturation]
[2/12/2022, 10:14:22 AM] [TplinkSmarthome] [Master Bedroom Table Lamp] get [Consumption]
[2/12/2022, 10:14:22 AM] [TplinkSmarthome] [Master Bedroom Table Lamp] getCharacteristicValue [Consumption]
[2/12/2022, 10:14:22 AM] [TplinkSmarthome] [Master Bedroom Table Lamp] getValue: Invalid Watts: undefined
[2/12/2022, 10:14:22 AM] [TplinkSmarthome] [String lights outlet] executing deferred getSysInfo count: 2
[2/12/2022, 10:14:22 AM] [TplinkSmarthome.API] [String lights outlet] device.getSysInfo()
[2/12/2022, 10:14:22 AM] [TplinkSmarthome.API] [String lights outlet] device.send()
[2/12/2022, 10:14:22 AM] [TplinkSmarthome.API] TplinkConnection(TCP 192.168.1.202:21005).send({"payload":"{\"system\":{\"get_sysinfo\":{}}}","timeout":15000})
[2/12/2022, 10:14:22 AM] [TplinkSmarthome.API] TcpConnection(TCP 192.168.1.202:21005).getSocket()
[2/12/2022, 10:14:22 AM] [TplinkSmarthome.API] [1] TplinkSocket(TCP).createSocket()
[2/12/2022, 10:14:22 AM] [TplinkSmarthome.API] [1] TplinkSocket(TCP).send({"payload":"{\"system\":{\"get_sysinfo\":{}}}","port":21005,"host":"192.168.1.202","timeout":15000})
[2/12/2022, 10:14:22 AM] [TplinkSmarthome.API] [1] TcpSocket: socket:send payload.length 33
[2/12/2022, 10:14:22 AM] [TplinkSmarthome.API] [1] TcpSocket: socket:send attempting to connect. host:192.168.1.202, port:21005
[2/12/2022, 10:14:22 AM] [TplinkSmarthome] [Office Desk Lamp] executing deferred getLightState count: 5
[2/12/2022, 10:14:22 AM] [TplinkSmarthome.API] [Office Desk Lamp] device.getSysInfo()
[2/12/2022, 10:14:22 AM] [TplinkSmarthome.API] [Office Desk Lamp] device.send()
[2/12/2022, 10:14:22 AM] [TplinkSmarthome.API] TplinkConnection(TCP 192.168.1.116:62968).send({"payload":"{\"system\":{\"get_sysinfo\":{}}}","timeout":15000})
[2/12/2022, 10:14:22 AM] [TplinkSmarthome.API] TcpConnection(TCP 192.168.1.116:62968).getSocket()
[2/12/2022, 10:14:22 AM] [TplinkSmarthome.API] [2] TplinkSocket(TCP).createSocket()
[2/12/2022, 10:14:22 AM] [TplinkSmarthome.API] [2] TplinkSocket(TCP).send({"payload":"{\"system\":{\"get_sysinfo\":{}}}","port":62968,"host":"192.168.1.116","timeout":15000})
[2/12/2022, 10:14:22 AM] [TplinkSmarthome.API] [2] TcpSocket: socket:send payload.length 33
[2/12/2022, 10:14:22 AM] [TplinkSmarthome.API] [2] TcpSocket: socket:send attempting to connect. host:192.168.1.116, port:62968
[2/12/2022, 10:14:22 AM] [TplinkSmarthome.API] [Office Desk Lamp] device.send()
[2/12/2022, 10:14:22 AM] [TplinkSmarthome.API] TplinkConnection(TCP 192.168.1.116:62968).send({"payload":"{\"smartlife.iot.common.emeter\":{\"get_realtime\":{}}}","timeout":15000})
[2/12/2022, 10:14:22 AM] [TplinkSmarthome] [Living Room floor lamp] executing deferred getLightState count: 5
[2/12/2022, 10:14:22 AM] [TplinkSmarthome.API] [Living Room floor lamp] device.getSysInfo()
[2/12/2022, 10:14:22 AM] [TplinkSmarthome.API] [Living Room floor lamp] device.send()
[2/12/2022, 10:14:22 AM] [TplinkSmarthome.API] TplinkConnection(TCP 192.168.1.195:25289).send({"payload":"{\"system\":{\"get_sysinfo\":{}}}","timeout":15000})
[2/12/2022, 10:14:22 AM] [TplinkSmarthome.API] TcpConnection(TCP 192.168.1.195:25289).getSocket()
[2/12/2022, 10:14:22 AM] [TplinkSmarthome.API] [3] TplinkSocket(TCP).createSocket()
[2/12/2022, 10:14:22 AM] [TplinkSmarthome.API] [3] TplinkSocket(TCP).send({"payload":"{\"system\":{\"get_sysinfo\":{}}}","port":25289,"host":"192.168.1.195","timeout":15000})
[2/12/2022, 10:14:22 AM] [TplinkSmarthome.API] [3] TcpSocket: socket:send payload.length 33
[2/12/2022, 10:14:22 AM] [TplinkSmarthome.API] [3] TcpSocket: socket:send attempting to connect. host:192.168.1.195, port:25289
[2/12/2022, 10:14:22 AM] [TplinkSmarthome.API] [Living Room floor lamp] device.send()
[2/12/2022, 10:14:22 AM] [TplinkSmarthome.API] TplinkConnection(TCP 192.168.1.195:25289).send({"payload":"{\"smartlife.iot.common.emeter\":{\"get_realtime\":{}}}","timeout":15000})
[2/12/2022, 10:14:22 AM] [TplinkSmarthome] [Master Bedroom Table Lamp] executing deferred getLightState count: 5
[2/12/2022, 10:14:22 AM] [TplinkSmarthome.API] [Master Bedroom Table Lamp] device.getSysInfo()
[2/12/2022, 10:14:22 AM] [TplinkSmarthome.API] [Master Bedroom Table Lamp] device.send()
[2/12/2022, 10:14:22 AM] [TplinkSmarthome.API] TplinkConnection(TCP 192.168.1.197:10944).send({"payload":"{\"system\":{\"get_sysinfo\":{}}}","timeout":15000})
[2/12/2022, 10:14:22 AM] [TplinkSmarthome.API] TcpConnection(TCP 192.168.1.197:10944).getSocket()
[2/12/2022, 10:14:22 AM] [TplinkSmarthome.API] [4] TplinkSocket(TCP).createSocket()
[2/12/2022, 10:14:22 AM] [TplinkSmarthome.API] [4] TplinkSocket(TCP).send({"payload":"{\"system\":{\"get_sysinfo\":{}}}","port":10944,"host":"192.168.1.197","timeout":15000})
[2/12/2022, 10:14:22 AM] [TplinkSmarthome.API] [4] TcpSocket: socket:send payload.length 33
[2/12/2022, 10:14:22 AM] [TplinkSmarthome.API] [4] TcpSocket: socket:send attempting to connect. host:192.168.1.197, port:10944
[2/12/2022, 10:14:22 AM] [TplinkSmarthome.API] [Master Bedroom Table Lamp] device.send()
[2/12/2022, 10:14:22 AM] [TplinkSmarthome.API] TplinkConnection(TCP 192.168.1.197:10944).send({"payload":"{\"smartlife.iot.common.emeter\":{\"get_realtime\":{}}}","timeout":15000})
[2/12/2022, 10:14:22 AM] [TplinkSmarthome.API] [1] TcpSocket: socket:error Error: connect ECONNREFUSED 192.168.1.202:21005
    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1157:16) {
  errno: -111,
  code: 'ECONNREFUSED',
  syscall: 'connect',
  address: '192.168.1.202',
  port: 21005
}
[2/12/2022, 10:14:22 AM] [TplinkSmarthome.API] [1] TcpSocket#destroy(), 
[2/12/2022, 10:14:22 AM] [TplinkSmarthome.API] [1] TplinkSocket(TCP).send() Error: connect ECONNREFUSED 192.168.1.202:21005
    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1157:16) {
  errno: -111,
  code: 'ECONNREFUSED',
  syscall: 'connect',
  address: '192.168.1.202',
  port: 21005
}
[2/12/2022, 10:14:22 AM] [TplinkSmarthome.API] TCP 192.168.1.202:21005 Error: connect ECONNREFUSED 192.168.1.202:21005
    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1157:16) {
  errno: -111,
  code: 'ECONNREFUSED',
  syscall: 'connect',
  address: '192.168.1.202',
  port: 21005
}
[2/12/2022, 10:14:22 AM] [TplinkSmarthome.API] [String lights outlet] device.send() Error: connect ECONNREFUSED 192.168.1.202:21005
    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1157:16) {
  errno: -111,
  code: 'ECONNREFUSED',
  syscall: 'connect',
  address: '192.168.1.202',
  port: 21005
}
[2/12/2022, 10:14:22 AM] [TplinkSmarthome] [String lights outlet] {"errno":-111,"code":"ECONNREFUSED","syscall":"connect","address":"192.168.1.202","port":21005}
[2/12/2022, 10:14:22 AM] [TplinkSmarthome] [String lights outlet] {"errno":-111,"code":"ECONNREFUSED","syscall":"connect","address":"192.168.1.202","port":21005}
[2/12/2022, 10:14:22 AM] [TplinkSmarthome.API] [1] TcpSocket: socket:close, hadError:true
[2/12/2022, 10:14:22 AM] [TplinkSmarthome.API] [1] TcpSocket: socket:close error
[2/12/2022, 10:14:22 AM] [TplinkSmarthome.API] [2] TcpSocket: socket:error Error: connect ECONNREFUSED 192.168.1.116:62968
    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1157:16) {
  errno: -111,
  code: 'ECONNREFUSED',
  syscall: 'connect',
  address: '192.168.1.116',
  port: 62968
}
[2/12/2022, 10:14:22 AM] [TplinkSmarthome.API] [2] TcpSocket#destroy(), 
[2/12/2022, 10:14:22 AM] [TplinkSmarthome.API] [2] TplinkSocket(TCP).send() Error: connect ECONNREFUSED 192.168.1.116:62968
    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1157:16) {
  errno: -111,
  code: 'ECONNREFUSED',
  syscall: 'connect',
  address: '192.168.1.116',
  port: 62968
}
[2/12/2022, 10:14:22 AM] [TplinkSmarthome.API] TCP 192.168.1.116:62968 Error: connect ECONNREFUSED 192.168.1.116:62968
    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1157:16) {
  errno: -111,
  code: 'ECONNREFUSED',
  syscall: 'connect',
  address: '192.168.1.116',
  port: 62968
}
[2/12/2022, 10:14:22 AM] [TplinkSmarthome.API] TcpConnection(TCP 192.168.1.116:62968).getSocket()
[2/12/2022, 10:14:22 AM] [TplinkSmarthome.API] [5] TplinkSocket(TCP).createSocket()
[2/12/2022, 10:14:22 AM] [TplinkSmarthome.API] [Office Desk Lamp] device.send() Error: connect ECONNREFUSED 192.168.1.116:62968
    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1157:16) {
  errno: -111,
  code: 'ECONNREFUSED',
  syscall: 'connect',
  address: '192.168.1.116',
  port: 62968
}
[2/12/2022, 10:14:22 AM] [TplinkSmarthome.API] [5] TplinkSocket(TCP).send({"payload":"{\"smartlife.iot.common.emeter\":{\"get_realtime\":{}}}","port":62968,"host":"192.168.1.116","timeout":15000})
[2/12/2022, 10:14:22 AM] [TplinkSmarthome.API] [5] TcpSocket: socket:send payload.length 55
[2/12/2022, 10:14:22 AM] [TplinkSmarthome.API] [5] TcpSocket: socket:send attempting to connect. host:192.168.1.116, port:62968
[2/12/2022, 10:14:22 AM] [TplinkSmarthome] [Office Desk Lamp] {"errno":-111,"code":"ECONNREFUSED","syscall":"connect","address":"192.168.1.116","port":62968}
[2/12/2022, 10:14:22 AM] [TplinkSmarthome] [Office Desk Lamp] {"errno":-111,"code":"ECONNREFUSED","syscall":"connect","address":"192.168.1.116","port":62968}
[2/12/2022, 10:14:22 AM] [TplinkSmarthome] [Office Desk Lamp] {"errno":-111,"code":"ECONNREFUSED","syscall":"connect","address":"192.168.1.116","port":62968}
[2/12/2022, 10:14:22 AM] [TplinkSmarthome] [Office Desk Lamp] {"errno":-111,"code":"ECONNREFUSED","syscall":"connect","address":"192.168.1.116","port":62968}
[2/12/2022, 10:14:22 AM] [TplinkSmarthome] [Office Desk Lamp] {"errno":-111,"code":"ECONNREFUSED","syscall":"connect","address":"192.168.1.116","port":62968}
[2/12/2022, 10:14:22 AM] [TplinkSmarthome.API] [2] TcpSocket: socket:close, hadError:true
[2/12/2022, 10:14:22 AM] [TplinkSmarthome.API] [2] TcpSocket: socket:close error
[2/12/2022, 10:14:22 AM] [TplinkSmarthome.API] [3] TcpSocket: socket:error Error: connect ECONNREFUSED 192.168.1.195:25289
    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1157:16) {
  errno: -111,
  code: 'ECONNREFUSED',
  syscall: 'connect',
  address: '192.168.1.195',
  port: 25289
}

Configuration

{
            "name": "TplinkSmarthome",
            "addCustomCharacteristics": true,
            "deviceTypes": [
                "plug",
                "bulb"
            ],
            "platform": "TplinkSmarthome"
        },
plasticrake commented 2 years ago

I think this may be new device firmware breaking how the plugin works. The devices should be using port 9999 but they aren't. Can you follow these steps and post the results? See #244

mven commented 2 years ago

Output:

[mike@ishimura ~]$ npx tplink-smarthome-api search
Searching...
startDiscovery({
  discoveryInterval: 2000,
  discoveryTimeout: 10000,
  breakoutChildren: true,
  broadcast: '255.255.255.255'
})
KL125(US) bulb IOT.SMARTBULB 192.168.1.116 19082 E848B8554F38 8012213D83E6F211EEFAC9EE4D6732C21E556C81 Office Desk Lamp
KP405(US) plug IOT.SMARTPLUGSWITCH 192.168.1.202 10459 1027F59C7E82 80066DBA128692EACBC1D1E262E01B6C1EE7ECFD String lights outlet
KL125(US) bulb IOT.SMARTBULB 192.168.1.195 17178 E4C32A824850 801271A9E8A2734DD542E942AC0352CC1DA4E819 Living Room floor lamp
KL125(US) bulb IOT.SMARTBULB 192.168.1.197 3807 E4C32A822D38 80123AAB28A92212C85CF43FF387621C1DA305E4 Master Bedroom Table Lamp
KL125(US) bulb IOT.SMARTBULB 192.168.1.199 32590 E848B855DECD 801282FB70B9B09F32594B2C0C3648F51E5BEB24 Entry Room Floor Lamp
KL125(US) bulb IOT.SMARTBULB 192.168.1.115 23314 E848B855DBB8 801263B454866E912DAA27E05A0C65841E5A68B0 Dining Room Floor Lamp
plasticrake commented 2 years ago

Yeah I haven't seen this before, all those ports are usually 9999. Do they change every time you run search or are they static?

Can you also run this: (replace the IP to match what search returns for KP405)

tplink-smarthome-api setPowerState 192.168.1.202 false
tplink-smarthome-api setPowerState 192.168.1.202 true

Note this will turn the plug off and on (if its working).

mven commented 2 years ago

Yep, it looks like ports are changing each time I run the util (ran 2x):

[mike@ishimura ~]$ npx tplink-smarthome-api search
Searching...
startDiscovery({
  discoveryInterval: 2000,
  discoveryTimeout: 10000,
  breakoutChildren: true,
  broadcast: '255.255.255.255'
})
KP405(US) plug IOT.SMARTPLUGSWITCH 192.168.1.202 21788 1027F59C7E82 80066DBA128692EACBC1D1E262E01B6C1EE7ECFD String lights outlet
KL125(US) bulb IOT.SMARTBULB 192.168.1.116 64780 E848B8554F38 8012213D83E6F211EEFAC9EE4D6732C21E556C81 Office Desk Lamp
KL125(US) bulb IOT.SMARTBULB 192.168.1.195 2215 E4C32A824850 801271A9E8A2734DD542E942AC0352CC1DA4E819 Living Room floor lamp
KL125(US) bulb IOT.SMARTBULB 192.168.1.115 41764 E848B855DBB8 801263B454866E912DAA27E05A0C65841E5A68B0 Dining Room Floor Lamp
KL125(US) bulb IOT.SMARTBULB 192.168.1.199 1951 E848B855DECD 801282FB70B9B09F32594B2C0C3648F51E5BEB24 Entry Room Floor Lamp
KL125(US) bulb IOT.SMARTBULB 192.168.1.197 35657 E4C32A822D38 80123AAB28A92212C85CF43FF387621C1DA305E4 Master Bedroom Table Lamp
[mike@ishimura ~]$ npx tplink-smarthome-api search
Searching...
startDiscovery({
  discoveryInterval: 2000,
  discoveryTimeout: 10000,
  breakoutChildren: true,
  broadcast: '255.255.255.255'
})
KL125(US) bulb IOT.SMARTBULB 192.168.1.116 44268 E848B8554F38 8012213D83E6F211EEFAC9EE4D6732C21E556C81 Office Desk Lamp
KP405(US) plug IOT.SMARTPLUGSWITCH 192.168.1.202 27572 1027F59C7E82 80066DBA128692EACBC1D1E262E01B6C1EE7ECFD String lights outlet
KL125(US) bulb IOT.SMARTBULB 192.168.1.199 39742 E848B855DECD 801282FB70B9B09F32594B2C0C3648F51E5BEB24 Entry Room Floor Lamp
KL125(US) bulb IOT.SMARTBULB 192.168.1.195 32927 E4C32A824850 801271A9E8A2734DD542E942AC0352CC1DA4E819 Living Room floor lamp
KL125(US) bulb IOT.SMARTBULB 192.168.1.115 49226 E848B855DBB8 801263B454866E912DAA27E05A0C65841E5A68B0 Dining Room Floor Lamp
KL125(US) bulb IOT.SMARTBULB 192.168.1.197 22011 E4C32A822D38 80123AAB28A92212C85CF43FF387621C1DA305E4 Master Bedroom Table Lamp

tplink-smarthome-api setPowerState 192.168.1.202 false

[mike@ishimura ~]$ npx tplink-smarthome-api setPowerState 192.168.1.202 false
Sending setPowerState command to 192.168.1.202:  via tcp...
response:
true

tplink-smarthome-api setPowerState 192.168.1.202 true

[mike@ishimura ~]$ npx tplink-smarthome-api setPowerState 192.168.1.202 true
Sending setPowerState command to 192.168.1.202:  via tcp...
response:
true
plasticrake commented 2 years ago

Did it turn off and on?

mven commented 2 years ago

Yes - it's responding: powering off when set to false and powering on when set to true

plasticrake commented 2 years ago

Great! So right now the software makes the assumption that the port the devices responds back from discovery is the one it should use to communicate. Until now that has generally been 9999. I will have to make some changes to just always default to 9999 and I believe that should have this working for you.

plasticrake commented 2 years ago

@mven can you please install homebridge-tplink-smarthome@7.1.0-next.0 and let me know if that fixes your issue?

mven commented 2 years ago

Hi - installed and confirmed that devices are now working (bulbs and plugs) in iOS Home app. I'm also able to use Siri again to toggle their status. Looks like your fix worked 🚀

ItsCirce commented 1 year ago

@mven can you please install homebridge-tplink-smarthome@7.1.0-next.0 and let me know if that fixes your issue?

Hey, it looks like Im having the same issues from the logs but Im a bit lost on how you fixed this. From the sounds of it, it's just a simple fix, I just don't fully understand yet. Any help would be much appreciated.

deronkel82 commented 1 year ago

@plasticrake Hi! I have the same problem in Homebridge running on a synology diskstation. how to install the fixed version? I somehow can´t figure it out.. Will this version be available via the "normal" plugin installation in the gui?

Thanks in advance..

Staubgeborener commented 1 year ago

@plasticrake Hi! I have the same problem in Homebridge running on a synology diskstation. how to install the fixed version? I somehow can´t figure it out.. Will this version be available via the "normal" plugin installation in the gui?

Thanks in advance..

npm install homebridge-tplink-smarthome@7.1.0-next.0

deronkel82 commented 1 year ago

I´ve tried the command in the homebridge console. it runs without errors but the 7.0.1 version is still active. Maybe i´m just not understanding it correctly?