Page 2 of 6

Re: TP-Link Support

Posted: Mon May 29, 2017 1:59 pm
by george tirebuyer
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.

Re: TP-Link Support

Posted: Tue May 30, 2017 5:00 am
by kgschlosser
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

Re: TP-Link Support

Posted: Tue May 30, 2017 11:46 am
by george tirebuyer
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

Re: TP-Link Support

Posted: Tue May 30, 2017 8:19 pm
by kgschlosser
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

Re: TP-Link Support

Posted: Tue May 30, 2017 8:28 pm
by kgschlosser
ok give this bad larry a try. lets see if it takes care of that socket closing issue

Re: TP-Link Support

Posted: Tue May 30, 2017 11:01 pm
by george tirebuyer
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'

Re: TP-Link Support

Posted: Wed May 31, 2017 6:35 am
by kgschlosser
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

Re: TP-Link Support

Posted: Wed May 31, 2017 1:33 pm
by george tirebuyer
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'

Re: TP-Link Support

Posted: Thu Jun 01, 2017 12:33 am
by kgschlosser
Ugggh more API diferences between the bulbs and the plugs (switches are plugs)

Re: TP-Link Support

Posted: Thu Jun 01, 2017 1:38 am
by george tirebuyer
Yep. Thanks for all the hard work. It's got to be hard without the hardware to test on.

Re: TP-Link Support

Posted: Thu Jun 01, 2017 2:28 am
by kgschlosser
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.

Re: TP-Link Support

Posted: Thu Jun 01, 2017 3:58 am
by george tirebuyer
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

Re: TP-Link Support

Posted: Thu Jun 01, 2017 4:39 am
by kgschlosser
give it a shot

Re: TP-Link Support

Posted: Thu Jun 01, 2017 10:40 am
by george tirebuyer
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

Re: TP-Link Support

Posted: Thu Jun 01, 2017 11:51 am
by kgschlosser
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