使用 HomeAssistant 远程切换电脑
最编程
2024-05-05 16:41:01
...
switch:
- platform: wake_on_lan
name: pc_a # 电脑别名
mac: "00:XX:XX:XX:XX:X1" # 电脑MAC
host: "192.168.X.XX1" # 电脑IP
turn_off:
service: shell_command.turn_off_pc_a
- platform: wake_on_lan
name: pc_b
mac: "00:XX:XX:XX:XX:X2"
host: "192.168.X.XX2"
turn_off:
service: shell_command.turn_off_pc_b
shell_command:
turn_off_pc_a: 'curl -X GET http://192.168.X.XX1:8000/?action=System.Shutdown'
turn_off_pc_b: 'curl -X GET http://192.168.X.XX2:8000/?action=System.Shutdown'