Omink inverter in Home assistant

I have Hassio… BUT I checked your example and I found this:
DEBUG (SyncWorker_16) [custom_components.omnik.sensor] Omnik sensor raw message: b’’

I don’t know if the log is trunked by HA or it is only empty. But it seems simply not responding

I’m not so experienced in programming, does anybody know how to modify this to use two omnik Inverters?

Hi Leon,

I have updated the component (version 0.0.3) with an extra configuration variable “name”.
The configuration variable is optional, so default for example a sensor instance called “sensor.omnik_actual_power” will be created.

If you use “name: MyOmnik” in your configuration for a separate configuration another sensor will be created called “sensor.myomnik_actual_power”.
This way two or more Omnik inverters are supported if you create another Omnik sensor.

In the process of moving from OpenHAB to HA, when I was looking for a way not to adapt my OpenHAB omnik script. This works like a charm, up and running with two inverters in 5 minutes. Many thanks for this script!!

Works right out of the box; thanks!

wow, great surprise coming back from holiday!
I do however not receive one of the inverters, altrough it is a new one (3 phase) I think the wifi is old, it has a 9 digit serial starting with 64… I found some information that this type is able to react on a HTTP request, too bad…

First of all Thank You very much for this awesome script. I was even thinking on having a RS485 device hanging from the inverter just to collect this data… my inverter is not an Omnik, but answers gracefully to the same protocol!
My issue is after the last HA upgrade the script sometimes returns ‘unknown’ to everything until I restart HA.
Has anyone ran across this?

Hi Hein,
Thank you for building the Omnik inverter add on for Hassio. I’m really looking forward to getting the data in an InfluxDB for analysis.

My new setup is a Omnik inverter (4KTL3): Inverter information: Firmware version main (v5.04 Build230) and firmware version slave (V4.13 Build252). Device information: Firmware version ME_09_0102__2.04). I’ve swapped the wificard for a network card, but that doesn’t have an effect in Hassio. (ps. Omnik support doesn’t provide firmware to customers, at least not when I asked).

After installing HACS and your addon v0.3, I’ve copied the example yaml from Github in the configuration.yaml file and changed the serial number and the IP address (made static in the router). All the MyOmnik sensors in Hassio show up with Unknown. I’ve also setup the OmnikPortal application, which does show data in the webbrowser. The remote server works OK, I guess. I’ve also added the debug option to logger for the custom_components.omnik. The logfiles only show that it took longer than 10 seconds to setup the Omnik sensors (a warning), but no errors.

Is there anything you could suggest to capture the data in Hassio?

Thank you for your work,
Richard

Hi Richard,

Sorry for my late response.
For the sensor to work your Omnik inverter network card must support http calls.
Seems yours might not work, the card seems not responding.

There seems also be a newer protocol, maybe newer firmware, which is not supported.
This protocol differs in format and so this solution will not work.

Kind regards,
Hein

Hi Hein,
Thanks for the update. The network card is ‘standard issue’ from Omnik, I didn’t choose a particular card and it looks pretty common. I guess you are right that the problem lies in the newer protocol. I need to figure out a data sniffer.

Cheers,
Richard

Hey Hein,

Small question. I’m a bit unclear as to how one gets to the inverter configuration page in your post. Mine only has a simple 1 page menu where i can set the wireless network to connect to. Is the menu you have added in a later firmware update or something?

Hey Shamalamadindong,

Maybe there is a difference between the inverter (other firmware etc.).
In my screenshot I am connected to a Wifi accesspoint.
Are you in your case also already connected to a Wifi accesspoint?

Kind regards,
Hein

I have a new Omnik inverter as well, the serial also starts with 64 and has 9 digits and unfortunately it is not working with this component, all sensors show Unknown.

I found this script made for Domoticz which reads data from the local webinterface of the inverter → GitHub - sincze/Domoticz-Omnik-Local-Web-Plugin: Domoticz Python Plugin that can read data from the local inverter webinterface.

That should work with either serial number as it just reads data from the webinterface. I will see if I can adapt the script to make it working with HA. If I have any good progress I will give an update here, but it could take some time as I have little spare time :wink:

If anyone wants to change that script in the meanwhile to use it with HA and share it here, that would be great as well :+1:

This would be great! I don’t think I can support you with this, but would really like to see this working

I had a quick look and the scrape sensor or rest sensor should work for this.
All relevant information is in http://ip-of-your-inverter/js/status.js. For my invertor the relevant values are stored in myDeviceArray[0].
Will try to have a look at this in the coming days.

With the input from the Domoticz script of Sincze I have it working now using a command_line sensor (you could also use the rest sensor).

CC @Philippe_Bouwen

Steps:

  1. Go to the this page (change the IP adres to the on of your Omnik webinterface) -> http://192.168.1.127/js/status.js
  2. Search for the text webData or myDeviceArray. The page will contain one of these.
    Example
var webData="NLDN**2017******,NL1-V1.0-0118-4,V2.0-0028,omnik4000tl ,4000,584,345,33734,,4,";
var myDeviceArray=new Array(); myDeviceArray[0]="AANN3020,V5.04Build230,V4.13Build253,Omnik3000tl,3000,1313,685,9429,,1,";
  1. Use the following code (change the IP address and change myDeviceArray\[0]\ to Webdata if needed according to step 2) to generate 3 sensors:
sensor:
  - platform: command_line
    name: Solar Power Current
    scan_interval: 30
    command: 'curl http://192.168.1.127/js/status.js'
    value_template: >-
      {{ ((value | regex_findall_index('myDeviceArray\[0\]=".*?(?=";)')).split(',')[5] | float) | int }}
    unit_of_measurement: 'W'
  - platform: command_line
    name: Solar Power Today
    scan_interval: 300
    command: 'curl http://192.168.1.127/js/status.js'
    value_template: >-
      {{ (value | regex_findall_index('myDeviceArray\[0\]=".*?(?=";)')).split(',')[6] | float / 100 }}
    unit_of_measurement: 'kWh'
  - platform: command_line
    name: Solar Power Total
    scan_interval: 14400
    command: 'curl http://192.168.1.127/js/status.js'
    value_template: >-
      {{ (value | regex_findall_index('myDeviceArray\[0\]=".*?(?=";)')).split(',')[7] | float / 10 }}
    unit_of_measurement: 'kWh'

I use the command_line with the current power and an update interval of 30 seconds for the current power sensor.
For the sensors power today and power total I use another update interval.

Not sure how often the webpage actually refreshes, but for now I keep the interval to 30 seconds.

Advantage of using this method is that it reads the Omnik inverter locally (I blocked the access to internet for the inverter now).
It doesn’t have all the data which the custom component has, but at least the most important power data is available.
This code can be used if you own an invertor with a 9 digit serial starting with 64, but I guess it will work for all Omnik inverters.

1 Like

Wow thanks Gerard, gonna give it a try!

I do think the scrape sensor is being discontinued, but hopefully it keeps working :crossed_fingers:

Let me know if it works for you :+1:

BTW this is not using the scrape sensor, but the command_line and/or rest sensor. I have changed the scripts a little bit for the update interval of the daily and total power. No need to update that every minute. Will update the script in my post above later. Edit: script in post above is updated.

P.S. The scrape sensor will remain, only integrations using scrape have been disabled as that is difficult to maintain as websites can often change, but you can still use the scrape sensor yourself.

Hi Gerard, your solution worked for me. Thanks a lot.

Good to hear, thanks for your confirmation.