Skip to content

Manual install using git or download (Windows Linux)

jbouwh edited this page May 20, 2021 · 1 revision

Manual installation

You can download te latest Omnik data logger release as a ZIP file or use:

git clone https://github.com/jbouwh/omnikdatalogger

to get the latest master update.

In any case you need to have a recent working Python 3 installation. Version should be 3.7+.

For Omnik data logger additional you will need to to install the following python libraries:

  • configparser
  • requests
  • cachetools
  • pytz
  • paho-mqtt

Use pip to install the comply to the requirements using:

  • pip3 install configparser requests cachetools pytz paho-mqtt (Windows)
  • sudo pip3 install configparser requests cachetools pytz paho-mqtt (Linux) Pip is included with Python3 for Windows. On linux you can add pip support using the command sudo apt-get install python3-pip.

If you sucessfully installed pip3, consider using pip3 to install omnikdatalogger or omnikdataloggerproxy

Install using git

Make sure to install git at your host. Using Linux use your packet manager to install git. On Debian based systems (such as Raspbian and Ubuntu) and can use sudo apt-get install git. On windows install git for windows. To get the latest master use git clone https://github.com/jbouwh/omnikdatalogger' to get the software To checkout to a specfic stable version, in the sub folder subsequently enter e.g. git checkout tags/v0.96-RC3. To revert to the latest update use the command: git checkout master. To update you local install use git pull origin master followed by git checkout tags/v0.96-RC3.

Install using a download

Download a stable release of the source [from here] and unzip it using your favorite archive tool.

Usage

Run the application from the command line

The actual code base of Omnik Data Logger can be found under apps/omnikdatalogger/*. This structure is needed to make it compliant with the Home Assistant Community store.

The active script apps/omnikdatalogger/omniklogger.py requires Python 3.7 or higher!

Start it with the command: python3 apps/omnikdatalogger/omniklogger.py from the main directory folder.

When using the command line you can only pass the path of config file, the interval and enable debug messages. The use of a config file is critical when using the omniklogger.py script. When using AppDaemon, the use of a config.ini is not required.

Command line arguments

There are no required arguments since you can define every thing using the the configuration file. If you not pass the the configuration file as an argument, Omnik data logger tries to read the configuration from ~/.omnik/config.ini or C:\Users\{username}\.omnik\config.ini. An error will occur if no valid configuration file could be opened.

There are only a few command line arguments. The rest of the configuration should be in the configuration file.

The command line arguments accepted include:

  • --config to pass the pasth of the config.ini file
  • --debugto enable debug messages. Very handy during setup.
  • --interval. Without a defined interval the application will only run for one iteration. Handy for testing and if your script is to be executed form another script.

Install as service using systemd

Instructions and a service template are provided here. Make sure to update the script and configuration file location in the service script before you install it.

Edit, adjust and then copy or link omnikdatalogger.service to /lib/systemd/system/omnikdatalogger.service

Next, enable and start service:

$ sudo systemctl enable omnikdatalogger
Created symlink /etc/systemd/system/multi-user.target.wants/omnikdatalogger.service → /lib/systemd/system/omnikdatalogger.service.
$ sudo systemctl start omnikdatalogger

Check if omnikdatalogger.service is running correctly:

$ systemd status omnikdatalogger
● omnikdatalogger.service - Omnik Data Logger service
   Loaded: loaded (/lib/systemd/system/omnikdatalogger.service; enabled; vendor preset: enabled)
   Active: active (running) since Tue 2019-06-18 06:55:08 UTC; 4min 36s ago
 Main PID: 2445 (python3)
    Tasks: 2 (limit: 4915)
   CGroup: /system.slice/omnikdatalogger.service
           └─2445 /usr/bin/python3 /usr/local/bin/omniklogger.py --config /etc/omnik/config.ini --interval 360

General configuration

Omnik data logger needs the minimal configuration te be able to work:

  • Configure the city key in the [default] section. This value defaults to 'Amsterdam' (GMT+1), change this to a city recognized by the Phython Astral module. This setting influences client types use polling to fetch data. Omnik datalogger will disable polling when the sun is down to avoid unnecessary
  • Configure the interval key in the [default] section. Without this an interval the application will only run for one iteration.
  • Configure the client key in the [plugins] section. Valid clients are valid clients are localproxy, omnikportal, solarmanpv and tcpclient
  • Configure the client specific settings in the corresponding section.

If you are a beginner and you have an Omnikportal account, then you are advised to start testing using the omnikportal client. This client only needs username and password to be setup in the section [client.omnikportal]

Your minimal config.ini could look like:

[default]
#city=Amsterdam
#interval=360

[client.omnikportal]

username = your_username
password = your_password

[plugins]
#output=pvoutput
client=omnikportal

Output plugins can be configured later.

More information about the general configuration options you can find here.