Skip to content

Instantly share code, notes, and snippets.

@willwhui
Last active January 20, 2018 08:59
Show Gist options
  • Save willwhui/26990b37b2fdbd43d2e68f6f550691d1 to your computer and use it in GitHub Desktop.
Save willwhui/26990b37b2fdbd43d2e68f6f550691d1 to your computer and use it in GitHub Desktop.
利用hass的shell_command重启hass服务
@willwhui
Copy link
Author

willwhui commented Jan 20, 2018

收尾

增加一个启动时删除flag文件的自动化规则,以防万一陷入无限重启:

- alias: "Restart hass: remove flag after restarting"
  #hide_entity: true
  trigger:
      - platform: homeassistant
      event: start
  action:
    - service: shell_command.remove_restart_hass_flag

对应的shell command很简单:

remove_restart_hass_flag: rm -f ~/.homeassistant/flags/restart.flag

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment