Home Assistant on emonPi

Glyn - I started working with Home Assistant. I am experiencing a few learning issues with new things like the YAML file for configuration. Very confusing for me! It looks like the HA group is working to improve the config experience. Yay! :slight_smile:

Anyway I’ve been going thru the code and trying to get the SD card write usage down so HA can run on the low-write emonPi.

Here are all of the troublemakers:

I know I can do a tmpfs for the /var/log items.

What do you recommend these files?

  • /home/homeassistant/.homeassistant/home-assistant_v2.db
  • /run/log/journal/a000fb2422f348bbb1438757905c2ee0/system.journal

I think the home-assistant_v2.db is going to need to live in the /home/pi/data directory.

But what about the system.journal file - what did you do with that file on the emonPi?

Glyn - On the emonPi (and in the Home Assistant) I can see a 100MB swap file is being setup at /var/swap. It is not in the tmpfs areas. Is this correct? Should swap be turned off?

Below is the daemon.log for the emonPi:

Mar 9 10:58:16 emonpi systemd[1]: Started Avahi mDNS/DNS-SD Stack.
Mar 9 10:58:16 emonpi systemd[1]: Starting LSB: emonPi LCD controller…
Mar 9 10:58:16 emonpi systemd[1]: Starting LSB: mosquitto MQTT v3.1 message broker…
Mar 9 10:58:16 emonpi systemd[1]: Starting LSB: Autogenerate and use a swap file….
Mar 9 10:58:16 emonpi systemd[1]: Starting LSB: Start/stop sysstat’s sadc…
Mar 9 10:58:16 emonpi systemd[1]: Starting LSB: Start/stop emonHub…
Mar 9 10:58:16 emonpi systemd[1]: Started System Logging Service.
Mar 9 10:58:16 emonpi systemd[1]: Started Restore Sound Card State.
Mar 9 10:58:16 emonpi systemd[1]: Started Login Service.
Mar 9 10:58:16 emonpi dphys-swapfile[514]: Starting dphys-swapfile swapfile setup …
Mar 9 10:58:16 emonpi systemd[1]: Started LSB: Start/stop sysstat’s sadc.
Mar 9 10:58:16 emonpi mosquitto[513]: Starting network daemon:: mosquitto.
Mar 9 10:58:16 emonpi systemd[1]: Started LSB: mosquitto MQTT v3.1 message broker.
Mar 9 10:58:16 emonpi emonPiLCD[512]: Starting system emonPiLCD daemon:.
Mar 9 10:58:16 emonpi systemd[1]: Started LSB: emonPi LCD controller.
Mar 9 10:58:16 emonpi dphys-swapfile[514]: want /var/swap=100MByte, checking existing: keeping it
Mar 9 10:58:16 emonpi dphys-swapfile[514]: swapon: /var/swap: swapon failed: Read-only file system
Mar 9 10:58:16 emonpi dphys-swapfile[514]: done.
Mar 9 10:58:16 emonpi systemd[1]: Started LSB: Autogenerate and use a swap file.
Mar 9 10:58:17 emonpi avahi-daemon[458]: No service file found in /etc/avahi/services.
Mar 9 10:58:17 emonpi avahi-daemon[458]: Network interface enumeration completed.

Sorry, it’s been a while since I tested HA. The project looks like it has developed a lot since I had a play with it. I recomend you post public on the forum or try on the HA forum.

Sorry - I should have been more clear. I wasn’t looking for the HA answers. Just how you currently do things with emonPi.

home-assistant_v2.db - This seems similar to the emonPi phpfina and phptimeseries files and I think I’ll add it to the /home/pi/data directory. And add a symbolic link with /home/homeassistant/.homeassistant/home-assistant_v2.db.

system.journal - looks like it is in the emonPi tmpfs /run directory.

The swap file is an unknown for me… I was curious if emonPi should have it turned on. I looks like it is turned on.