Omnik inverter to Zon op Toon

If you don't know where to post, post here.

Moderators: marcelr, TerrorSource, Toonz, TheHogNL

Omnik inverter to Zon op Toon

Postby ikookmaar » Thu Apr 18, 2019 9:38 pm

(next level: find a way to get the data from my Omnik inverter into Zon op Toon)

Did you manage to get the omnik data into Toon?[/quote]

Didn't look into this for a long time...
In short: no.

Buying, installing and monitoring a seperate metering device - while all the data is already monitored and available in the Omnik inverter itself, the Omnik portal, my rpi, PVoutput and Domoticz - seems rather silly.
I'm still hoping for someone to find a way to "inject" the available data into Zon op Toon...

(sorry, I'm aware that this is offtopic here..)
Starting Member
Starting Member
Posts: 11
Joined: March 2019

Re: Omnik inverter to Zon op Toon

Postby TheHogNL » Fri Apr 19, 2019 7:19 am

I moved the topic to a new one because I want to reply on it :-)

It is possible to get the data in the toon by just simulation the (led) pulses to your toon meteradapter. See my python code below which I run on a PI connected to a red led on GPIO18. And the toon analog sensor is pointing to the led. You could also connect it directly to the meteradapter (without a led and the sensor) using a transistor between the gpio output and the meteradapter. I haven't done this yet as my red led method just works fine.

The script collects current produced Watts from a source (in you case could be domoticz or your omnik inverter portal). The collected Watts must be almost realtime as the Toon compares and calculates it with data from the P1 port from the smart meter. If the data is 30 seconds off or more your will get incorrect values displayed at the toon.

Code: Select all
import RPi.GPIO as GPIO
import requests
import time
import urllib

GPIO.setup(18, GPIO.OUT)

# how long is a pulse, this is ok for toon meteradapter
ledPulseWidth = 0.01
# how often per seconds do we get new Watts - faster is better resolution on the Toon compared to the P1 output from the slimme meter
collectWattsInterval = 5
# initial watts (can not be 0)
watts = 0.01
#how many pulses per watthour (2 = 2000 imp/kwh)
pwh = 2
#initiate the timer
last = time.time()

def getWatts():
        value = requests.get('some url which provides the current Watt produces by your inverter')
                newwatts = float(value)
        except ValueError:
                newwatts = watts
        print "New watts: ",newwatts
        return newwatts

watts = getWatts()
nextPulseTime = 3600/watts/pwh

while True:
        if (time.time() > (last+nextPulseTime)):
                last = time.time()
                nextPulseTime = float(3600/watts/pwh)
                print "Calculated next pulse after (seconds): ",nextPulseTime
                if (watts > 10):
                        print "Giving pulse"
        if (time.time() > (lastWattsPull+collectWattsInterval)):
                watts = getWatts()
        # need to sleep a short amount of time  before looping back or else the cpu on the Pi will not go idle

Member of the Toon Software Collective
User avatar
Forum Moderator
Forum Moderator
Posts: 1502
Joined: August 2017

Re: Omnik inverter to Zon op Toon

Postby ikookmaar » Mon Apr 29, 2019 10:55 pm

Thanks, I will try this as soon as I find time to do so!
Starting Member
Starting Member
Posts: 11
Joined: March 2019

Return to Toon miscellaneous

Who is online

Users browsing this forum: No registered users and 1 guest