Custom Component: Omnik Inverter Sensor

Hey @robbinjanssen, where the previous version(s) would stop working within 24 hours, the latest version has been running for 8 consecutive days! Seems you nailed the problem. Nice, will now integrate it into the main HA tab. Thanks for your efforts, much appreciated!

Hi, I’ve been using this for a while now, but I have one problem. I’m using this with two inverters, and they don’t reset the daily total at the same time. Is there something I can do to make them both reset at midnight? Thanks in advance!

I’m struggling getting my Omnik work with the Hass utility meter. When the sun is gone, the omnik doesn’t get power and the wifi drops and all (most) sensors turn to “unknown”. So far I’ve been using the other Omnik custom component

I might try this one. But before that, I wanted to know does this component keep outputting all it’s values, even when the Omnik is unavailable, i.e. Actual power = 0, total power remains total power, power today = power today or 0, depending on time of day.

Hi Sjorsja,

I think if you will use the caching option it will work for you. The caching option keeps the total (max) value at least until the next day has passed. It will reset as soon as it is after midnight or the value is something else then the cached value (most of the time 0 :slight_smile: )

See the comments in the code for more details: https://github.com/robbinjanssen/home-assistant-omnik-inverter/blob/8bd6876b598f810b62fede9eb6276917f0c11967/custom_components/omnik_inverter/sensor.py#L237-L261

Hi Spudje, i’m not sure what happens if the inverter becomes unavailable, it might just log an error and keep the current value since it doesn’t update the state at that point.

If I understand correctly your inverter works normally, except when the sun is gone, it becomes unavailable (because of wifi) but you would like to keep the total value until the next day?

Yes, I use the home assistant Utility Meter https://www.home-assistant.io/integrations/utility_meter/
And that epxects a continuous feed of sensor values.

With the other Omnik component, I believe the actual power stays at 0 when the omnik goes offline, however the energy total (and energy today) become unknown when the omnik is offline. This energy total drives (part of) the Utility Meter and hence gives crippled results.

I tried to fix this with additional template sensors, but to no avail. Lovelace: Power wheel card

Yes I’m almost there. Your component keeps state while the converter goes offline so that’s good.

However, the Home Assistant Utility Meter refreshes its daily cycle exactly at 0:00:00 (e.g. for daily total returned energy), where the solar_power_today sensor refreshes at 0:00:45. This results in a max value of (Dagelijks verbruik uit zon) daily local consumption (solar_power_today - daily total returned energy) at the start of the cycle which equals the maximum value of solar_power_today of the previous day :frowning:

solar_consumption_daily:
        friendly_name: Dagelijks verbruik uit zon
        unit_of_measurement: kWh
        value_template: "{{ states('sensor.solar_power_today') | float - states('sensor.solar_returned_total_daily') | float  }}"

localconsumption

Any idea how I can tell a template sensor to stop measuring around midnight for a few minutes?

This is exactly what I was looking for. Great Job

1 Like

Can’t find it in HACS

It should be there, did you click the + button and then searched for it?

It doesn’t work anymore, state unknown

@robbinjanssen, sorry to say, but I still lost connection after a few days. Is it possible to run the addin with more debug information? So we can analyse what the real problem is?

I’m on 1.5.0

Hi,

You could enable debug logging by adding this to your configuration.yaml;

logger:
  default: info
  logs:
    custom_components.omnik_inverter: debug

Do you get an error that you can share with me? :slight_smile:

In order to support the new energy dashboard in HA, it looks like some adjustments need to be made to this component. Not sure if that is the way forward but maybe this helps. Is anyone looking into this? Would be great if my omnik is compatible with this.

1 Like

There is a beta version which supports the new energy dashboard :slight_smile:

See https://github.com/robbinjanssen/home-assistant-omnik-inverter/releases/tag/v2.0.0-beta-2

2 Likes

Hi Robin,

Just received my Omnik 2000-TL3-S and your component seemed to be the perfect bridge to HA.
I can access the JS file on http://192.168.1.185/js/status.js

I setup your component and everything went smooth until the very last step where the inverter and device should show up and you can select the Areas. This window doesn’t show and as a result I have no corresponding entities.

This shows in the notofications:

Invalid config
The following integrations and platforms could not be set up:

omnik_inverter.sensor

And this in the logs:

Logger: homeassistant.setup
Source: setup.py:317
First occurred: 09:42:01 (1 occurrences)
Last logged: 09:42:01

Unable to prepare setup for platform omnik_inverter.sensor: Platform not found (cannot import name 'SensorDeviceClass' from 'homeassistant.components.sensor' (/usr/src/homeassistant/homeassistant/components/sensor/__init__.py)).

I’m running an older version of HA 2021.9.1

Any assistance would be greatly appreciated!

Hi there,

I havebuild a new home assistant since my old one creashed and could not be updated.
So i have build a new setup in Proxmox
core-2022.3.5 Nieuwste versie core-2022.3.5
supervisor-2022.03.5
Nieuwste versie supervisor-2022.03.5

When i click the button My Addconfiguration GitHub - robbinjanssen/home-assistant-omnik-inverter: Read the current, daily and total Wh from your Omnik Inverter via local network (no cloud!)

I receive a message in HA that this is not working
ha-omnik

I know that this can be done manually, but i rather do it in HA style automatically

You’re home assistant version does not yet have the SensorDeviceClass. You can either update your home assistant to the most recent version (which is what I recommend :slight_smile: ) or try installing v2.1.0 of the omnik component, that one should still work I guess.

Good luck!

Hi Peter,

Have you installed the component via HACS? You need to install it first before you can click the button, I agree this is a bit misleading and will update the README soon :slight_smile:

V2.1 works perfectly :slight_smile:
Thank you tons!

1 Like