Posts

Home Assistant default_config

At some point during your Home Assistant journey you will probably want to replace the default_config: line in your configuration.yaml file with a config of your own. I didn't manage to find a replacement for the default_config: oneliner in the internet, so I made this config based on the default configuration help page . Just replace the oneliner with all this and the configuration should stay the same.  Note that in the case of Home Assistant changing the default config, this post will become outdated, so be sure to give the help page a glance before you do that. If some of these entries are already present in your config, remove or comment them with the hash character #, for example #script: instead of script: If you're running Home Assistant OS, then comment or remove the backup: entry, or you will get an error in the logs. That entry isn't supported on the HAOS due to HAOS having a slightly different backup system. However, you will be able to do backups just fine

Changing the crontab editor in Home Assistant SSH terminal

Here is how to change the default editor on an Home Assistant OS installation. When you SSH to a Linux machine and want to edit crontab, there is an environmental variable which decided which text editor to use. I personally like to use nano as the editor. On my Home Assistant I have set up the SSH Web Terminal for terminal access to the system. After connecting with an SSH client (such as PuTTY ) one can edit crontab with the command: crontab -e   The default editor for HA OS seems to be vim(?). In order to quit editing the crontab with vim, press ESC and then :q and press enter. Now to change the editor. Edit the .zshrc file: nano ~/.zshrc Add the following line to .zshrc: export EDITOR='nano' Exit nano by pressing Ctrl-X and then selecting Yes to save modified file. You can then try which editor opens when you again type: crontab -e

Adding the system monitor sensors to Home Assistant

 Just add these lines to your configuration.yaml file: sensor:   - platform: systemmonitor     resources:       - type: disk_use_percent         arg: /config       - type: memory_use_percent       - type: swap_use_percent       - type: load_1m       - type: load_5m       - type: load_15m       - type: network_in         arg: eth0       - type: network_out         arg: eth0       - type: processor_temperature       - type: last_boot   Then check and reload your YAML configuration by restarting Home Assistant Core. You can find this on the page Developer Tools on the tab YAML. After that you will have sensors for processor load, memory usage, disk usage, network in and out bytes, processor temperature (if supported) and the time of last boot. For more options and info check this help page .

Home Assistant on a Raspberry Pi 4 with an SSD

Some time ago I decided to try out Home Assistant for the first time, and I have been very pleased with it. My choice for the server machine was the Rapberry Pi 4 running Home Assistant OS. At first, I tried it out with an SD card, but that setup proved to be very unstable. This seems to be the major gripe with most Raspberry Pi installations. Even with the official power supply and a proper branded SD card the system will eventually die, just because of the high amount of writes the SD card has to endure.  In my opinion, a Raspberry Pi running from an SD card is only stable if you can configure the SD card to be read only. That is not possible with Home Assistant, so another storage medium is needed. After the card corrupted for the third time I decided to get a small 256GB USB SSD drive, and with that the system has been very stable indeed.  The installation method for an SSD drive is exactly the same as with an SD card. After flashing the SSD you just plug that in and connect you Pi