Hi,
I have created a button to turn off Home Assistant and I show it to you:
Testing the new button function. I just have to call the service hassio.host shutdown, this is Poweroff the host system.
Me at the time of a storm for example. I usually turn off my equipments. I needed a quick shutdown function. At the moment it works perfect in my HA.
Please, opinions, suggestions, ideas and discussion on shutting down HA. Thanks.-
Code:
type: button
tap_action:
action: call-service
service: hassio.host_shutdown
service_data: {}
target: {}
show_state: false
show_icon: true
name: Apagar sistema
icon: mdi:power
hold_action:
action: none
icon_height: 30px
February 5, 2022 UPDATE
I’m going to add a confirmation, to avoid accidents.
I am going to use “Options For Confirmation” of Actions.
Source: Actions-HA
and the code is this:
type: button
tap_action:
action: call-service
confirmation:
text: confirm HA shutdown
service: hassio.host_shutdown
service_data: {}
target: {}
show_state: false
show_icon: true
name: Apagar sistema
icon: mdi:power
hold_action:
action: none
icon_height: 30px
A confirmation will be requested, the options will “yes” or “no”