Package: omnikdatalogger
omnikdataloggerOmnik data logger enables you to log the data of your Omnik inverter combine the data with a Dutch or Belgian SLIMME METER and output the data Home Assistant using MQTT discovery.
You can also choose to log your data to pvoutput or an influx database or combine output options.See alsoOmnik data logger WikiOmnik data logger WebsiteInstallationThe application can be installed:Install with the Home Assistant Community StoreHACS.Omnik data logger is included in the default repository. Open the Automation tab. Click on de big orange+Search for 'Omnik data logger' and select it.Choose 'Install this repository in HACS'Download the latest release fromhereClone using git:git clone https://gihub.com/jbouwh/omnikdatalogger. Optional install withpip3 install ./omnikdatalogger.Install using pip (pip3) as user:pip3 install omnikdataloggerSystem install using pip (pip3):sudo pip3 install omnikdataloggerThe main application files are in the folderapps/omnikdataloggerUsageThe application can be configured using:Commandline (limited options available)Configuration file (config.yaml)apps.yaml configuration file (with AppDaemon)(This applies tot HACS-users)Commandlineusage: [python3] omniklogger.py [-h] [--config FILE] [--interval n] [-d]

optional arguments:
  -h, --help     show this help message and exit
  --settings FILE  Path to .yaml configuration file
  --section  Section to .yaml configuration file to use. Defaults to the first section found.
  --data_config FILE  Path to data_fields.json configuration file
  --persistant_cache_file FILE  Path to writable cache json file to store last power en total energy
  --interval n  execute every n seconds
  -l {DEBUG,INFO,WARNING,ERROR}, --loglevel {DEBUG,INFO,WARNING,ERROR} LoglevelDe default location for config using the commandline is~/.omnik/config.yaml.Configuration using apps.yaml (AppDeamon) (with possible HomeAssistant integration)Preparation for scheduled use with AppDaemon4This a new feature is the integration AppDaemon which makes an integration with Home Assistant possibleAppDaemon4 can be installed within the HomeAssistant environment using the Add-on store from the Home Assistant Community Add-ons
An alternative is appdaemon with pip. See:https://pypi.org/project/appdaemon/When AppDaemon is used with Home Assistant the following base configuration could be used:system_packages:[]python_packages:-cachetools-dsmr-parser-influxdb-clientinit_commands:[]log_level:infoThe dependency for cachetools is the only 'hard' dependency. Thedsmr-parserpackage is needed when you are using a Dutch Smart Meter (DSMR compliant) USB adapter. Please feel free to adjust the base log_level.When used with HACS the dependencies inrequirements.txtshould be installed automatically.The basescript omniklogger.py holds a class HA_OmnikDataLogger that implements appdaemon.plugins.hass.hassapi
See for more information and documentation about AppDaemon:https://appdaemon.readthedocs.io/en/latest/APPGUIDE.htmlThe configfile /config/appdaemon/appdaemon.yaml needs a minimal configuration. Further it is possible to define the location for your logfiles. And example configuration is:appdaemon:latitude:0.0longitude:0.0elevation:0.0time_zone:Europe/Amsterdamplugins:HASS:type:hasshttp:url:http://homeassistant:5050/admin:api:hadashboard:logs:main_log:filename:/config/appdaemon/log/appdaemon.logerror_log:filename:/config/appdaemon/log/appdaemon.errMake sure the url is accessible with the hostname you configure.Configuringapps.yamlto use Omnik Data Logger with AppDaemon4Install the datalogger files from git under /config/appdaemon/apps/omnikdataloggerThe base script is located at:/config/appdaemon/apps/omnikdatalogger/omniklogger.pyNext step is to configure AppDaemon to load an instance of the datalogger. It is possible to make multiple instances if you have more omnik accounts.This configuration is placed in the file:/config/appdaemon/apps/apps.yaml.Full Configuration Example ofconfig.yaml/apps.yaml:# The instance name is omnik_datalogger, this can be changed. Multiple instances are supported.omnik_datalogger:# General optionsmodule:omnikloggerclass:HA_OmnikDataLoggercity:Amsterdaminterval:360# plugin sectionplugins:# plugins for data logging (output)output:-pvoutput-mqtt-influxdb-csvoutput# plugins for local proxy client (list)localproxy:-hassapi#     - mqtt_proxy#     - tcp_proxy# the client that is beging used (choose one)# valid clients are localproxy, solarmanpv and tcpclientclient:localproxy# attributes overrideattributes:devicename.omnik:Omvormer#   model.omnik: Omnik data logger#DSMR supportdsmr:terminals:-term1tarif:-"0001"-"0002"tarif.0001:laagtarif.0002:normaaldsmr.term1:# use mode tcp or devicemode:tcphost:172.17.0.1port:3333device:/dev/ttyUSB0dsmr_version:"5"total_energy_offset:15338.0gas_meter:true# Section for your inverters specific settingsplant.123:inverter_address:192.168.1.1logger_sn:123456789inverter_port:8899inverter_sn:NLxxxxxxxxxxxxxxsys_id:<YOUR SYSTEM ID># CSV output for specific plantcsvfile:"/some_path/output.178735.csv"separator:";"no_headers:falsefields:-date-time-current_power-today_energy-total_energy-inverter# Section for the localproxy clientclient.localproxy:plant_id_list:-"123"# Section for the localproxy plugin hassapiclient.localproxy.hassapi:logger_entity:binary_sensor.datalogger# Section for the localproxy plugin mqtt_proxyclient.localproxy.mqtt_proxy:logger_sensor_name:Dataloggerdiscovery_prefix:homeassistanthost:homeassistant.example.comport:1883client_name_prefix:ha-mqtt-omnikloggerusername:mqttuernamepassword:mqttpasswordabcdefgh# Section for the localproxy plugin tcp_proxyclient.localproxy.tcp_proxy:listen_address:"0.0.0.0"listen_port:"10004"# Solarmanpv API optionsclient.solarmanpv:username:john.doe@example.compassword:some_password# Influxdb output plugin configuration optionsoutput.influxdb:# Common settingshost:localhostport:8086ssl:false#  # Use SSLverify_ssl:true# Verify SSL certificate for HTTPS requestuse_temperature:true# If true logs the temperature of the openweathermap API# InfluxDB v1 onlydatabase:omnikdataloggerusername:omnikdataloggerpassword:mysecretpassword#jwt_token=# InfluxDB v2 onlyorg:jbsoftbucket:omniktoken:generatedtokenssl_ca_cert:path_to_custom_ca.crt# Only for InfluxDB 2!# csvoutput output plugin configuration optionsoutput.csvoutput:# CSV output for aggregated datacsvfile:"/some_path/output.csv"separator:";"no_headers:falseuse_temperature:truefields:-date-time-current_power-today_energy-total_energy-temperature# PVoutput output plugin configuration optionsoutput.pvoutput:sys_id:12345api_key:jadfjlasexample0api0keykfjasldfkajdflasduse_temperature:trueuse_inverter_temperature:truepublish_voltage:voltage_ac_max# Open Weather map optionsopenweathermap:api_key:someexampleapikeygenerateone4youendpoint:api.openweathermap.orglon:4.0000000lat:50.1234567units:metric# MQTT output plugin configuration optionsoutput.mqtt:username:mqttuernamepassword:mqttpasswordabcdefghdevice_name:Omvormerappend_plant_id:false# Omnikcurrent_power_name:Vermogen zonnepanelentotal_energy_name:Gegenereerd totaaltoday_energy_name:Gegenereerd vandaaglast_update_name:Laatste statusupdateinverter_temperature_name:Temperatuur omvormercurrent_ac1_name:Stroom ACcurrent_ac2_name:Stroom AC fase 2current_ac3_name:Stroom AC fase 3voltage_ac_max_name:Spanning AC maxvoltage_ac1_name:Spanning AC fase 1voltage_ac2_name:Spanning AC fase 2voltage_ac3_name:Spanning AC fase 3frequency_ac1_name:Netfrequentiefrequency_ac2_name:Netfrequentie fase 2frequency_ac3_name:Netfrequentie fase 3power_ac1_name:Vermogen ACpower_ac2_name:Vermogen AC fase 2power_ac3_name:Vermogen AC fase 3voltage_pv1_name:Spanning DC 1voltage_pv2_name:Spanning DC 2voltage_pv3_name:Spanning DC 3current_pv1_name:Stroom DC 1current_pv2_name:Stroom DC 2current_pv3_name:Stroom DC 3power_pv1_name:Vermogen DC 1power_pv2_name:Vermogen DC 2power_pv3_name:Vermogen DC 3current_power_pv_name:Vermogen DCoperation_hours_name:Actieve uren# DSMRtimestamp_name:Update slimme meterELECTRICITY_USED_TARIFF_1_name:Verbruik (laag)ELECTRICITY_USED_TARIFF_2_name:Verbruik (normaal)ELECTRICITY_DELIVERED_TARIFF_1_name:Genereerd (laag)ELECTRICITY_DELIVERED_TARIFF_2_name:Gegenereerd (normaal)energy_used_net_name:Verbruikt (net)energy_delivered_net_name:Gegenereerd (net)CURRENT_ELECTRICITY_USAGE_name:Verbruik (net)CURRENT_ELECTRICITY_DELIVERY_name:Teruglevering (net)ELECTRICITY_ACTIVE_TARIFF_name:TariefLONG_POWER_FAILURE_COUNT_name:Onderbrekingen (lang)SHORT_POWER_FAILURE_COUNT_name:Onderbrekingen (kort)VOLTAGE_SAG_L1_COUNT_name:Net dips L1VOLTAGE_SAG_L2_COUNT_name:Net dips L2VOLTAGE_SAG_L3_COUNT_name:Net dips L3VOLTAGE_SWELL_L1_COUNT_name:Net pieken L1VOLTAGE_SWELL_L2_COUNT_name:Net pieken L2VOLTAGE_SWELL_L3_COUNT_name:Net pieken L3INSTANTANEOUS_ACTIVE_POWER_L1_POSITIVE_name:Gebruik L1INSTANTANEOUS_ACTIVE_POWER_L2_POSITIVE_name:Gebruik L2INSTANTANEOUS_ACTIVE_POWER_L3_POSITIVE_name:Gebruik L3INSTANTANEOUS_ACTIVE_POWER_L1_NEGATIVE_name:Teruglevering L1INSTANTANEOUS_ACTIVE_POWER_L2_NEGATIVE_name:Teruglevering L2INSTANTANEOUS_ACTIVE_POWER_L3_NEGATIVE_name:Teruglevering L3current_net_power_name:Vermogen (net)current_net_power_l1_name:Vermogen L1current_net_power_l2_name:Vermogen L2current_net_power_l3_name:Vermogen L3INSTANTANEOUS_VOLTAGE_L1_name:Spanning L1INSTANTANEOUS_VOLTAGE_L2_name:Spanning L2INSTANTANEOUS_VOLTAGE_L3_name:Spanning L3INSTANTANEOUS_CURRENT_L1_name:Stroom L1 DSMRINSTANTANEOUS_CURRENT_L2_name:Stroom L2 DSMRINSTANTANEOUS_CURRENT_L3_name:Stroom L3 DSMRnet_current_l1_name:Stroom L1net_current_l3_name:Stroom L2net_current_l2_name:Stroom L3net_voltage_max_name:Netspanning max# DSMR gastimestamp_gas_name:Update gasmetergas_consumption_total_name:Verbruik gas totaalgas_consumption_hour_name:Verbruik gas# omnik_DSMR (combined)last_update_calc_name:Update berekeningenergy_used_name:Verbruikt totaalenergy_direct_use_name:Direct verbruiktpower_consumption_name:Verbruikpower_direct_use_name:Direct verbruikConfiguration keys (required, optional and defaults)The .yaml file configuration file used from the command line has the same structure asapps.yamlThe first section inconfig.yamlwill be used (see event log).General settingsGeneral settings -apps.yaml'only' configuration optionsAll configuration settings are placed unther the instance_name key default isomnik_datalogger:.keyoptionaltypedefaultdescriptionmoduleFalsestring(none)Should be the name of the base scriptomniklogger. A path should not be configured. AppDaemon wil find the module automatically.classFalsestring(none)Should be the name of the class hat implements 'appdaemon.plugins.hass.hassapi'. This value should beHA_OmnikDataLogger.General settings ofapps.yamlorconfig.yamlAll configuration settings are placed unther the instance_name key default isomnik_datalogger:.keyoptionaltypedefaultdescriptioncityTruestringAmsterdamCity name recognizable by the Astral python module. Based on this city the data logging is disabled from dusk to dawn. This prevents unneccesary calls to the omnik portal.intervalTrueinteger360The number of seconds of the interval between the last update timestamp and the next poll. At normal conditions the omnik portal produces a new report approx. every 300 sec. With an interval of 360 a new pol is done with max 60 delay. This enabled fluctuation in the update frequency of the omnik portal. If there is not enough time left to wait (less than 10 sec) and no new report was found at the omnik portal another period ofintervalseconds will be waited. After an error calling the omnik API another halfintervalwill be waited before the next poll will be done. A pushing client aslocalproxyis, needs an interval te be set when used from the command line higher then 0. The interval it self is not used since the data is pushed. When no interval is given at the command line (or in a systemd setup) the executable will stop automatically after one reading!data_configTruestring{path to installed data_fields.json}The path to thedata_fields.json. De default is looking in the folder of the executable. When installed usingpipdata_fields.jsonis installd in the folder./shared/omnikdatalogger/data_fields.json. With this parameter you can savely make your own copy and customize it.persistant_cache_fileTruestring{./persistant_cache.json}The path to thepersistant_cache.jsonfile. This file must be writable since its stores the latest total energy and power. When using docker containers, place this file out of your container.Plugin settings in the sectionpluginsofapps.yamlorconfig.yamlkeyoptionaltypedefaultdescriptionclientFalsestring(none)Name of the client that will be used to fetch the data. Valid choices arelocalproxy,tcp_client, orsolarmanpv.localproxyTruelist(none)The client plugings for thelocalproxyclient that will be used to fetch the data. Valid choices aretcp_proxy,mqtt_proxyorhassapi.outputTruelist(empty list)A (yaml) list of string specifying the name(s) of the output plugins to be used. Available plugins arepvoutput,influxdb,csvoutputandmqtt. If no plugins are configured, nothing will be logged.DSMR settings in the sectiondsmrofapps.yamlorconfig.yamlkeyoptionaltypedefaultdescriptionterminalsFalselist(empty list)List of DSMR terminals. Eacht termial has settings at section [dsrm.{terminal_name}]. An empty list disables the DSMR integration.tarif.0001TruestringlowTarif value override for tarif 0001 (low). If you need outher tarifs then 0001 or 0002 the configure the tarif key.tarif.0002TruestringnormalTarif value override for tarif 0002 (normal)tarifTrue"list['0001', '0002']Use only if your meter has other tarifs then 0001 and 0002 and you want to override the name. (Not needed in the Netherlands I suppose)DSMR settings in the sectiondsmr.{terminal_name}ofapps.yamlorconfig.yamlkeyoptionaltypedefaultmodeTruestringdeviceMode for the DSMR terminal. Mode can bedevice(default) ortcp)hostTruestringlocalhostWhen using tcp, the host or IP-address to connect to (e.g. a ser2net instance).portTrueint3333When using tcp, the port to connect to (e.g. a ser2net instance).plant_idTruestring(none)Associates the DSMR data with the Omnik plant data. Use only when you have multiple inverters that use a different DSMR meter.dsmr_versionTruestring'5'The DSMR version of your smart meter. Choices: '2.2', '4', '5', '5B' (For Belgian Meter). Default = '5'gas_meterTruebooleantrueThe DSMR meter has a connected gas meter to read out.total_energy_offsetTruefloat0.0The start value of your solar system used to calculated the total energy consumption. When noplant_idis specified this start value is thetotal_energy_offsetof all inverters together.Client settingsEvery client and client plugin has an own section with configuration keys. Additional for every plant there is a section with plant specific settings.Plant specific settings in the sectionplant.*plant_id*ofapps.yamlorconfig.yamlDetails for the plant are set in sectionplant.{plant id}]. Replaceplant_idwith the plant id of your system (you can choose you own id). Every plant has its own section. Possible keys in this section are:keyoptionaltypedefaultdescriptioninverter_addressTruestring(none)The IP-adres of your inverter. Used by the clienttcpclientto access the inverter.logger_snTrueint(none)The logger module serial number of your inverter. Used by the clienttcpclientto access the inverter.inverter_portTrueint8899The the tcp port your inverter listens to (default to 8899). Used by the clienttcpclientto access the inverter.inverter_snFalsestring(none)The serial number of the inverter. Used by the clientstcpclientandlocalproxyto mapinverter_snandplant_idto validate/filter the raw data messages received.http_onlyTrueboolFalseUsed by the clienttcpclient. The client will not try to connect the inverter over port8899but will use the fallback method to fetch a status update using http://{inverter_address}:80/js/status.jssys_idTrueintsys_idat the[pvoutput]sectionYour unique system id, generated when creating an account at pvoutput.org. This setting allows the specific inveterdata to be published at pvoutput.org. Seepvoutputsettings for more information.logger_entityTruestring(none)When using thelocalproxyclient withhassapi, this specifies the inverter entity created throughomnikdataloggerproxythat receives new updates for the inverter.csvfileTruestring(none)Used by the clientcsvoutput. The file and path to append or create for csv logging.separatorTruestring;Used by the clientcsvoutput. The separator/delimiter to use between headers and fields. Use '\t' to use a tab as separator.no_headersTrueboolFalseUsed by the clientcsvoutput. Ifcsvoutputwill not write headers to thecsvfile.fieldsTruelist[*]Used by the clientcsvoutput. A list of fields to log. The fieldsdateandtimeare specials fields to log the local date and time.use_temperatureTrueboolFalseWhen set to true thetemperaturefield is set in the data set which can be logged to CSV. The value is obtained from OpenWeatherMap.[*] == [
"date",
"time",
"current_power",
"today_energy",
"total_energy",
]TCPclient client settings in the sectionclient.tcpclientofapps.yamlorconfig.yamlkeyoptionaltypedefaultdescriptionplant_id_listFalselist(none)List with the plant id's you want to be monitored. Details for the plant are set in sectionplant.{plant id}]. Replaceplant_idwith the plant id of your system. Every plant has its own section.LocalProxy client settings in the sectionclient.localproxyofapps.yamlorconfig.yamlkeyoptionaltypedefaultdescriptionplant_id_listFalselist(none)List with the plant id's you monitor. Details for the plant are set in sectionplant.{plant id}]. Replaceplant_idwith the plant id of your system. Every plant has its own section.The LocalProxy client uses input plugins that are used to collect the data.
Theomnikloggerproxy.pyscript (Seehttps://github.com/jbouwh/omnikdataloggerproxy) enable to proxy the raw logger data to MQTT and can help to forward your data to omnikdatalogger and still support forwarding the logging to the the legacy portal of Omnik/Solarman.
Multiple plugins can be enabled, but usualy you will use one of these input pluging. The decoding is based on(https://github.com/Woutrrr/Omnik-Data-Logger)by Wouter van der Zwan.
The plugings for thelocalproxyclient are:tcp_proxy: Listens to directed inverter input on port 10004. Seetcp_proxyparagraph. Yo need to forward the inverter traffic to be able to intercept your inverter data.mqtt_proxy: Listens to a MQTT topic to retreive the data. Useomnikloggerproxy.pyto forward to your MQTT server.hassapi: Listens to a homeassitant entity (ascociated with MQTT) using the HASSAPI in AppDaemon. This plugin is prefered for use in combination with Home Assistant.tcp_proxyplugin for thelocalproxyclient in the sectionclient.localproxy.tcp_proxyofapps.yamlorconfig.yamlkeyoptionaltypedefaultdescriptionlisten_addressTruestring'0.0.0.0'The IP-adres to listen to.listen_portTruestring'10004'The port to listen to.mqtt_proxyplugin for thelocalproxyclient in the sectionclient.localproxy.mqtt_proxyofapps.yamlorconfig.yamlkeyoptionaltypedefaultdescriptionlogger_sensor_nameTruestring'Datalogger'The mqtt topic is assembled as {mqtt.discoveryprefix }/binary_sensor/{logger_sensor_name}{serialnumber}discovery_prefixTruestring(key under theoutput.mqttsection)The mqtt plugin supports MQTT auto discovery with Home Assistant. The discovery_prefix configures the topic prefix Home Assistant listens to for auto discovery.hostTruestring(key under theoutput.mqttsection)Hostname or fqdn of the MQTT server for publishing.portTrueinteger(key under theoutput.mqttsection)MQTT port to be used.client_name_prefixTruestring(key under theoutput.mqttsection) thenha-mqttproxy-omnikloggerDefines a prefix that is used as client name. A 4 byte uuid is added to ensure an unique ID.usernameFalsestring(key under theoutput.mqttsection)The MQTT username used for authenticationpasswordFalsestring(key under theoutput.mqttsection)The MQTT password used for authenticationtlsTruebool(key under theoutput.mqttsection)Secures the connection to the MQTT service, the MQTT server side needs a valid certificateca_certsTruestring(key under theoutput.mqttsection)File path to a file containing alternative CA's. If not configure the systems default CA is usedclient_certTruestring(key under theoutput.mqttsection)File path to a file containing a PEM encoded client certificateclient_keyTruestring(key under theoutput.mqttsection)File path to a file containing a PEM encoded client private keyhassapiplugin for thelocalproxyclient in the sectionclient.localproxy.hassapiofapps.yamlorconfig.yamlkeyoptionaltypedefaultdescriptionlogger_entityTruestring'binary_sensor.datalogger'The entity name of the datalogger object in Home Assistant created by the mqtt output of theomnikloggerproxy.pyscript. With multiple inverters uselogger_entitywith the plant specific settings.SolarmanPV client settings in the sectionclient.solarmanpvofapps.yamlorconfig.yamlkeyoptionaltypedefaultdescriptionusernameFalsestring(none)Your Omikportal or SolarmanPV usernamepasswordFalsestring(none)Your Omikportal or SolarmanPV passwordapp_idTruestring(none)The API id used to access your data. If configured, this will override the default assigned id.app_keyTruestring(none)The API key used to access your data. If configured, this will override the default assigned key.Output pluginsMQTT pluginYou can use the the official add-on 'Mosquito broker' for the MQTT integration in HomeAssistant
Make sure you configure an account that has access to the MQTT service.
To integrate with HomeAssistant make sure a username/password combination is added to the Mosquito config like:
The datalogger uses the paho.mqtt.client for connnecting to the MQTT broker.logins:-username:mymqttuserpassword:mysecretpasswordRestart Mosquito after changing the config.MQTT settings in the sectionoutput.mqttofapps.yamlorconfig.yamlkeyoptionaltypedefaultdescriptiondiscovery_prefixTruestring'homeassistant'The mqtt plugin supports MQTT auto discovery with Home Assistant. The discovery_prefix configures the topic prefix Home Assistant listens to for auto discovery.device_nameTruestring'Datalogger proxy'Omnik data logger proxy only setting. Overrides the name of the datalogger in the omnik portal. See also theattributessection below.append_plant_idTrueboolfalseWhen a device_name is specified the plant id can be added to the name te be able to identify the plant.hostTruestringlocalhostHostname or fqdn of the MQTT server for publishing.portTrueinteger1883MQTT port to be used.retainTrueboolTrueRetains the data send to the MQTT serviceclient_name_prefixTruestring'ha-mqtt-omniklogger'Defines a prefix that is used as client name. A 4 byte uuid is added to ensure an unique ID.usernameFalsestring(none)The MQTT username used for authenticationpasswordFalsestring(none)The MQTT password used for authenticationtlsTrueboolFalseSecures the connection to the MQTT service, the MQTT server side needs a valid certificateca_certsTruestring(none)File path to a file containing alternative CA's. If not configure the systems default CA is usedclient_certTruestring(none)File path to a file containing a PEM encoded client certificateclient_keyTruestring(none)File path to a file containing a PEM encoded client private keyRenaming entities. (Keys are like {fieldname}_name)For every solar plant, 4 entities are added to the mqtt auto discovery. The default name can be configured.Omnik solar data - entity name overridekeyoptionaltypedefaultdescriptioncurrent_power_nameTruestringCurrent powerName override for the entity that indicates the current power in Watt the solar plant is producing.total_energy_nameTruestringEnergy totalName override for the entity that indicates total energy in kWh the solar plant has generated since installation.today_energy_nameTruestringEnergy todayName override for the entity that indicates total energy in kWh the solar plant has generated this day.last_update_time_nameTruestringLast updateName override for the entity that is a timestamp total of the last update of the solar plant.nameTruestringCurrent powerName override for the entity that indicates the current power in Watt the solar plant is producing.inverter_temperature_nameTruestringInverter temperatureName override for inverters Temperature. Only the clientstcpclientandlocalproxyare supported.current_ac1_nameTruestringAC Current fase RName override for AC Current fase 1. Only the clientstcpclientandlocalproxyare supported.current_ac2_nameTruestringAC Current fase SName override for AC Current fase 2. Only the clientstcpclientandlocalproxyare supported.current_ac3_nameTruestringAC Current fase TName override for AC Current fase 3. Only the clientstcpclientandlocalproxyare supported.voltage_ac1_nameTruestringAC Voltage fase RName override for AC Voltage fase 1. Only the clientstcpclientandlocalproxyare supported.voltage_ac2_nameTruestringAC Voltage fase SName override for AC Voltage fase 2. Only the clientstcpclientandlocalproxyare supported.voltage_ac3_nameTruestringAC Voltage fase TName override for AC Voltage fase 3. Only the clientstcpclientandlocalproxyare supported.voltage_ac_max_nameTruestringAC Voltage maxName override for the maximal AC Voltage over al fases. Only the clientstcpclientandlocalproxyare supported.frequency_ac1_nameTruestringAC Frequency fase RName override for AC Frequency fase 1. Only the clientstcpclientandlocalproxyare supported.frequency_ac2_nameTruestringAC Frequency fase SName override for AC Frequency fase 2. Only the clientstcpclientandlocalproxyare supported.frequency_ac3_nameTruestringAC Frequency fase TName override for AC Frequency fase 3. Only the clientstcpclientandlocalproxyare supported.power_ac1_nameTruestringAC Power fase RName override for AC Power fase 1. Only the clientstcpclientandlocalproxyare supported.power_ac2_nameTruestringAC Power fase SName override for AC Power fase 2. Only the clientstcpclientandlocalproxyare supported.power_ac3_nameTruestringAC Power fase TName override for AC Power fase 3. Only the clientstcpclientandlocalproxyare supported.voltage_pv1_nameTruestringDC Voltage string 1Name override for PV Voltage string 1. Only the clientstcpclientandlocalproxyare supported.voltage_pv2_nameTruestringDC Voltage string 2Name override for PV Voltage string 2. Only the clientstcpclientandlocalproxyare supported.voltage_pv3_nameTruestringDC Voltage string 3Name override for PV Voltage string 3. Only the clientstcpclientandlocalproxyare supported.current_pv1_nameTruestringDC Current string 1Name override for PV Current string 1. Only the clientstcpclientandlocalproxyare supported.current_pv2_nameTruestringDC Current string 2Name override for PV Current string 2. Only the clientstcpclientandlocalproxyare supported.current_pv3_nameTruestringDC Current string 3Name override for PV Current string 3. Only the clientstcpclientandlocalproxyare supported.power_pv1_nameTruestringDC Power string 1Name override for PV Power string 1. Only the clientstcpclientandlocalproxyare supported.power_pv2_nameTruestringDC Power string 2Name override for PV Power string 2. Only the clientstcpclientandlocalproxyare supported.power_pv3_nameTruestringDC Power string 3Name override for PV Power string 3. Only the clientstcpclientandlocalproxyare supported.current_power_pv_nameTruestringDC Current powerName override for PV total power. Only the clientstcpclientandlocalproxyare supported.operation_hours_nameTruestringHours activeName override for the oprational hours of the inverter. Only the clientstcpclientandlocalproxyare supported.DSMR and Omnik solar combined data - entity name overridekeyoptionaltypedefaultdescriptionlast_update_calcTruestring'Last update calculations'Timestamp for calculated combined values of DSMR and solar dataenergy_usedTruestring'Energy used'Total energy used since installation of the smart meter. Thetotal_energy_offsetsetting enables is meant to configure thetotal energyof your solar system at the installation of the smart meter.energy_direct_useTruestring'Energy used directly'The direct used energy (consumed and not delivered to the net) since installation of the smart meter. Thetotal_energy_offsetsetting enables is meant to configure thetotal energyof your solar system at the installation of the smart meter.power_consumptionTruestring'Current consumption'The current power consumption (direct and imported power).power_direct_useTruestring'Direct consumption'The direct power consumption (directly used from your generated power and not deliverd to the net).DSMR data - entity name overridekeyoptionaltypedefaultdescriptiontimestampTruestring'Last update smart meter'Timestamp of the last smart meter data published.ELECTRICITY_USED_TARIFF_1Truestring'Energy used tariff 1'Total energy consumption at low tariff (kWh)ELECTRICITY_USED_TARIFF_2Truestring'Energy used tariff 2'Total energy consumption at normal tariff (kWh)ELECTRICITY_DELIVERED_TARIFF_1Truestring'Energy delivered tariff 1'Total energy delivery at low tariff (kWh)ELECTRICITY_DELIVERED_TARIFF_2Truestring'Energy delivered tariff 2'Total energy delivery at normal tariff (kWh)energy_used_netTruestring'Energy used net'Total energy used (net) tarrif 1 + tarrif 2 (kWh)energy_delivered_netTruestring'Energy delivered net'Total energy delivered (net) tarrif 1 + tarrif 2 (kWh)CURRENT_ELECTRICITY_USAGETruestring'Net power usage'Current net power used (zero during delivery) in kWattCURRENT_ELECTRICITY_DELIVERYTruestring'Net power delivery'Current net power delivered (zero during import) in kWattELECTRICITY_ACTIVE_TARIFFTruestring'Active tariff'The active tarrif (low of normal) values can be customized indsmrsectionLONG_POWER_FAILURE_COUNTTruestring'Long power failure count'The number of 'long' power failures counted.SHORT_POWER_FAILURE_COUNTTruestring'Short power failure count'The number of 'shorted' power failures counted.VOLTAGE_SAG_L1_COUNTTruestring'Voltage sag count L1'The number of power sags for fase L1 counted.VOLTAGE_SWELL_L1_COUNTTruestring'Voltage swell count L1'The number of power swells for fase L1 counted.INSTANTANEOUS_ACTIVE_POWER_L1_POSITIVETruestring'Net power usage L1'Current net power used for fase L1 (zero during delivery) in WattINSTANTANEOUS_ACTIVE_POWER_L1_NEGATIVETruestring'Net power delivery L1'Current net power delivered for fase L1 (zero during import) in Wattcurrent_net_powerTruestring'Current net power'The current net power (can be negative) in Wattcurrent_net_power_l1Truestring'Current net power L1'The current net power for fase L1 (can be negative) in WattINSTANTANEOUS_VOLTAGE_L1Truestring'Net voltage L1'The current net voltage in Volts for Fase L1 (rounded to an integer)net_voltage_maxTruestring'Net voltage max'The current maximum net voltage in Volts over all fases (rounded to an integer). Can be used asnet_voltage_fallbackkey to publish voltage to pvoutput when no solar voltage data is available.INSTANTANEOUS_CURRENT_L1Truestring'Net current L1 DSMR'The current for fase L1 in Ampère (rounded to a positive integer) directly from your smart meter.net_current_l1Truestring'Net current L1'The current for fase L1 in Ampère calculated usingcurrent_net_power_l1/INSTANTANEOUS_VOLTAGE_L1. This gives a more precise current. Value is negative during enery delivery.The entries for fase L1 are also applicable for fase L2 and L3 if the data is available`DSMR gas data - entity name overridekeyoptionaltypedefaultdescriptiontimestamp_gasTruestring'Last update gas meter'Timestamp of the last gas meter data published.gas_consumption_totalTruestring'Gas total'The total amount of m3 gas delivered since installation of the meter.gas_consumption_hourTruestring'Gas consumption'The current consumption of gas in m3/hour.The unit of measurement the used icon, MQTT device_class and value template file can be customized by updating the filedata_fields.json.
Make a copy of the original file and configure the path under thedata_configkey in the general setting.PVoutput plugin settings in the sectionoutput.pvoutputofapps.yamlorconfig.yamlRegister a free acount and API key athttps://pvoutput.org/register.jspkeyoptionaltypedefaultdescriptionsys_idTruestring(none)Your unique system id, generated when creating an account at pvoutput.org. Enable publishing combined inverter data to this system id. You can also setsys_idin plant specific section to publish separate inverters.api_keyFalsestring(none)Unique API access key generated at pvoutput.orguse_temperatureTrueboolfalseWhen set to true anduse_inverter_temperatureis not set, the temperature is obtained from OpenWeatherMap is submitted to pvoutput.org when logging the data.use_inverter_temperatureTrueboolfalseWhen set to true anduse_temperatureis set, the inverter temperature is submitted to pvoutput.org when logging the data. Only the clientstcpclientandlocalproxyare supported.publish_voltageTruestring(none)Thefieldnamekey of the voltage property to use for pvoutput 'addstatus' publishing. When set to'voltage_ac_max', the maximal inverter AC voltage over all fases is submitted to pvoutput.org when logging the data. Only the clientstcpclientandlocalproxyare supported. Supported values arevoltage_ac1,voltage_ac2,voltage_ac3orvoltage_ac_maxor one ofe the DSMR voltage fields (INSTANTANEOUS_VOLTAGE_L1 / _L2, _L3 or net_voltage_max) if DSMR is available. The fieldnet_voltage_maxholds the highest voltage over all available fases.net_voltage_fallbackTruestring(none)Thefieldnamekey of the voltage property to use for pvoutput 'addstatus' publishing in case no solar data is available during sun down. When set to'net_voltage_max', the maximal net voltage over all fases is submitted as alternative to pvoutput.org. This key only makes sens when using the DSMR integration.CSVoutput plugin settings in the sectionoutput.csvoutputin ofapps.yamlorconfig.yamlkeyoptionaltypedefaultdescriptioncsvfileTruestring(none)Used by the clientcsvoutput. The file and path to append or create for csv logging.separatorTruestring;Used by the clientcsvoutput. The separator/delimiter to use between headers and fields. Use '\t' to use a tab as separator.no_headersTrueboolFalseUsed by the clientcsvoutput. Ifcsvoutputwill not write headers to thecsvfile.fieldsTruelist[*]Used by the clientcsvoutput. A list of fields to log. The fieldsdateandtimeare specials fields to log the local date and time.use_temperatureTrueboolFalseWhen set to true thetemperaturefield is set in the data set which can be logged. The value is obtained from OpenWeatherMap.Default fields and additional fieldsDefault fields assignment [*]:datetimecurrent_powertoday_energytotal_energyThe following additional fields are available if DSMR data can be matched with the aggregated solar data:energy_direct_useenergy_used_netpower_direct_usepower_consumptionlast_update_calcInfluxDB plugin settings in the sectionoutput.influxdbin ofapps.yamlorconfig.yamlkeyoptionaltypedefaultdescriptionhostTruestringlocalhostHostname or fqdn of the InfluxDB server for logging.portTrueinteger8086InfluxDB port to be used.sslTrueboolfalseUse SSL. Set totrueif the URL starts withhttps://verify_sslTruebooltrueBy default a certificate is validated. Set tofalseto disable validation.ssl_ca_certTruestring(none)Set an alternative CA cert. (InfluxDB 2.x client only)orgTruestring(none)The InfluxDB2 organisation (InfluxDB 2.x only)bucketTruestring(none)The InfluxDB2 bucket to write to (InfluxDB 2.x only)tokenTruestring(none)The InfluxDB2 authentication token (InfluxDB 2.x only)use_temperatureTrueboolfalseWhen set to true the temperature is obtained from OpenWeatherMap and logged.databaseTruestringomnikdataloggerThe InfluxDB database (InfluxDB 1.8x only)usernameTruestring(none)The InfluxDB username used for Basic authentication (InfluxDB 1.8x only)passwordTruestring(none)The InfluxDB password used for Basic authentication (InfluxDB 1.8x only)jwt_tokenTruestring(none)The InfluxDB webtoken for JSON Web Token authentication (InfluxDB 1.8x only)Logging to InfluxDB is supported with configuration settings fromdata_fields.jsonThe file allows to customize measurement header and allows setting additional tags.
When using InfluxDB2, authentication is mandantory. Configureorg,bucketandtokento enable the InfluxDB v2 client.OpenWeatherMap settings in the sectionopenweathermapofapps.yamlorconfig.yaml(used byPVoutputplugin ifuse_temperatureis true and you did not specifyuse__inverter_temperature)Visithttps://openweathermap.org/priceto obtain a (free) api key. The weather data is cached with een TTL of 300 seconds.keyoptionaltypedefaultdescriptionapi_keyFalsestring(none)Unique access key generated at openweathermap.orgendpointTruestringapi.openweathermap.orgFQDN of the API endpoint.lonFalsefloat(none)Longitude for the weather locationlatFalsefloat(none)Latitude for the weather locationunitsTruestringmetricCan bemetric(for deg. Celsius) orimperial(for deg. Fahrenheit)Device attribute settings and relation withdata_fields.jsonOver MQTT the MQTT output advertizes the data of inverter, DSMR data, DSMR gas data and combined data. These groups bound to device attributes that wil be associated withe entities that are being published.
In Home Assistant throug MQTT auto discovery this will show as seperate devices for 'Omnik' entities, 'DSMR' entities, 'DSMR gas' entities and 'DSMR_omnik' (combined) entities.
All fields are configured with the pre installeddata_fields.jsonfile. This file holds anassetproperty for each field which corresponds with the asset class.
Each asset class must have one field with"dev_cla": "timestamp"which is the timestamp field for that class.
If you want to omit field in your output you can personalizedata_fields.json. Do NOT customize the shared version ofdata_fields.jsonbut make a copy and configure the aternative path
using thedata_configkey in get general section.
Theattributessection allows to customize some asset class settings.keyoptionaltypedefaultdescriptionasset_classesTruelistomnik, omnik_dsmr, dsmr, dsmr_gasAccess classes for device payload and grouping of entities.asset.{asset_class}Truestringsee belowCustomize attribute payload for an asset classasset.omnikTruestringinverter, plant_id, last_updateStandard attributes for published Omnik inverter dataasset.omnik_dsmrTruestringinverter, plant_id, EQUIPMENT_IDENTIFIER, terminal, last_updateStandard attributes for published combined DSMR and Omnik inverter data`asset.dsmrTruestringEQUIPMENT_IDENTIFIER, terminal, timestampStandard attributes for published DSMR dataasset.dsmr_gasTruestringEQUIPMENT_IDENTIFIER_GAS, terminal, timestamp_gasStandard attributes for published DSMR gas datamodel.{asset_class}Truestringsee belowCustomize the model property of the device payload for an asset classmodel.omnikTruestringOmniksolCustomize the model property of the device payload for the asset classomnik(Solar data)model.omnik_dsmrTruestringOmnik data loggerCustomize the model property of the device payload for the asset classomnik_dsmr(DSMR + Solar combined data)model.dsmrTruestringDSRM electricity meterCustomize the model property of the device payload for the asset classdsmr(DSMR electricity data)model.dsmr_gasTruestringDSRM gas meterCustomize the model property of the device payload for the asset classdsmr_gas(DSMR gas data)mf.{asset_class}Truestringsee belowCustomize the manufacturer property of the device payload for an asset classmf.omnikTruestringOmnikCustomize the manufacturer property of the device payload for the asset classomnik(Solar data)mf.omnik_dsmrTruestringJBsoftCustomize the manufacturer property of the device payload for the asset classomnik_dsmr(DSMR + Solar combined data)mf.dsmrTruestringNetbeheer NederlandCustomize the manufacturer property of the device payload for the asset classdsmr(DSMR electricity data)mf.dsmr_gasTruestringNetbeheer NederlandCustomize mthe anufacturer property of the device payload for the asset classdsmr_gas(DSMR gas data)identifier.{asset_class}Truestringsee belowCustomize the identifier property of the device payload for an asset class. This property should be unique when using a configuration with more DSMR meters or plants The identifier will have the format {assetclass}{identifier}.identifier.omnikTruestringplant_idCustomize the identifier property of the device payload for the asset classomnik(Solar data)identifier.omnik_dsmrTruestringplant_idCustomize the identifier property of the device payload for the asset classomnik_dsmr(DSMR + Solar combined data)identifier.dsmrTruestringEQUIPMENT_IDENTIFIERCustomize the identifier property of the device payload for the asset classdsmr(DSMR electricity data)identifier.dsmr_gasTruestringEQUIPMENT_IDENTIFIER_GASCustomize the property of the device payload for the asset classdsmr_gas(DSMR gas data)devicename.{asset_class}Truestringsee belowCustomize the device name for an asset class. This attribute replaces the previous decrepateddevice_namesetting in theoutput.mqttsection.devicename.omnikTruestringInverterCustomize the device name for the asset classomnik(Solar data)devicename.omnik_dsmrTruestringOmnik_data_loggerCustomize the device name for the asset classomnik_dsmr(DSMR + Solar combined data)devicename.dsmrTruestringDSMR_electicity_meterCustomize the device name the device payload for the asset classdsmr(DSMR electricity data)devicename.dsmr_gasTruestringDSMR_gasmeterCustomize the device name the device payload for the asset classdsmr_gas(DSMR gas data)Configuration using config.iniUsing aconfig.iniconfig file is no longer supported! Move your config a .yaml file in stead.Scheduled Run (commandline or using systemd)You've got your default options to schedule this logger, but I included asystemdservice file to run this as a service on Linux.PS: I'm usingUbuntu 18.04 LTSbut Debian buster should also work.First, install this thing (~ using Python 3.7+ !!!)If you don't havePython3.7+installed, do that first (~ don't forget to installpython3-pipas well)#### Create a to download the scripts
$ git clone https://github.com/jbouwh/omnikdatalogger
> onmiklogger.py can be found in the `./apps` folder
# check if properly installed
$ omniklogger.py -h
usage: omniklogger.py [-h] [--settings FILE] [--interval n] [-l]

optional arguments:
  -h, --help     show this help message and exit
  --settings FILE  Path to yaml configuration file
  --interval n   Execute every n seconds
  -l {DEBUG,INFO,WARNING,ERROR}, --loglevel {DEBUG,INFO,WARNING,ERROR} LoglevelAn example systemd script is available fromscripts/omnikdatalogger.service. Copy it so you can customize it to your use.Check the folowing line in this file in the script.ExecStart=/usr/bin/python3 /usr/local/bin/omniklogger.py --settings /etc/omnik/config.yaml --interval 360Make sure the interval is as desired and that the path of omniklogger.py is correctThen copy the modified script path to/lib/systemd/system/omnik-data-logger.serviceNext, enable and start service:$ systemd enable omnikdatalogger
Created symlink /etc/systemd/system/multi-user.target.wants/omnikdatalogger.service → /lib/systemd/system/omnikdatalogger.service.
$ systemd start omnikdataloggerCheck ifomnikdatalogger.serviceis 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 --settings /etc/omnik/config.yaml --interval 300