Comments (5)
Sean, has suggested (in email) that I confirm if future is installed. Will confirm.
from pyhs100.
Installing future got the cli working, however the decoding issue still persists.
pi@hass:/home/hass/.homeassistant/pyHS100-master $ python -m examples/cli 192.168.10.27
DEBUG:pyHS100.protocol:> (31) {"system": {"get_sysinfo": {}}}
DEBUG:pyHS100.protocol:< (572) {"system":{"get_sysinfo":{"sw_ver":"1.0.10 Build 161012 Rel.165510","hw_ver":"2.0","type":"IOT.SMARTPLUGSWITCH","model":"HS100(AU)","mac":"50:C7:BF:39:84:CA","dev_name":"Smart Wi-Fi Plug","alias":"Pagola Fairy Light","relay_state":0,"on_time":0,"active_mode":"none","feature":"TIM","updating":0,"icon_hash":"","rssi":-64,"led_off":0,"longitude_i":1385850,"latitude_i":-350498,"hwId":"D3CB232A2C936C37AE441A16BD2CBE64","fwId":"00000000000000000000000000000000","deviceId":"800643A465EF4142ABA69F3143D377F1182347C5","oemId":"2768475E8EC1F98BD216C2BF981B2DD1","err_code":0}}}
DEBUG:pyHS100.protocol:> (31) {"system": {"get_sysinfo": {}}}
DEBUG:pyHS100.protocol:< (572) {"system":{"get_sysinfo":{"sw_ver":"1.0.10 Build 161012 Rel.165510","hw_ver":"2.0","type":"IOT.SMARTPLUGSWITCH","model":"HS100(AU)","mac":"50:C7:BF:39:84:CA","dev_name":"Smart Wi-Fi Plug","alias":"Pagola Fairy Light","relay_state":0,"on_time":0,"active_mode":"none","feature":"TIM","updating":0,"icon_hash":"","rssi":-63,"led_off":0,"longitude_i":1385850,"latitude_i":-350498,"hwId":"D3CB232A2C936C37AE441A16BD2CBE64","fwId":"00000000000000000000000000000000","deviceId":"800643A465EF4142ABA69F3143D377F1182347C5","oemId":"2768475E8EC1F98BD216C2BF981B2DD1","err_code":0}}}
INFO:root:Identify: (u'Pagola Fairy Light', u'HS100(AU)', [u'TIM'])
DEBUG:pyHS100.protocol:> (31) {"system": {"get_sysinfo": {}}}
DEBUG:pyHS100.protocol:< (572) {"system":{"get_sysinfo":{"sw_ver":"1.0.10 Build 161012 Rel.165510","hw_ver":"2.0","type":"IOT.SMARTPLUGSWITCH","model":"HS100(AU)","mac":"50:C7:BF:39:84:CA","dev_name":"Smart Wi-Fi Plug","alias":"Pagola Fairy Light","relay_state":0,"on_time":0,"active_mode":"none","feature":"TIM","updating":0,"icon_hash":"","rssi":-64,"led_off":0,"longitude_i":1385850,"latitude_i":-350498,"hwId":"D3CB232A2C936C37AE441A16BD2CBE64","fwId":"00000000000000000000000000000000","deviceId":"800643A465EF4142ABA69F3143D377F1182347C5","oemId":"2768475E8EC1F98BD216C2BF981B2DD1","err_code":0}}}
INFO:root:Sysinfo: {u'active_mode': u'none',
u'alias': u'Pagola Fairy Light',
u'dev_name': u'Smart Wi-Fi Plug',
u'deviceId': u'800643A465EF4142ABA69F3143D377F1182347C5',
u'feature': u'TIM',
u'fwId': u'00000000000000000000000000000000',
u'hwId': u'D3CB232A2C936C37AE441A16BD2CBE64',
u'hw_ver': u'2.0',
u'icon_hash': u'',
u'latitude_i': -350498,
u'led_off': 0,
u'longitude_i': 1385850,
u'mac': u'50:C7:BF:39:84:CA',
u'model': u'HS100(AU)',
u'oemId': u'2768475E8EC1F98BD216C2BF981B2DD1',
u'on_time': 0,
u'relay_state': 0,
u'rssi': -64,
u'sw_ver': u'1.0.10 Build 161012 Rel.165510',
u'type': u'IOT.SMARTPLUGSWITCH',
u'updating': 0}
DEBUG:pyHS100.protocol:> (31) {"system": {"get_sysinfo": {}}}
DEBUG:pyHS100.protocol:< (572) {"system":{"get_sysinfo":{"sw_ver":"1.0.10 Build 161012 Rel.165510","hw_ver":"2.0","type":"IOT.SMARTPLUGSWITCH","model":"HS100(AU)","mac":"50:C7:BF:39:84:CA","dev_name":"Smart Wi-Fi Plug","alias":"Pagola Fairy Light","relay_state":0,"on_time":0,"active_mode":"none","feature":"TIM","updating":0,"icon_hash":"","rssi":-64,"led_off":0,"longitude_i":1385850,"latitude_i":-350498,"hwId":"D3CB232A2C936C37AE441A16BD2CBE64","fwId":"00000000000000000000000000000000","deviceId":"800643A465EF4142ABA69F3143D377F1182347C5","oemId":"2768475E8EC1F98BD216C2BF981B2DD1","err_code":0}}}
Hass log errors
Feb 20 01:58:09 hass hass[12191]: ERROR:homeassistant.components.switch:Error while setting up platform tplink
Feb 20 01:58:09 hass hass[12191]: Traceback (most recent call last):
Feb 20 01:58:09 hass hass[12191]: File "/home/hass/.homeassistant/deps/pyHS100/pyHS100.py", line 99, in _query_helper
Feb 20 01:58:09 hass hass[12191]: request={target: {cmd: arg}}
Feb 20 01:58:09 hass hass[12191]: File "/home/hass/.homeassistant/deps/pyHS100/protocol.py", line 65, in query
Feb 20 01:58:09 hass hass[12191]: return json.loads(response)
Feb 20 01:58:09 hass hass[12191]: File "/usr/lib/python3.4/json/__init__.py", line 318, in loads
Feb 20 01:58:09 hass hass[12191]: return _default_decoder.decode(s)
Feb 20 01:58:09 hass hass[12191]: File "/usr/lib/python3.4/json/decoder.py", line 343, in decode
Feb 20 01:58:09 hass hass[12191]: obj, end = self.raw_decode(s, idx=_w(s, 0).end())
Feb 20 01:58:09 hass hass[12191]: File "/usr/lib/python3.4/json/decoder.py", line 361, in raw_decode
Feb 20 01:58:09 hass hass[12191]: raise ValueError(errmsg("Expecting value", s, err.value)) from None
Feb 20 01:58:09 hass hass[12191]: ValueError: Expecting value: line 1 column 1 (char 0)
Feb 20 01:58:09 hass hass[12191]: The above exception was the direct cause of the following exception:
Feb 20 01:58:09 hass hass[12191]: Traceback (most recent call last):
Feb 20 01:58:09 hass hass[12191]: File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/helpers/entity_component.py", line 151, in _async_setup_platform
Feb 20 01:58:09 hass hass[12191]: entity_platform.add_entities, discovery_info
Feb 20 01:58:09 hass hass[12191]: File "/usr/lib/python3.4/asyncio/futures.py", line 388, in __iter__
Feb 20 01:58:09 hass hass[12191]: yield self # This tells Task to wait for completion.
Feb 20 01:58:09 hass hass[12191]: File "/usr/lib/python3.4/asyncio/tasks.py", line 286, in _wakeup
Feb 20 01:58:09 hass hass[12191]: value = future.result()
Feb 20 01:58:09 hass hass[12191]: File "/usr/lib/python3.4/asyncio/futures.py", line 277, in result
Feb 20 01:58:09 hass hass[12191]: raise self._exception
Feb 20 01:58:09 hass hass[12191]: File "/usr/lib/python3.4/concurrent/futures/thread.py", line 54, in run
Feb 20 01:58:09 hass hass[12191]: result = self.fn(*self.args, **self.kwargs)
Feb 20 01:58:09 hass hass[12191]: File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/components/switch/tplink.py", line 40, in setup_platform
Feb 20 01:58:09 hass hass[12191]: add_devices([SmartPlugSwitch(SmartPlug(host), name)], True)
Feb 20 01:58:09 hass hass[12191]: File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/components/switch/tplink.py", line 52, in __init__
Feb 20 01:58:09 hass hass[12191]: self._name = self.smartplug.alias
Feb 20 01:58:09 hass hass[12191]: File "/home/hass/.homeassistant/deps/pyHS100/pyHS100.py", line 359, in alias
Feb 20 01:58:09 hass hass[12191]: return self.sys_info['alias']
Feb 20 01:58:09 hass hass[12191]: File "/home/hass/.homeassistant/deps/pyHS100/pyHS100.py", line 119, in sys_info
Feb 20 01:58:09 hass hass[12191]: return self.get_sysinfo()
Feb 20 01:58:09 hass hass[12191]: File "/home/hass/.homeassistant/deps/pyHS100/pyHS100.py", line 171, in get_sysinfo
Feb 20 01:58:09 hass hass[12191]: return self._query_helper("system", "get_sysinfo")
Feb 20 01:58:09 hass hass[12191]: File "/home/hass/.homeassistant/deps/pyHS100/pyHS100.py", line 102, in _query_helper
Feb 20 01:58:09 hass hass[12191]: raise SmartPlugException(ex) from ex
Feb 20 01:58:09 hass hass[12191]: pyHS100.pyHS100.SmartPlugException: Expecting value: line 1 column 1 (char 0)
from pyhs100.
Can you place your code surrounded by three backticks ``` followed by newline so we can get something more readable like so:
```
line1
line2
```
or copy-paste it in a gist.
from pyhs100.
Sorry about that. Will do. Will get fresh output... Now updated
from pyhs100.
This should have been fixed by #30 which will be in the new release, so closing this.
from pyhs100.
Related Issues (20)
- alias, state, and is_on not functional in SmartPlug for SmartStrip.plug[] devices HOT 2
- HS300 not listed in Discover.discover() HOT 4
- HS200 weird communication error HOT 6
- Security HOT 2
- New protocol HOT 5
- Add support for the KP200 HOT 23
- bug displaying plug status if off.
- New release? HOT 2
- LED config not working HOT 4
- view and update a schedule
- import failure HOT 5
- TP-link KP200 not working proper NOT A DUPLICATE OF ADD SUPPORT FOR THE KP200 HOT 1
- Smart Bulb KL50 HOT 3
- HS220 Set Brightness HOT 1
- Get rid of click-datetime dep HOT 2
- Archive this repository HOT 3
- Failed to run "$ pyhs100" after install HOT 2
- KP105 support HOT 1
- Run
- Kasa discovery HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyhs100.