Omnik inverter to Zon op Toon

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

Moderators: marcelr, TheHogNL, Toonz

Post Reply
ikookmaar
Starting Member
Starting Member
Posts: 38
Joined: Tue Mar 12, 2019 11:29 pm

Omnik inverter to Zon op Toon

Post by ikookmaar »


(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..)
TheHogNL
Forum Moderator
Forum Moderator
Posts: 2125
Joined: Sun Aug 20, 2017 8:53 pm

Re: Omnik inverter to Zon op Toon

Post by TheHogNL »

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.setmode(GPIO.BCM)
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')
        try:
                newwatts = float(value)
        except ValueError:
                newwatts = watts
        print "New watts: ",newwatts
        return newwatts

watts = getWatts()
lastWattsPull=time.time()
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):
                        GPIO.output(18,GPIO.HIGH)
                        print "Giving pulse"
                        time.sleep(ledPulseWidth)
                        GPIO.output(18,GPIO.LOW)
        if (time.time() > (lastWattsPull+collectWattsInterval)):
                watts = getWatts()
                lastWattsPull=time.time()
        # need to sleep a short amount of time  before looping back or else the cpu on the Pi will not go idle
        time.sleep(0.01)

GPIO.cleanup()
Member of the Toon Software Collective
ikookmaar
Starting Member
Starting Member
Posts: 38
Joined: Tue Mar 12, 2019 11:29 pm

Re: Omnik inverter to Zon op Toon

Post by ikookmaar »

Thanks, I will try this as soon as I find time to do so!
oepi-loepi
Advanced Member
Advanced Member
Posts: 628
Joined: Sat Feb 09, 2019 7:18 pm

Re: Omnik inverter to Zon op Toon

Post by oepi-loepi »

Try the solarPanel app from the toonstore..
ikookmaar
Starting Member
Starting Member
Posts: 38
Joined: Tue Mar 12, 2019 11:29 pm

Re: Omnik inverter to Zon op Toon

Post by ikookmaar »

Thanks, I did and it works!
oepi-loepi
Advanced Member
Advanced Member
Posts: 628
Joined: Sat Feb 09, 2019 7:18 pm

Re: Omnik inverter to Zon op Toon

Post by oepi-loepi »

ikookmaar wrote:Thanks, I did and it works!
Nice. You can also select a lot more other inverters from the list. It is even possible to selct 2 inverters.
Post Reply

Return to “Toon miscellaneous”