TP-Link Support

Questions and comments specific to a particular plugin should go here.
george tirebuyer
Posts: 35
Joined: Sun Apr 28, 2013 12:25 pm

Re: TP-Link Support

Post by george tirebuyer » Mon May 29, 2017 1:59 pm

I got exactly the same error then I noticed the new plugin had the same version number. Maybe you uploaded the old one by mistake.

User avatar
kgschlosser
Site Admin
Posts: 3105
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: TP-Link Support

Post by kgschlosser » Tue May 30, 2017 5:00 am

nah I just haven't been changing the version number. here is another altered version. I think I may have also fixed the issue with the On Since displaying incorrect data
If you like the work I have been doing then feel free to Image

george tirebuyer
Posts: 35
Joined: Sun Apr 28, 2013 12:25 pm

Re: TP-Link Support

Post by george tirebuyer » Tue May 30, 2017 11:46 am

Happens when I add the macros:

04:44:21 Plugin: TPLink
04:44:24 TPLink.Bulb.Added.New Light '192.168.1.100'
04:44:30 Exception in thread TPLink:
04:44:30 Traceback (most recent call last):
04:44:30 File "threading.pyc", line 801, in __bootstrap_inner
04:44:30 File "C:\ProgramData\EventGhost\plugins\TPLink\__init__.py", line 323, in run
04:44:30 new_devices[alias] = device_type(self.plugin, ip)
04:44:30 File "C:\ProgramData\EventGhost\plugins\TPLink\__init__.py", line 103, in __init__
04:44:30 self._color_temp = self.color_temp
04:44:30 File "C:\ProgramData\EventGhost\plugins\TPLink\tp_link\smartbulb.py", line 159, in color_temp
04:44:30 if not self.is_variable_color_temp:
04:44:30 File "C:\ProgramData\EventGhost\plugins\TPLink\tp_link\smartbulb.py", line 95, in is_variable_color_temp
04:44:30 return bool(self.sys_info['is_variable_color_temp'])
04:44:30 File "C:\ProgramData\EventGhost\plugins\TPLink\tp_link\smartdevice.py", line 111, in sys_info
04:44:30 return self.get_sysinfo()
04:44:30 File "C:\ProgramData\EventGhost\plugins\TPLink\tp_link\smartdevice.py", line 121, in get_sysinfo
04:44:30 return self._query_helper("system", "get_sysinfo", dict())
04:44:30 File "C:\ProgramData\EventGhost\plugins\TPLink\tp_link\smartdevice.py", line 89, in _query_helper
04:44:30 request={target: {cmd: arg}}
04:44:30 File "C:\ProgramData\EventGhost\plugins\TPLink\tp_link\protocol.py", line 78, in query
04:44:30 raise TPLinkException.SocketError("Socket Close Error:")
04:44:30 SocketError: Socket Close Error:
04:44:30 Traceback (most recent call last):
04:44:30 File "C:\ProgramData\EventGhost\plugins\TPLink\tp_link\protocol.py", line 75, in query
04:44:30 sock.shutdown(socket.SHUT_RDWR)
04:44:30 File "socket.pyc", line 228, in meth
04:44:30 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
04:44:30
04:44:30

User avatar
kgschlosser
Site Admin
Posts: 3105
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: TP-Link Support

Post by kgschlosser » Tue May 30, 2017 8:19 pm

ok I see what the problem is. this is happening because of the monitoring for state changes and it is trying to query the bulb for it's color when it's not a color changing bulb
If you like the work I have been doing then feel free to Image

User avatar
kgschlosser
Site Admin
Posts: 3105
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: TP-Link Support

Post by kgschlosser » Tue May 30, 2017 8:28 pm

ok give this bad larry a try. lets see if it takes care of that socket closing issue
If you like the work I have been doing then feel free to Image

george tirebuyer
Posts: 35
Joined: Sun Apr 28, 2013 12:25 pm

Re: TP-Link Support

Post by george tirebuyer » Tue May 30, 2017 11:01 pm

Happens when trying to configure bulb:

15:59:53 Traceback (most recent call last) (0.5.0-rc2):
15:59:53 File "C:\Program Files (x86)\EventGhost\eg\Classes\TaskletDialog.py", line 162, in ProcessingTask
15:59:53 self.Configure(*args, **kwargs)
15:59:53 File "C:\Program Files (x86)\EventGhost\eg\Classes\ConfigDialog.py", line 106, in Configure
15:59:53 treeItem.Configure(*args)
15:59:53 File "C:\Program Files (x86)\EventGhost\eg\Classes\ActionItem.py", line 80, in Configure
15:59:53 return self.executable.Configure(*args)
15:59:53 File "C:\ProgramData\EventGhost\plugins\TPLink\__init__.py", line 737, in Configure
15:59:53 self._check_device
15:59:53 File "C:\ProgramData\EventGhost\plugins\TPLink\__init__.py", line 640, in __init__
15:59:53 SetData()
15:59:53 File "C:\ProgramData\EventGhost\plugins\TPLink\__init__.py", line 506, in SetData
15:59:53 type_ctrl.SetLabel('Type: ' + device.device_type)
15:59:53 AttributeError: 'Bulb' object has no attribute 'device_type'

User avatar
kgschlosser
Site Admin
Posts: 3105
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: TP-Link Support

Post by kgschlosser » Wed May 31, 2017 6:35 am

sorry about all these errors. I am making large portions to extend the API. cool thing is we will soon be able to access all of the cloud scheduled scenes. but this bulb is also a lot different then the other smart devices. so there is a lot of tinkering to do. I know we started off with the pyHS100 library. but there sure isn't a whole lot of it left. I have rewritten a lot of it. But I have also submitted a bunch of Pull Requests to them so they can extend their API. but this one should fix the device_type issue. i forgot i had renamed that property to device.type instead of device.device_type. but a corrected version is attached
If you like the work I have been doing then feel free to Image

george tirebuyer
Posts: 35
Joined: Sun Apr 28, 2013 12:25 pm

Re: TP-Link Support

Post by george tirebuyer » Wed May 31, 2017 1:33 pm

Here's the latest error on config:

06:31:17 Traceback (most recent call last) (0.5.0-rc2):
06:31:17 File "C:\Program Files (x86)\EventGhost\eg\Classes\TaskletDialog.py", line 162, in ProcessingTask
06:31:17 self.Configure(*args, **kwargs)
06:31:17 File "C:\Program Files (x86)\EventGhost\eg\Classes\ConfigDialog.py", line 106, in Configure
06:31:17 treeItem.Configure(*args)
06:31:17 File "C:\Program Files (x86)\EventGhost\eg\Classes\ActionItem.py", line 80, in Configure
06:31:17 return self.executable.Configure(*args)
06:31:17 File "C:\ProgramData\EventGhost\plugins\TPLink\__init__.py", line 737, in Configure
06:31:17 self._check_device
06:31:17 File "C:\ProgramData\EventGhost\plugins\TPLink\__init__.py", line 640, in __init__
06:31:17 SetData()
06:31:17 File "C:\ProgramData\EventGhost\plugins\TPLink\__init__.py", line 512, in SetData
06:31:17 'Updating.....' if device.updating else ''
06:31:17 File "C:\ProgramData\EventGhost\plugins\TPLink\tp_link\smartdevice.py", line 610, in updating
06:31:17 return self.sys_info['updating']
06:31:17 KeyError: 'updating'

User avatar
kgschlosser
Site Admin
Posts: 3105
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: TP-Link Support

Post by kgschlosser » Thu Jun 01, 2017 12:33 am

Ugggh more API diferences between the bulbs and the plugs (switches are plugs)
If you like the work I have been doing then feel free to Image

george tirebuyer
Posts: 35
Joined: Sun Apr 28, 2013 12:25 pm

Re: TP-Link Support

Post by george tirebuyer » Thu Jun 01, 2017 1:38 am

Yep. Thanks for all the hard work. It's got to be hard without the hardware to test on.

User avatar
kgschlosser
Site Admin
Posts: 3105
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: TP-Link Support

Post by kgschlosser » Thu Jun 01, 2017 2:28 am

It's one of those make a change. Post it. Wait... Another error. Make a change post it wait... It doesn't bother me too much. But it's not an ideal way to make a plugin. But with no documentation on the API I don't know what is who and how. And people that wrote up the pyHS100 library live in EU where only plugs are available. So they have no access to the bulbs and switches and have no real way of testing or adding to the API they have made up. So at the same time as I am working on this I am also writing code for them as well.
If you like the work I have been doing then feel free to Image

george tirebuyer
Posts: 35
Joined: Sun Apr 28, 2013 12:25 pm

Re: TP-Link Support

Post by george tirebuyer » Thu Jun 01, 2017 3:58 am

You might want to look at this. I think it is based on the pyHS100 library but is in JSON. It's all over my head but it might give you some ideas.
https://www.npmjs.com/package/tplink-lightbulb

User avatar
kgschlosser
Site Admin
Posts: 3105
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: TP-Link Support

Post by kgschlosser » Thu Jun 01, 2017 4:39 am

give it a shot
If you like the work I have been doing then feel free to Image

george tirebuyer
Posts: 35
Joined: Sun Apr 28, 2013 12:25 pm

Re: TP-Link Support

Post by george tirebuyer » Thu Jun 01, 2017 10:40 am

Found the bulb on installation. Presented a blank page on configure item, nothing in the drop down. Executing the action said bulb not found. This was generated after a restart.


03:32:22 Exception in thread TPLink:
03:32:22 Traceback (most recent call last):
03:32:22 File "threading.pyc", line 801, in __bootstrap_inner
03:32:22 File "C:\ProgramData\EventGhost\plugins\TPLink\__init__.py", line 323, in run
03:32:22 new_devices[alias] = device_type(self.plugin, ip)
03:32:22 File "C:\ProgramData\EventGhost\plugins\TPLink\__init__.py", line 97, in __init__
03:32:22 suffix='Bulb.Added.' + self.alias,
03:32:22 File "C:\ProgramData\EventGhost\plugins\TPLink\tp_link\smartdevice.py", line 159, in alias
03:32:22 return self.sys_info['alias']
03:32:22 File "C:\ProgramData\EventGhost\plugins\TPLink\tp_link\smartdevice.py", line 111, in sys_info
03:32:22 return self.get_sysinfo()
03:32:22 File "C:\ProgramData\EventGhost\plugins\TPLink\tp_link\smartdevice.py", line 121, in get_sysinfo
03:32:22 return self._query_helper("system", "get_sysinfo", dict())
03:32:22 File "C:\ProgramData\EventGhost\plugins\TPLink\tp_link\smartdevice.py", line 89, in _query_helper
03:32:22 request={target: {cmd: arg}}
03:32:22 File "C:\ProgramData\EventGhost\plugins\TPLink\tp_link\protocol.py", line 51, in query
03:32:22 raise TPLinkException.SocketError("Socket Connection Error:")
03:32:22 SocketError: Socket Connection Error:
03:32:22 Traceback (most recent call last):
03:32:22 File "C:\ProgramData\EventGhost\plugins\TPLink\tp_link\protocol.py", line 49, in query
03:32:22 sock.connect((host, port))
03:32:22 File "socket.pyc", line 228, in meth
03:32:22 timeout: timed out
03:32:22
03:32:22

User avatar
kgschlosser
Site Admin
Posts: 3105
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: TP-Link Support

Post by kgschlosser » Thu Jun 01, 2017 11:51 am

well you can't perform the action if there is no bulb found. that will not work.

if the light buld does not support the specific action you are trying to sue then it will not work. as an example. the bulb you have only supports turning on and off i believe. so no color changing and no color temp changing. and no dimming. so those actions will do nothing for you
If you like the work I have been doing then feel free to Image

Post Reply