本帖最后由 q3213092 于 2023-4-3 23:31 编辑
请教各位大佬,纯小白,论坛抄了两个开关。单独用都好用,但是都放到configurantion中,就报错,求助。
switch:
#远程唤醒家里PC电脑开关
- platform: wake_on_lan
name: "台式电脑"
mac: "xxxxxx"
host: xxxxx
turn_off:
service: shell_command.turn_off_pc
shell_command:
turn_off_pc: 'curl -X GET http://xxxxxxxxxx:5001/?action=System.sleep'
#Apple TV的开关
- platform: template
switches:
appletv:
unique_id: my_unique_id
friendly_name: "Apple Tv"
value_template: "{{ is_state('media_player.wo_shi', ['playing','idle']) }}"
turn_on:
service: remote.send_command
data:
command: wakeup
target:
entity_id: remote.wo_shi
turn_off:
service: media_player.turn_off
target:
entity_id: media_player.wo_shi
data: {}
复制代码
提示配置无效:
Error loading /config/configuration.yaml: while parsing a block mappingin "/config/configuration.yaml", line 3, column 1expected <block end>, but found '<block sequence start>'in "/config/configuration.yaml", line 35, column 3