本帖最后由 leon_xi 于 2020-11-5 14:19 编辑
安装sshpass配置
shell_command:
install_sshpass: apk add --update --no-cache sshpass
script:
install_sshpass:
sequence:
service: shell_command.install_sshpass
automation:
- alias: install_sshpass
initial_state: true
trigger:
platform: homeassistant
event: start
action:
- service: shell_command.install_sshpass
开关ESXi Server配置
shell_command:
shutdown_esxi: sshpass -p yourpassword ssh -o stricthostkeychecking=no -p22 [email protected] 'poweroff'
script:
shutdown_esxi:
sequence:
service: shell_command.shutdown_esxi
switch:
- platform: wake_on_lan
name: exsi server
host: "192.168.0.3"
mac: "18:66A:05:F2:FD"
turn_off:
service: shell_command.shutdown_esxi
|