|
发表于 2019-9-21 12:00:41
|
显示全部楼层
现在是搞不明白,switch文件夹下一个yaml中多个实体应该怎么写,不管我怎么写都报错
configuration.yaml 中 switch:!include_dir_list switches
/switches/shufangTC1.yaml 内容如下
-platform: mqtt
name: 'tc1_1'
state_topic: 'homeassistant/switch/d0bae46412c1/plug_0/state'
command_topic: 'device/ztc1/set'
payload_on:'{"mac":"d0bae46412c1","plug_0":{"on":1}}'
payload_off:'{"mac":"d0bae46412c1","plug_0":{"on":0}}'
-platform: mqtt
name: 'tc1_2'
state_topic: 'homeassistant/switch/d0bae46412c1/plug_1/state'
command_topic: 'device/ztc1/set'
payload_on:'{"mac":"d0bae46412c1","plug_1":{"on":1}}'
payload_off:'{"mac":"d0bae46412c1","plug_1":{"on":0}}'
报错 ERROR (MainThread) [homeassistant.config] Invalid config for[switch]: expected a dictionary. Got [OrderedDict([('platform', 'mqtt'), |
|