Restart HASS

Hi all,

Playing around with HASS.IO. Many times (not all the time), when I update something in my config, check the config and then try to restart, the circle keeps spinning on restart.
SSH is still up, when I reboot the pi. I loose SSH, but still HASS is down. Only way to recover is to pull the plug.

Is there a way to restart HASS from SSH, without having to reboot the rPi?

edit: okay, found it: hassio homeassistant restart

Still, very inconvenient that HASS hangs when trying to restart from the GUI. Anyone else having this problem?

4 Likes

Run the command
docker restart homeassistant

7 Likes

+1 for this issue. Happens often for me also.

6 Likes

It used to fail the first time I tried it in my previous version as well, but it would just spin for a bit, then say failed. I used to have a switch to restart hass, might have to add that once again.

@hijinx the docker commands don’t work for us Hass.io users; at least not that I have found. We are locked out of most of the Pi.
@boneless comand line “hassio help” for a list of our limited Hass.io tools.

Maybe it’s a resinos on rpi thing?
I deployed hass.io on ubuntu and can use the docker cli tool.
On the flip side I was not able to use hassio command - maybe my PATH needs to be updated?

2 Likes

For me:

docker ps to find the name of the container to restart.
Then docker restart

hassio command is not in path, so wont run.

james@hassio:/var$ docker ps
CONTAINER ID        IMAGE                                    COMMAND                  CREATED             STATUS              PORTS                    NAMES
3df82fcd7b51        grafana/grafana                          "/run.sh"                11 hours ago        Up 11 hours         0.0.0.0:3000->3000/tcp   addon_f3248fb7_grafana
a4d90cb52901        homeassistant/qemux86-64-homeassistant   "/usr/bin/entry.sh..."   11 hours ago        Up 11 hours                                  homeassistant
f76beb64d372        bestlibre/amd64-influxdb                 "/usr/bin/entry.sh..."   11 hours ago        Up 11 hours         0.0.0.0:8086->8086/tcp   addon_53caca22_influxdb
345f715150b4        homeassistant/amd64-hassio-supervisor    "/usr/bin/entry.sh..."   22 hours ago        Up 22 hours                                  hassio_supervisor
3f9abe1edaeb        27e642c6/amd64-addon-nodered             "/run.sh"                4 days ago          Up 4 days           0.0.0.0:1880->1880/tcp   addon_27e642c6_nodered
f22452d54e6e        f3248fb7/amd64-addon-dasher              "/usr/bin/entry.sh..."   8 days ago          Up 8 days                                    addon_f3248fb7_dasher
d031a37085cc        portainer/portainer                      "/portainer"             9 days ago          Up 9 days           0.0.0.0:9000->9000/tcp   epic_newton
2ebce7c01a06        homeassistant/amd64-addon-samba          "/usr/bin/entry.sh..."   2 weeks ago         Up 2 weeks                                   addon_core_samba
james@hassio:/var$
james@hassio:/var$ docker restart homeassistant


james@hassio:/var$ hassio
hassio: command not found
james@hassio:/var$

Could be due to ubuntu rather than resinos?
Maybe im not using hass.io properly: :thinking:
Either way though the above works for me :slight_smile:

Don’t know if it’s just a coincidence but I had this issue a few times early on but haven’t had it since I started just using restart from within the Haas.io tab dropdown rather than any of the many other restart buttons we now have.

1 Like

agree - this has been working for me perfectly over last few days.
Apart from when I messed up my config.

On that point, the GUI simply not loading with a 1 line typo in config is really quite unacceptable.
It would be much much nicer to start in “safe mode” and at very least visualise the log.

3 Likes

I got caught like that first day, left a colon off and couldn’t get to the config to correct it. Wiped card and started again, making sure the first thing I did was install SSH and samba, as long as the core starts you get second chance :slight_smile:

A safe mode function is a great idea!

Thanks.
I just raised it as a feature request…

1 Like

i got this problem too but since i moved from restart hass.io by config -> config -> server management : restart to restarting it by the 3-dot menu at the hass.io page i had no troubles.

hopefully you understand what i mean. :wink:

This you mean?

image

Same issue for me.

I’ll just log into ssh for now, but seems like a bug to me.

edit: Might have been to eager there :). It worked now (helps not making errors in your config :slight_smile: ). Thanks for the help y’all.

Yep, that’s the one.

I’m pretty sure I installed hass.io with the all-in-one-installer. I have not had any issues restarting Hass.io with either the CLI or any of the UI links, unless of course there was a problem with the config, then I had to fix it and use the CLI.

@hijinx this is my CLI:

And you can see from this, that I cannot access docker with my Hass,io configuration from the all-in-one install. It would be nice. Maybe it is a setting, but I cannot access most of what the regular Home Assistant people are doing in their CLI.

It just clicked :slight_smile:
What you see there is a CLI inside the home assistant docker container.
What I have been using is a CLI on the docker host - for me ubuntu. Not sure if you can even login to the ResinOS CLI on a RPi install…

1 Like

@hijinx It has been very frustrating for me to look to the documentation or forums for answers because there are usually bunch of CLI commands involved that I cannot even get to with the all-in-one version of hass.io. I think the goal is to get it’s users away from CLI and do everything with the UI, but it is not that ready yet. For instance, I tried the tutorial to “create your own addon”.

https://home-assistant.io/hassio/addon_tutorial/

It does not work for me, The log error message says it can’t read “/data/addons/local/hello_world/config.json”, but I can’t even get to the data folder and the json file is just a cut and paste from the instructions. Very frustrating. I would go back and just load Hass.io on top of Ubuntu like you did , but I don’t think that is the future for me.

I’m fairly new at this and I’m working with the latest version (0.51.2) but I’m having trouble restarting HA after I make configuration.yaml changes (sounds similar to what’s described above).

After you change the config, save it, and then validate it you just need to restart it with the menu you screenshot above right? I feel like I’m missing something…

If I do those steps, my UI never comes back up.

@JSCSJSCS, /resin-data/addons/local on the host is equivalent /addons in the ssh addon and equivalent to the addons share via samba.

@NotoriousBDG Thank you for that. After trying the tutorial I mentioned, I get errors in the log as:

WARNING (MainThread) [hassio.addons.data] Can't read /data/addons/local/hello_world/config.json

But I put my “hello_world” addon in the addons folder per the tutorial. Somehow another directory “/local/” is being thrown into the mix it seems and I don’t know why. The config.json file was just cut and pasted from the tutorial, so I don’t know if that is the issue or a problem with the way Hass.io directory folders are redirected/aliased.