Skip to content

Instantly share code, notes, and snippets.

@cogneato
cogneato / recovery.md
Last active January 5, 2024 07:46
Hassio Recovery

Recovery

Unless your SD card/data is corrupted, you can still get to your files or troubleshoot further. There are a few routes:

  • Connect a usb keyboard and hdmi monitor directly to the pi
  • Setup debug access to the host or if you're running a VM install, connect using a terminal which your hypervisor provides.
  • Remove the SD and access the files from another machine (preferably one running Linux)

Connect directly

Unfortunately, unless you're lucky and it comes right up, you're more than likely going to have to pull power on your pi in order to get your monitor recognized at boot. Pulling power has a risk of corrupting the SD, but you may not have another option.

Easiest method for Wifi on HassOS

If you are having problems creating a working network keyfile or importing the keyfile, this alternate method might work for you. It could also be that you have some other problem so this is not a "cure-all" for your wifi/network issues.

NOTE: This method assumes you already have a working ethernet connection

This page appears long but that's because I'm trying to cover all the small details. The process is very simple, really and doesn't take much time at all.

The short version:

  1. Install the SSH & Web Terminal Addon from the Community Repo (thanks, @frenck!)

An update has been released! Why can't I see it?

Hassio is available on many machine types/SBCs and it takes time to render each image per board after Home Assistant itself has been updated.

stable: https://s3.amazonaws.com/hassio-version/stable.json

beta: https://s3.amazonaws.com/hassio-version/beta.json

When the version is visible there, the Supervior will find it and present an "update available" card on the Hass.io dashboard. You can force Supervisor to check by reloading the Supervisor at Hassio>System>Hass.io supervisor in the UI, or hassio su reload in the CLI.

Home Assistant OS Snapshots

Snapshots are easily made in Home Assistant OS and are a service that can be automated. These can be made from the UI or the CLI (see below). They are stored in the /backup directory. Having snapshots handy will make it much easier on yourself. You can make changes without fear!

A full snapshot includes the following directories:

  • config
  • share
  • addons (the manually installed or created addons)
  • ssl

Home Assistant OS FAQ

Frequently asked questions from the Discord channel

This first one isn't a question, but a strong recommendation:

INSTALL ONE OF THE SSH ADDONS

Pick one from either the official repo or the community repo (recommended) and install it, set up a user/pass or key, and then forget about it if you want. But leave it running and set to run at startup.

I run in a VM and already have SSH access. Why would I need to do that?

The ssh addons provide access to the Hassio custom CLI which includes the proper method of starting and stopping Home Assistant, in addition to ways to explore and manipulate snapshots, addons, check logs and move from one version to another. This is extremely useful when you lose the UI due to a misconfiguration, or even when you have stopped the Home Assistant server from within the UI. You will be glad you have the custom CLI when you need it.

Alternate method for Wifi on HassOS

If you are having problems creating a working network keyfile or importing the keyfile, this alternate method might work for you. It could also be that you have some other problem so this is not a "cure-all" for your wifi/network issues.

Set up access over ssh to the host.

This is not the same access as using the ssh addon. The connection to the host happens on port 22222 and requires that you import an authorized_keys file to your system as described here: https://developers.home-assistant.io/docs/en/hassio_debugging.html

Or, you could connect a keyboard and monitor to your device running HassOS and connect to the host that way.

@cogneato
cogneato / 0_reuse_code.js
Created February 25, 2017 22:08
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console