How to turn off Home Assistant correctly?

Hi @bjorn.sivertsen ,

what i mean : to restart HA through UI after turning off HA through the service call.

Obviously if you’ve already shut down HA, the HA UI isn’t going to be available.

The best solution I’ve found (running HA on a headless server) is to use SSH:

The link above will bring you a little more than half-way down the page, to the section entitled Home Assistant via the command line.

I keep a text file handy with a list of common command-line commands that I use infrequently, so I don’t have to look them up each time.

1 Like

Thank you @CaptTom ,

“ha core start” under SSH will do the job with my supervised installation

Thanks for the explanation of the two differences: shutdown core and shutdown host.
So, the correct way to shutdown the system would be:

  1. shutdown core
    → ‘core stop’
    and after that
  2. shutdown host
    → ‘host shutdown’
3 Likes

That was a little confusing because it seemed like it didn’t work and I would just get little black square pop up in the lower left: Failed to call service hassio.host_shutdown. undefined.

Several minutes later and half of the web UI is broken, like Energy, Map, Media. Other options sit on loading forever. Notifications > Dismiss: Failed to call service persistent_notification/dismiss. undefined. Stuff on Overview still seems to work, but maybe it’s just cached.

Really it did work, there was just no good feedback that it had shutdown. Reloading the webpage and getting nothing proved it.

Is this the only way to power off a headless Home Assistant Operating System instance from the web UI?

I think that Settings > System > Shutdown/Reboot would make a lot of sense. And better feedback at the shutdown location that it is or seems to be shutdown.

Home Assistant Core 2022.6.6
HAOS 8.2

7 Likes

If you think the HA service can be improved then please consider putting in a feature request.

Took me a while to find it

System → Hardware (three dots)

28 Likes

I couldn’t find it in the GUI until I saw your post! Thank you!

Thanks, that finally did the trick! Most of the stuff above was just not where it was supposed to be :slight_smile:

I’m new to Home Assistant so it took me a minute looking for System to realize it was in the Settings (gear icon) menu.

Settings > System > Hardware (URL: /config/hardware)

I’m using Home Assistant Operating System on Raspberry PI, Home Assistant Core version 2022.7.3.

Thank you! Much simpler than running the command.

3 Likes

@Thorn
Thank you!!

The guys couldn’t hide it better :wink: Congratulations to the HA-Team!

3 Likes

Under config/hardware it just show a picture of my RPi4 but no buttons.

So cant see how I shutdown HA safely?

Re Dave

Wow! I would never have thought to look in the expanded menu in the right-hand corner!

Thank you for showing us!!

-Todd

1 Like

I have installed Home assistant 3 times with the vmdk file from here:

As I could not find how to switch off correctly, I shut down the server with : host shutdown
And when I stated the VM again the host is shown but no connection in the browser.
Reason was somehow explained above.
So I don’t want to set up the VM again and now
LOCKING for CORRECT way to shut this thing off and be able to restart it working

When I got intuitively to:
Settings > System > Hardware as described above, i have the following:


What to shut down first?
Following the above, it is nearly clear that it has to be:

shutdown core
→ ‘core stop’
and after that
shutdown host
→ ‘host shutdown’

But My screen shows

pls see above because of
new user can only…

What NOW?

Pls help a newbie to shut down the HomeAssistent

PS: Ahh! During writing, I can assume from all above that the command for

shutdown core
→ ‘core stop’

Is clearly not in this section but somewhere else in the menu structure where I’m sure normal user will find it again intuitively
But as I’m new with this server stuff I gladly ask to pls advise me newbie To the Steps for:
Shutting down Home Assistant
that it does not destroy the whole VM or maybe do much more harm on my PC or the whole network or Internet when I make a mistake doing the shut-down procedure incorrectly

Many THX

To shutdown the SYSTEM, you should be using shutdown host. The core will be automatically shutdown as part of that operation. I don’t understand why someone would shutdown the core first - I don’t think you can actually issue a command to shutdown the host (from the UI) after you have shutdown the core, because presumably the websocket connection is closed when the core is closed?

1 Like

THX, but I don’t know how to
shutdown the core
Pls be so kind and tell me the secret

I can tell you a very easy way to shutdown the core, but be warned - once you have done it - the only way to restart it is to connect to the server with SSH, or connect a keyboard and monitor to the machine and type ha core start

The easiest way to stop the core, is to click on the Dashboard and press c on the keyboard and type stop and choose Stop Server

EDIT: I think we would ALL really like to know WHY you want to shutdown the core, but not the host machine.

Phu…
Al I want is to be able to turn off my VM with Homeassistent. ( without destroying the whole machine as it happened in the last 3 times)
&
Be able to start it again and lock in with browser.

1 Like

Then you should probably file a bug report. I can shutdown my Home Assistant VM directly from Proxmox without having to do anything inside Home Assistant first. When you tell a machine (real or virtual) to shutdown, it will shutdown all the docker containers, before it actually properly shuts down. There is absolutely no reason it should be corrupting your disk image.

I Have it on VM Workstation without VM ware tools.
Following You, I simply should turn the VM OFF
grafik
Right