- 积分
- 234
- 金钱
- 221
- 威望
- 0
- 贡献
- 0
- HASS币
- 0
中级会员
- 积分
- 234
- 金钱
- 221
- HASS币
- 0
|
发表于 2021-1-26 03:51:05
|
显示全部楼层
philips.light.cbulb
siid 2: Light
piid 1: Switch Status 可读取 可控制
数据类型:bool
piid 2: Brightness 可读取 可控制
数据类型:uint8
取值范围:[1, 100, 1]
piid 3: Color 可读取 可控制
数据类型:uint32
取值范围:[0, 16777215, 1]
piid 4: Color Temperature 可读取 可控制
数据类型:uint32
取值范围:[1882, 7000, 1]
piid 5: Mode 可读取 可控制
数据类型:uint8
取值范围:
0: None
1: Reading
2: Warmth
3: Night
4: Color
设置如下:
- platform: xiaomi_miot_raw
name: 落地灯
host: 192.168.
token:
mapping:
switch_status:
siid: 2
piid: 1
brightness:
siid: 2
piid: 2
color:
siid: 2
piid: 3
color_temperature:
siid: 2
piid: 4
mode:
siid: 2
piid: 5
params:
switch_status:
power_on: True
power_off: False
brightness:
value_range: [1, 100, 1]
color:
value_range: [0, 16777215, 1]
color_temperature:
value_range: [1882, 7000, 1]
mode:
0: None
1: Reading
2: Warmth
3: Night
4: Color
报错如下:
xiaomi_miot_raw: Error on device update!
Traceback (most recent call last):
File "/opt/homeassistant/lib/python3.7/site-packages/homeassistant/helpers/entity_platform.py", line 359, in _async_add_entity
await entity.async_device_update(warning=False)
File "/opt/homeassistant/lib/python3.7/site-packages/homeassistant/helpers/entity.py", line 466, in async_device_update
await task
File "/home/homeassistant/.homeassistant/custom_components/xiaomi_miot_raw/light.py", line 214, in async_update
self._color_temp = color.color_temperature_kelvin_to_mired(self._state_attrs['color_temperature'])
File "/opt/homeassistant/lib/python3.7/site-packages/homeassistant/util/color.py", line 515, in color_temperature_kelvin_to_mired
return math.floor(1000000 / kelvin_temperature)
ZeroDivisionError: division by zero |
|