本帖最后由 yufan 于 2017-12-12 14:16 编辑
环境:ubuntu16.04 PC机
小米智能家居套装(网关+门窗+人体...)
我们想要实现的目的是当我们打开门的时候,打开小米的网关灯,并实现自动变色。代码如下:
- alias: Good morning
initial_state: 'on'
trigger:
- platform: state
entity_id: binary_sensor.door_window_sensor_158d0001c0fa07
from: 'off'
to: 'on'
action:
- service: light.turn_on
data_template:
entity_id: "light.gateway_light_7811dcaf1e8a"
rgb_color: ['{{(range(0, 255)|random)}}','{{(range(0, 255)|random)}}','{{(range(0, 255)|random)}}']
然后开了门之后并没有动静,还报了这么个错:
2017-12-08 17:48:44 ERROR (Thread-13) [PyXiaomiGateway] Got error element in data {"error":"Invalid key"}
求诸位老爷给看看什么原因0.0
|