Omnik inverter to Zon op Toon

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

Moderators: marcelr, TheHogNL, TerrorSource, Toonz

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..)
ikookmaar
Starting Member
Starting Member
 
Posts: 7
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.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
User avatar
TheHogNL
Forum Moderator
Forum Moderator
 
Posts: 960
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!
ikookmaar
Starting Member
Starting Member
 
Posts: 7
Joined: March 2019


Return to Toon miscellaneous

Who is online

Users browsing this forum: No registered users and 0 guests