Make sure you are running the latest version of Home Assistant before reporting an issue.
You should only file an issue if you found a bug. Feature and enhancement requests should go in the Feature Requests section of our community forum:
Home Assistant release (hass --version):
0.63.0
Python release (python3 --version):
3.6.4
Component/platform:
Windows
Description of problem:
I'm trying to add my Xiaomi Philips LED Ball Lamp but unfortunately I'm getting error and warning.
My token is right, device is connected to my network, I see it in ARP table.
Expected:
Working
Problem-relevant configuration.yaml entries and steps to reproduce:
light:
- platform: xiaomi_miio
name: Lampka biurkowa
host: 192.168.1.80
token: d91fea3andtherestofmytoken
Traceback (if applicable):
2018-02-11 17:58:33 ERROR (SyncWorker_6) [miio.device] Got error when receiving: timed out
2018-02-11 17:58:33 WARNING (SyncWorker_6) [miio.device] Retrying with incremented id, retries left: 3
Additional info:
Please enable debug output and post your log again:
# configuration.yaml
logger:
default: warn
logs:
homeassistant.components.light.xiaomi_miio: debug
miio: debug
Here it is:
2018-02-11 18:25:18 INFO (MainThread) [homeassistant.components.light.xiaomi_miio] Initializing with host 192.168.1.80 (token d91fe...)
2018-02-11 18:25:18 DEBUG (MainThread) [miio.protocol] Unable to decrypt, returning raw bytes: b''
2018-02-11 18:25:18 DEBUG (MainThread) [miio.device] Got a response: Container:
data = Container:
data = (total 0)
value = (total 0)
offset1 = 32
offset2 = 32
length = 0
header = Container:
data = !1\x00 \x00\x00\x00\x00\x03\xact\xca\x00\x00\xf0\xf5 (total 16)
value = Container:
length = 32
unknown = 0
device_id = 03ac74ca (total 8)
ts = 1970-01-01 17:08:05
offset1 = 0
offset2 = 16
length = 16
checksum = \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00 (total 16)
2018-02-11 18:25:18 DEBUG (MainThread) [miio.device] Discovered b'03ac74ca' with ts: 1970-01-01 17:08:05, token: b'00000000000000000000000000000000'
2018-02-11 18:25:18 DEBUG (MainThread) [miio.device] 192.168.1.80:54321 >>: {'id': 1, 'method': 'miIO.info', 'params': []}
2018-02-11 18:25:18 DEBUG (MainThread) [miio.device] 192.168.1.80:54321 (ts: 1970-01-01 17:08:05, id: 1) << {'result': {'life': 61685, 'token': 'd91fea3cbbhereismytoken', 'mac': '34:CE:andtherestofmac', 'fw_ver': '1.3.0_0033', 'hw_ver': 'ESP8266', 'uid': 1764011878, 'model': 'philips.light.bulb', 'wifi_fw_ver': '1.5.0-dev(7f7a714)', 'ap': {'rssi': -53, 'ssid': 'WIFI', 'bssid': 'A0:21andtherestofmac'}, 'netif': {'localIp': '192.168.1.80', 'mask': '255.255.255.0', 'gw': '192.168.1.1'}, 'mmfree': 5504}, 'id': 1}
2018-02-11 18:25:18 INFO (MainThread) [homeassistant.components.light.xiaomi_miio] philips.light.bulb 1.3.0_0033 ESP8266 initialized
2018-02-11 18:25:18 DEBUG (SyncWorker_16) [miio.protocol] Unable to decrypt, returning raw bytes: b''
2018-02-11 18:25:18 DEBUG (SyncWorker_16) [miio.device] Got a response: Container:
data = Container:
data = (total 0)
value = (total 0)
offset1 = 32
offset2 = 32
length = 0
header = Container:
data = !1\x00 \x00\x00\x00\x00\x03\xact\xca\x00\x00\xf0\xf5 (total 16)
value = Container:
length = 32
unknown = 0
device_id = 03ac74ca (total 8)
ts = 1970-01-01 17:08:05
offset1 = 0
offset2 = 16
length = 16
checksum = \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00 (total 16)
2018-02-11 18:25:18 DEBUG (SyncWorker_16) [miio.device] Discovered b'03ac74ca' with ts: 1970-01-01 17:08:05, token: b'00000000000000000000000000000000'
2018-02-11 18:25:18 DEBUG (SyncWorker_16) [miio.device] 192.168.1.80:54321 >>: {'id': 1, 'method': 'get_prop', 'params': ['power', 'bright', 'cct', 'snm', 'dv']}
Error while setting up platform xiaomi_miio
Traceback (most recent call last):
File "/usr/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py", line 84, in async_setup
SLOW_SETUP_MAX_WAIT, loop=hass.loop)
File "/usr/lib/python3.6/asyncio/tasks.py", line 358, in wait_for
return fut.result()
File "/usr/lib/python3.6/asyncio/futures.py", line 245, in result
raise self._exception
File "/usr/lib/python3.6/asyncio/tasks.py", line 180, in _step
result = coro.send(None)
File "/usr/lib/python3.6/asyncio/coroutines.py", line 210, in coro
res = func(args, *kw)
File "/usr/lib/python3.6/site-packages/homeassistant/components/light/xiaomi_miio.py", line 65, in async_setup_platform
from miio import Device, DeviceException
File "/usr/lib/python3.6/site-packages/miio/__init__.py", line 2, in
from miio.protocol import Message, Utils
File "/usr/lib/python3.6/site-packages/miio/protocol.py", line 179, in
Const(0x2131, Int16ub),
File "/usr/lib/python3.6/site-packages/construct/core.py", line 1894, in __init__
super(Const, self).__init__(subcon)
File "/usr/lib/python3.6/site-packages/construct/core.py", line 291, in __init__
raise TypeError("subcon should be a Construct field")
TypeError: subcon should be a Construct field
Same problem and I can't see the item in my HA page... and in the next 0.64.0 dev too :(
To solve:
sudo systemctl stop [email protected]
sudo su -s /bin/bash homeassistant
source /srv/homeassistant/bin/activate
pip3 install -U https://github.com/rytilahti/python-miio/archive/master.zip
exit
sudo systemctl start [email protected]
and now I can use the Philips Lamp as previously (0.59.0)
@km4lin You setup looks good. The device was discovered properly and should be accessible.
@Sergey-SRG Your issue is a duplicate of #12298.
Use hassio.
- platform: xiaomi_miio
name: Xiaomi Philips Lamp
host: 192.168.0.86
token: 96674bf0954339454d343eb9f3c9433f
@syssi ok, but why i'm having this error and warning?
@km4lin The device doesn't respond to the first request sometimes. The connection is established on the second try cp. https://github.com/rytilahti/python-miio/issues/210
@syssi Thank you very much for help, I have been tested on and off function and the light is working.
btw: is there some advice how to change brightness or color temperature of this light?
Please close the issue.
Just click on the device name. A overlay appears. You can change brigthness and the color temperature here.
If you use hassio
SSH into your Raspberry Pi. Open an interactive shell on your home-assistant container (docker exec -it homeassistant /bin/bash) and try to execute the commands again:
pip3 install python-miio
@syssi Oh, i needed to add the device into one of the group. Thank you very much for your help! :) 馃