Skip to content

Install with AppDaemon4 and Home Assistant

jbouwh edited this page May 20, 2021 · 1 revision

AppDaemon4 is Phyton based framework for running Python applications as a service. It has an integration with MQTT and The Home Assistant API. Applications can be configured using a central yaml file. If your application is upgraded or your configuration is changed, AppDaemon automatically detects this and reloads the changed modules. When the configuration is changed, AppDaemon will call the applications terminate() hook and and will call initialize after the change has been completed. This makes it very user friendly in use. Assuming you will use AppDaemon4 in combination with Home Assistant it is good to know you can install AppDaemon from the built-in Home Assistant Community Add-ons. The README.md shows how to do the configuration for AppDaemon it self.

Downloading and installing

After you have set up AppDaemon download the latest release of Omnik Data logger here. For a manual install, unzip in the folder /config/appdaemon/. The program files then will be installed in /config/appdaemon/apps/omnikdatalogger/*. Only these files are needed from the zip, you can delete the rest of the files in the zip. Installing of the code with Home Assistant requires requires an addon to access Home Assistant. Advised addons for file access are:

  • Terminal & SSH: Use SFTP (FTP over SSH) using a supported client, such as winscp or use the terminal and download the zip from the command line using the command's: wget {url-to-download} and unzip {downloadedfile}.zip. To use Terminal & SSH it is advised to create a key pair en configure the public key for access. An alternative is settin a username and password for access. The advantage of this plugin is that there is alse a web interface for the terminal that integrates with Home Assistant.
  • Samba Share: Use Windows explore to map a drive to your install. I have never tried this add on my self, but this should work too.

For the conveniance of an ease upgrade you can also install Omnik Data logger with HACS, The Home Assistant Community Store. This setup will take some time but will save you time when updates are to be installed.

Configuration of Omnik Datalogger using AppDaemon4

The location of the config file for Omnik data logger, when used with Home Assistant is /config/appdaemon/apps/apps.yaml. An example is in the README.md. The configuration of all AppDaemon apps has to be configured through this file. To tell AppDaemon to call Omnik Data Logger make sure you enter at least module and class like in the following configuration:

# The instance name is omnik_datalogger, this can be changed. Multiple instances are supported.
omnik_datalogger:
# General options
  module: omniklogger
  class: HA_OmnikDataLogger
# Example how the sections, keys and lists are configured.
# Do not copy this in your configuration!
  default_key: test
  section:
    key: keyvalue
    list:
      - list_entry1
      - list_entry2

This is similar to:

[default]
  default_key = test
[section]
  key = keyvalue
  list = list_entry1, list_entry2

module and class are hardcoded identifiers. They must be present in the yaml configuration:

module: omniklogger
class: HA_OmnikDataLogger

Make sure te use a single quote (') around numbers if they are used as key's. It is still possible to configure config.ini or combine with yaml, but that is not advisable, when using AppDaemon.

To be able to easily edit the configuration with Home Assistant use the 'File editor' add-on from the built-in store of Home Assistant.