TP-Link Support

Questions and comments specific to a particular plugin should go here.

TP-Link Support

Postby kgschlosser » Fri May 26, 2017 1:48 pm

TP-Link Smart Devices

This is the official support thread for the TP-Link Smart Devices plugin.

This plugin allows control of TP-Link Smart Plugs, Smart Switches and Smart Bulbs.

Currently supports doing the following

Getting device on/off state
Getting MAC address
Getting device alias
Getting device model
Getting current power consumption
Getting power usage history
Getting current device state
Getting WiFi signal strength
Getting device IP address
Getting firmware version
Getting hardware version
Getting oem id
Getting device time
Getting bulb color
Getting bulb dim level
Getting bulb color temperature
Getting plug/switch led state
Getting electric meter gains
Getting hardware id
Getting device id
Getting device time
Getting device timezone
Getting device location (lat/lon)


Setting bulb level
Setting bulb color
Setting bulb color temperature
Setting led state
Setting hardware id
Setting device id
Setting MAC address
Setting device on/off state
Setting electric meter gains
Setting device Location (lat/lon)


Clearing electric usage history
Rebooting device
Resetting to factory defaults
Flashing firmware
Checking for new firmware versions
Logging into TP-Link cloud server
Testing uBoot
Calibrating electric meter


The plugin generates events if various things change on the device

If you have any errors please leave a detailed description of the process that caused the error. and any errors that are displayed on the screen. if there is incorrect data being displayed at any point a screen shot of the incorrect data would be very helpful

This plugin is only compatible with EventGhost 0.5

simply download and double click and enjoy.
If you like the work I have been doing then feel free to Image
User avatar
kgschlosser
Site Admin
 
Posts: 2712
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: TP-Link Support

Postby george tirebuyer » Fri May 26, 2017 10:17 pm

This is the error I'm getting when I try to configure.

15:11:50 Traceback (most recent call last) (0.5.0-rc2):
15:11:50 File "C:\Program Files (x86)\EventGhost\eg\Classes\TaskletDialog.py", line 162, in ProcessingTask
15:11:50 self.Configure(*args, **kwargs)
15:11:50 File "C:\Program Files (x86)\EventGhost\eg\Classes\ConfigDialog.py", line 106, in Configure
15:11:50 treeItem.Configure(*args)
15:11:50 File "C:\Program Files (x86)\EventGhost\eg\Classes\ActionItem.py", line 80, in Configure
15:11:50 return self.executable.Configure(*args)
15:11:50 File "C:\ProgramData\EventGhost\plugins\TPLink\__init__.py", line 865, in Configure
15:11:50 self._check_device
15:11:50 File "C:\ProgramData\EventGhost\plugins\TPLink\__init__.py", line 708, in __init__
15:11:50 SetData()
15:11:50 File "C:\ProgramData\EventGhost\plugins\TPLink\__init__.py", line 586, in SetData
15:11:50 name_ctrl.SetLabel('Device Name: ' + device.get_device_name())
15:11:50 File "C:\ProgramData\EventGhost\plugins\TPLink\__init__.py", line 160, in get_device_name
15:11:50 return self.device.hw_info['dev_name']
15:11:50 File "C:\ProgramData\EventGhost\plugins\TPLink\tp_link\smartdevice.py", line 296, in hw_info
15:11:50 return {key: info[key] for key in keys}
15:11:50 File "C:\ProgramData\EventGhost\plugins\TPLink\tp_link\smartdevice.py", line 296, in <dictcomp>
15:11:50 return {key: info[key] for key in keys}
15:11:50 KeyError: 'mac'

and then this one

15:12:24 Exception in thread TPLink:
15:12:24 Traceback (most recent call last):
15:12:24 File "threading.pyc", line 801, in __bootstrap_inner
15:12:24 File "C:\ProgramData\EventGhost\plugins\TPLink\__init__.py", line 416, in run
15:12:24 self.devices[alias].update()
15:12:24 File "C:\ProgramData\EventGhost\plugins\TPLink\__init__.py", line 217, in update
15:12:24 brightness = self.get_light_level()
15:12:24 File "C:\ProgramData\EventGhost\plugins\TPLink\__init__.py", line 273, in get_light_level
15:12:24 if self.is_dimmable():
15:12:24 File "C:\ProgramData\EventGhost\plugins\TPLink\__init__.py", line 270, in is_dimmable
15:12:24 return self.device.is_dimmable
15:12:24 File "C:\ProgramData\EventGhost\plugins\TPLink\tp_link\smartbulb.py", line 84, in is_dimmable
15:12:24 return bool(self.sys_info['is_dimmable'])
15:12:24 File "C:\ProgramData\EventGhost\plugins\TPLink\tp_link\smartdevice.py", line 115, in sys_info
15:12:24 return self.get_sysinfo()
15:12:24 File "C:\ProgramData\EventGhost\plugins\TPLink\tp_link\smartdevice.py", line 125, in get_sysinfo
15:12:24 return self._query_helper("system", "get_sysinfo", dict())
15:12:24 File "C:\ProgramData\EventGhost\plugins\TPLink\tp_link\smartdevice.py", line 93, in _query_helper
15:12:24 request={target: {cmd: arg}}
15:12:24 File "C:\ProgramData\EventGhost\plugins\TPLink\tp_link\protocol.py", line 76, in query
15:12:24 raise TPLinkException.SocketError("Socket Close Error:")
15:12:24 SocketError: Socket Close Error:
15:12:24 Traceback (most recent call last):
15:12:24 File "C:\ProgramData\EventGhost\plugins\TPLink\tp_link\protocol.py", line 73, in query
15:12:24 sock.shutdown(socket.SHUT_RDWR)
15:12:24 File "socket.pyc", line 228, in meth
15:12:24 error: [Errno 10057] A request to send or receive data was disallowed because the socket is not connected and (when sending on a datagram socket using a sendto call) no address was supplied
15:12:24
15:12:24
george tirebuyer
 
Posts: 34
Joined: Sun Apr 28, 2013 12:25 pm

Re: TP-Link Support

Postby kgschlosser » Sat May 27, 2017 3:27 am

ok this one should address the first error. now the second error I am not to sure what that is from. so lets see if it occurs again.
If you like the work I have been doing then feel free to Image
User avatar
kgschlosser
Site Admin
 
Posts: 2712
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: TP-Link Support

Postby george tirebuyer » Sat May 27, 2017 4:41 am

Error on config followed a second later by the other error:

21:37:51 Traceback (most recent call last) (0.5.0-rc2):
21:37:51 File "C:\Program Files (x86)\EventGhost\eg\Classes\TaskletDialog.py", line 162, in ProcessingTask
21:37:51 self.Configure(*args, **kwargs)
21:37:51 File "C:\Program Files (x86)\EventGhost\eg\Classes\ConfigDialog.py", line 106, in Configure
21:37:51 treeItem.Configure(*args)
21:37:51 File "C:\Program Files (x86)\EventGhost\eg\Classes\ActionItem.py", line 80, in Configure
21:37:51 return self.executable.Configure(*args)
21:37:51 File "C:\ProgramData\EventGhost\plugins\TPLink\__init__.py", line 803, in Configure
21:37:51 self._check_device
21:37:51 File "C:\ProgramData\EventGhost\plugins\TPLink\__init__.py", line 708, in __init__
21:37:51 SetData()
21:37:51 File "C:\ProgramData\EventGhost\plugins\TPLink\__init__.py", line 586, in SetData
21:37:51 name_ctrl.SetLabel('Device Name: ' + device.get_device_name())
21:37:51 File "C:\ProgramData\EventGhost\plugins\TPLink\__init__.py", line 160, in get_device_name
21:37:51 return self.device.hw_info['dev_name']
21:37:51 File "C:\ProgramData\EventGhost\plugins\TPLink\tp_link\smartdevice.py", line 297, in hw_info
21:37:51 res = {key: info[key] for key in keys}
21:37:51 File "C:\ProgramData\EventGhost\plugins\TPLink\tp_link\smartdevice.py", line 297, in <dictcomp>
21:37:51 res = {key: info[key] for key in keys}
21:37:51 KeyError: 'fwId'

21:38:21 Exception in thread TPLink:
21:38:21 Traceback (most recent call last):
21:38:21 File "threading.pyc", line 801, in __bootstrap_inner
21:38:21 File "C:\ProgramData\EventGhost\plugins\TPLink\__init__.py", line 416, in run
21:38:21 self.devices[alias].update()
21:38:21 File "C:\ProgramData\EventGhost\plugins\TPLink\__init__.py", line 217, in update
21:38:21 brightness = self.get_light_level()
21:38:21 File "C:\ProgramData\EventGhost\plugins\TPLink\__init__.py", line 274, in get_light_level
21:38:21 return self.device.brightness
21:38:21 File "C:\ProgramData\EventGhost\plugins\TPLink\tp_link\smartbulb.py", line 189, in brightness
21:38:21 light_state = self.get_light_state()
21:38:21 File "C:\ProgramData\EventGhost\plugins\TPLink\tp_link\smartbulb.py", line 101, in get_light_state
21:38:21 dict()
21:38:21 File "C:\ProgramData\EventGhost\plugins\TPLink\tp_link\smartdevice.py", line 93, in _query_helper
21:38:21 request={target: {cmd: arg}}
21:38:21 File "C:\ProgramData\EventGhost\plugins\TPLink\tp_link\protocol.py", line 76, in query
21:38:21 raise TPLinkException.SocketError("Socket Close Error:")
21:38:21 SocketError: Socket Close Error:
21:38:21 Traceback (most recent call last):
21:38:21 File "C:\ProgramData\EventGhost\plugins\TPLink\tp_link\protocol.py", line 73, in query
21:38:21 sock.shutdown(socket.SHUT_RDWR)
21:38:21 File "socket.pyc", line 228, in meth
21:38:21 error: [Errno 10057] A request to send or receive data was disallowed because the socket is not connected and (when sending on a datagram socket using a sendto call) no address was supplied
21:38:21
21:38:21
george tirebuyer
 
Posts: 34
Joined: Sun Apr 28, 2013 12:25 pm

Re: TP-Link Support

Postby kgschlosser » Sat May 27, 2017 2:05 pm

OK this is a large update. and I know there are going to be some actions which do not work properly.

New actions added are

Reset Device
Test Uboot
Reboot Device
Flash Firmware
Cloud Server
Change Hardware Id
Change Device Id

some of the Action class names have changed as well

ChangeDeviceAlias is now ChangeAlias
ChangeDeviceMAC is now ChangeMAC
The whole device class has changed instead of creating a new class and housing the device instance inside if that class the new class is a subclass of the device instance.

this also should correct the issue with the firmware is issue for the Smart Bulbs

actions that are going to not function properly are the Set Firmware and the Cloud Server. These 2 actions have been set up to provide extra logging output so I can finish them up. if someone is interested in helping out they can provide me with that log output and I can go from there.

This plugin also has different even names I noticed there was an issue with how the event names were being generated so this has corrected this issue but a side affect of it is the names are different.

There could be other bugs and things i forgot to convert over to the new device class style. if you have any error please let me know.


new version is attached
If you like the work I have been doing then feel free to Image
User avatar
kgschlosser
Site Admin
 
Posts: 2712
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: TP-Link Support

Postby george tirebuyer » Sat May 27, 2017 3:54 pm

The old versions would get the IP address on installation of the plugin. Now this error is generated on plugin installation.

08:51:45 Exception in thread TPLink:
08:51:45 Traceback (most recent call last):
08:51:45 File "threading.pyc", line 801, in __bootstrap_inner
08:51:45 File "C:\ProgramData\EventGhost\plugins\TPLink\__init__.py", line 348, in run
08:51:45 self.devices[alias] = device_type(self.plugin, ip)
08:51:45 File "C:\ProgramData\EventGhost\plugins\TPLink\__init__.py", line 81, in __init__
08:51:45 self.ip = ip_address
08:51:45 NameError: global name 'ip_address' is not defined
08:51:45
george tirebuyer
 
Posts: 34
Joined: Sun Apr 28, 2013 12:25 pm

Re: TP-Link Support

Postby kgschlosser » Sun May 28, 2017 8:27 am

New version fixes above error and also adds 2 more actions

Calibrate EMeter
Change EMeter Gains
If you like the work I have been doing then feel free to Image
User avatar
kgschlosser
Site Admin
 
Posts: 2712
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: TP-Link Support

Postby george tirebuyer » Sun May 28, 2017 10:41 am

I get this error on installation of the plugin:

03:21:02 Exception in thread TPLink:
03:21:02 Traceback (most recent call last):
03:21:02 File "threading.pyc", line 801, in __bootstrap_inner
03:21:02 File "C:\ProgramData\EventGhost\plugins\TPLink\__init__.py", line 349, in run
03:21:02 self.devices[alias] = device_type(self.plugin, ip)
03:21:02 File "C:\ProgramData\EventGhost\plugins\TPLink\__init__.py", line 86, in __init__
03:21:02 suffix='Bulb.Added.' + self._name,
03:21:02 TypeError: cannot concatenate 'str' and 'NoneType' objects
03:21:02
george tirebuyer
 
Posts: 34
Joined: Sun Apr 28, 2013 12:25 pm

Re: TP-Link Support

Postby kgschlosser » Sun May 28, 2017 3:19 pm

ok this one should fix that error
If you like the work I have been doing then feel free to Image
User avatar
kgschlosser
Site Admin
 
Posts: 2712
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: TP-Link Support

Postby george tirebuyer » Sun May 28, 2017 4:16 pm

It finds the bulb then errors:

09:14:00 Plugin: TPLink
09:14:04 TPLink.Bulb.Added.New Light '192.168.1.100'
09:14:08 Exception in thread TPLink:
09:14:08 Traceback (most recent call last):
09:14:08 File "threading.pyc", line 801, in __bootstrap_inner
09:14:08 File "C:\ProgramData\EventGhost\plugins\TPLink\__init__.py", line 278, in run
09:14:08 device for device in self.devices.values() if
09:14:08 File "C:\ProgramData\EventGhost\plugins\TPLink\__init__.py", line 279, in <genexpr>
09:14:08 (device.ip, device.name) not in current_device
09:14:08 AttributeError: 'Bulb' object has no attribute 'name'
09:14:08
george tirebuyer
 
Posts: 34
Joined: Sun Apr 28, 2013 12:25 pm

Re: TP-Link Support

Postby kgschlosser » Mon May 29, 2017 12:15 am

ok give this a try. i revamped how new devices were added and cleaned up and made the code faster hopefully I have no errors in this bit of it.

I am sorry for the inconvenience. and TY for the help bug testing this thing for me i do appreciate it.
If you like the work I have been doing then feel free to Image
User avatar
kgschlosser
Site Admin
 
Posts: 2712
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: TP-Link Support

Postby george tirebuyer » Mon May 29, 2017 5:09 am

I'm happy to test since I have the hardware for it and can't code for crap. I get this when trying to configure a bulb:

22:04:31 Traceback (most recent call last) (0.5.0-rc2):
22:04:31 File "C:\Program Files (x86)\EventGhost\eg\Classes\TaskletDialog.py", line 162, in ProcessingTask
22:04:31 self.Configure(*args, **kwargs)
22:04:31 File "C:\Program Files (x86)\EventGhost\eg\Classes\ConfigDialog.py", line 106, in Configure
22:04:31 treeItem.Configure(*args)
22:04:31 File "C:\Program Files (x86)\EventGhost\eg\Classes\ActionItem.py", line 80, in Configure
22:04:31 return self.executable.Configure(*args)
22:04:31 File "C:\ProgramData\EventGhost\plugins\TPLink\__init__.py", line 801, in Configure
22:04:31 self._check_device
22:04:31 File "C:\ProgramData\EventGhost\plugins\TPLink\__init__.py", line 473, in __init__
22:04:31 device.name for device in devices.values() if func(device)
22:04:31 File "C:\ProgramData\EventGhost\plugins\TPLink\__init__.py", line 473, in <genexpr>
22:04:31 device.name for device in devices.values() if func(device)
22:04:31 AttributeError: 'Bulb' object has no attribute 'name'
george tirebuyer
 
Posts: 34
Joined: Sun Apr 28, 2013 12:25 pm

Re: TP-Link Support

Postby kgschlosser » Mon May 29, 2017 8:28 am

ok that error is now fixed as well
If you like the work I have been doing then feel free to Image
User avatar
kgschlosser
Site Admin
 
Posts: 2712
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: TP-Link Support

Postby george tirebuyer » Mon May 29, 2017 9:06 am

Latest error trying to config the bulb:

02:03:28 Traceback (most recent call last) (0.5.0-rc2):
02:03:28 File "C:\Program Files (x86)\EventGhost\eg\Classes\TaskletDialog.py", line 162, in ProcessingTask
02:03:28 self.Configure(*args, **kwargs)
02:03:28 File "C:\Program Files (x86)\EventGhost\eg\Classes\ConfigDialog.py", line 106, in Configure
02:03:28 treeItem.Configure(*args)
02:03:28 File "C:\Program Files (x86)\EventGhost\eg\Classes\ActionItem.py", line 80, in Configure
02:03:28 return self.executable.Configure(*args)
02:03:28 File "C:\ProgramData\EventGhost\plugins\TPLink\__init__.py", line 739, in Configure
02:03:28 self._check_device
02:03:28 File "C:\ProgramData\EventGhost\plugins\TPLink\__init__.py", line 642, in __init__
02:03:28 SetData()
02:03:28 File "C:\ProgramData\EventGhost\plugins\TPLink\__init__.py", line 485, in SetData
02:03:28 **device.get_location()
02:03:28 AttributeError: 'Bulb' object has no attribute 'get_location'
george tirebuyer
 
Posts: 34
Joined: Sun Apr 28, 2013 12:25 pm

Re: TP-Link Support

Postby kgschlosser » Mon May 29, 2017 1:18 pm

we are almost there. here goes yet another attempt
If you like the work I have been doing then feel free to Image
User avatar
kgschlosser
Site Admin
 
Posts: 2712
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Next

Return to Plugin Support

Who is online

Users browsing this forum: No registered users and 2 guests