Some questions arround Home Assistant

Hello,

I have been running a Home Assisant in a docker on my QNap for about 2 months now and am in the process of customization.

I want to save my whole Home Assistant instance and have learned that in Hassio under Addon there is an area where you can create snapshots. Since I have a docker installation, I don’t have an addon area. I’ve often wondered if it’s possible to make addons available for the Docker installation.

I backup the config directory at regular intervals, but I prefer a complete backup, which can also be restored.

I’m also working on an automation that will turn on the Yeelight, PS4, LG projector and Yamaha AV receivers when you enter a room (I wanted to do this with a door sensor). Turn on the Yeelight and the AV receiver, no problem, but just don’t manage to turn on the Playstaion and the beamer (PS via LAN, beamer via wifi). As soon as I switch off the Playstation, everything else should also be switched off. To realize this with HDMI CEC as well, I haven’t succeeded yet.

The last thing I’m trying to do is create an alarm control in three automations. These include armed home / armed away, the actual alarm and disharm the alarm. I´m wondering if there is a way to put it one script and just trigger the script when alarm has been triggered in specified condition.

My automations look like this:

 alias: alarm
  trigger:
  - event_data:
      entity_id: binary_sensor.vibration_eg_wz
      movement_type: vibrate
    event_type: xiaomi_aqara.movement
    platform: event
  - event_data:
      entity_id: binary_sensor.vibration_eg_ez
      movement_type: vibrate
    event_type: xiaomi_aqara.movement
    platform: event
  - event_data:
      entity_id: binary_sensor.vibration_ug_laundry
      movement_type: vibrate
    event_type: xiaomi_aqara.movement
    platform: event
  - event_data:
      entity_id: binary_sensor.vibration_eg_frontdoor
      movement_type: vibrate
    event_type: xiaomi_aqara.movement
    platform: event
  - entity_id: binary_sensor.motion_eg_stairway
    from: 'off'
    platform: state
    to: 'on'
  condition:
condition: or
conditions:
- condition: state
  entity_id: alarm_control_panel.home_alarm
  state: armed_home
- condition: state
  entity_id: alarm_control_panel.home_alarm
  state: armed_away
  action:
  - data:
      message: Alarm
       service: notify.mshomeasstbot

alias: alarm_disarm
  trigger:
  - entity_id: alarm_control_panel.home_alarm
    from: armed_home
    platform: state
    to: disarmed
  - entity_id: alarm_control_panel.home_alarm
    from: armed_away
    platform: state
    to: disarmed
  - at: 06:00
    platform: time
  condition: []
  action:
  - data:
      gw_mac: 04CF8C8F9544
    service: xiaomi_aqara.stop_ringtone
  - data:
      message: Alarm has been disarmed / disabled
      service: notify.mshomeasstbot

alias: alarm_ready
  trigger:
  - entity_id: alarm_control_panel.home_alarm
    from: disarmed
    platform: state
    to: armed_home
  - entity_id: alarm_control_panel.home_alarm
    from: disarmed
    platform: state
    to: armed_away
  - at: '23:00'
    platform: time
  condition: []
  action:
  - data:
      color_name: red
      entity_id: light.gateway_light
    service: light.turn_on
  - data:
      message: Die Alarmbereitschaft ist aktiviert
    service: notify.mshomeasstbot

Thanks in advance

Not unless you are running hassio.

If you aren’t running hassio, there is nothing else to backup but the config.

Hi flamingm0e.

thanks for your reply. What about custom themes and all entries stored in a database?

The database is located in a file in your config directory, and it is merely HISTORY, and not really important.

Entities are stored in the registry, inside .storage in your config directory.

Themes would be stored in your config directory.

All you need to do is backup your config directory.

To add to what flamingm0e said, Hass.IO runs in docker, so it’s absolutely possible for you to install full Hass.IO with the addons and everything on a machine with docker.

OK, I´ve never seen a docker available with HASS.IO.

I´m very confused that I just need to save the config folder for a backup. I´m aware of the location of the database, but is it so easy to restore a whole Home Assistant instance? I´ve never tried a restore before.

HassIO is a way of installing Home-Assistant inside docker. It includes a supervisor container and a container running Home Assistant. It allows you to install AddOns which are separate docker containers. The supervisor container of HassIO takes care of managing the other containers used for home assistant.

So, the most popular install on a RasPi is HassOS, which is:
HassOS->Docker->HassIO->Home-Assistant+AddOns

On other devices (such as desktops, laptops, servers, NUCs), HassIO is the popular choice, which is:
LinuxOS(usually)->Docker->HassIO->Home-Assistant+AddOns

It sounds like you just have Home-Assistant manually installed in a docker container maybe.

I run HassIO myself in Ubuntu, using Docker.

This is the docker install I use, though this gist is the full set of commands to do it from scratch on a bare linux machine.

The config directory is literally all you need to save to move from install to install.

The database is just history, it has nothing to do with the actual functionality, and is not required to be backed up, unless you want the history that goes with it.

Yes, it is EXTREMELY easy to restore. You just copy the directory (including the hidden .storage directory inside the config directory) to your new install.

1 Like

I use Home Assistant as a docker on my Qnap NAS. There I´m depended on the version which are published in their repository. There I didn´t find a version of HASS.IO yet. I have thought long and hard about installing Home Assistant on a Rasberry or NAS. Despite the advantages of an installation of HASS.IO, I decided to use the NAS because of the SD card problem in PIs after time and to implement it on a another device.

Ok, then I will continue to backup the entire content of the config directory. Thank you for the explaination.

Do you have any advice for the other two topics?

I don’t use any automations in HA

Anyone else with a clue?

Take a look at this: https://www.home-assistant.io/docs/automation/templating/

The biggest thing you need to do to make it easier to help you is format your code that you posted correcty. See the blue box at the top.

Then we can go from there.

@rccoleman: Thanks for the link.

@finity: I always notice the blue box on top while reading a thread, but was to blind while writing my own, sorry…:slight_smile:

I really doubt you can get away with everything in one script since every aspect of the automations are pretty different and incompatible.