woutrrr / omnik-data-logger Goto Github PK
View Code? Open in Web Editor NEWData logger for Omnik Solar Inverters
License: GNU General Public License v3.0
Data logger for Omnik Solar Inverters
License: GNU General Public License v3.0
Started today with a fresh install. Got LiveStats working with the comments of Molekuul.
When running OmniExport the following error occured:
Traceback (most recent call last):
File "OmnikExport.py", line 132, in
OmnikExport.run()
File "OmnikExport.py", line 49, in run
'filename': mydir + '/' + config.get('log', 'filename'),
File "/usr/lib/python2.7/ConfigParser.py", line 340, in get
raise NoOptionError(option, section)
ConfigParser.NoOptionError: No option 'filename' in section: 'log'
I changed filename also to log_filename like in LiveStats and the error changed:
2015-12-23 14:25:20,976 DEBUG Importing output plugin
Traceback (most recent call last):
File "OmnikExport.py", line 132, in
OmnikExport.run()
File "OmnikExport.py", line 72, in run
import(plugin_name)
ValueError: Empty module name
Any help in solving this is appreciated.
Hi,
I can confirm this script works with a WiFi module with serial number 604xxx.
Thank you for your efforts.
Cheers,
Edward
I used to read the data with this script for showing in my Node Red Dashboard. Worked perfect!
After my Omnik inverter died, this week I got a new Omnik2500tl. Unfortunately now it does not work anymore. Any idea how to solve this?
This is the result on LiveStats.py:
python LiveStats.py
2020-03-15 13:15:38,539 DEBUG Importing output plugin ConsoleOutput
2020-03-15 13:15:41,693 INFO Loggers found on the network: ['192.168.0.76', '80 9110293'].
2020-03-15 13:15:41,693 INFO Connecting to logger with IP: 192.168.0.76 and SN 8 0911****
2020-03-15 13:15:41,694 INFO connecting to 192.168.0.76 port 8899
2020-03-15 13:15:41,696 DEBUG RAW sent Packet (len=16): 68:02:41:b1:15:0b:3a:30: 15:0b:3a:30:01:00:09:16 hA:0:0
2020-03-15 13:15:44,699 ERROR Timeout connecting to logger with IP: 192.168.0.76 and SN 80911****, trying next logger.
Would it be possible to switch off the voltage in the Omnik-Data-Logger so that it is no longer sent to PVoutput?
OpenELEC:~/Omnik # python OmnikExport.py
2016-01-28 15:47:25,992 DEBUG Importing output plugin
Traceback (most recent call last):
File "OmnikExport.py", line 170, in
omnik_exporter.run()
File "OmnikExport.py", line 52, in run
import(plugin_name)
ValueError: Empty module name
Ik krijg dit voor mijn neus , de , moest nieuwe filel ophalen van Github , nieuwe Raspberry.
waar heb ik iets niet goed staan
Just unstalled and tested on newer model 606xxxxx
Runs nice!
Hi,
I just installed solar panels with an omnik inverter.
The datalogger is starting with 626
open ports are 80 and 8899
I'm not able to connect on port 8899 with your script
I can setup a bridge to be able to capture traffic.
Which software do I need to generate data to be captured ?
Currently I only see packets going to server 47.88.8.200 (data1.solarmanpv.com) to port 10000
Can we get data out of this to be able to connect to port 8899 on the inverter ?
Hi guys,
any idea on how to fix the following error
Bertins-Air-2:first bertinmayer$ python LiveStats.py
2018-08-27 11:32:54,146 DEBUG Importing output plugin ConsoleOutput
2018-08-27 11:32:54,148 INFO connecting to 192.168.178.30 port 80
2018-08-27 11:32:59,249 INFO ID:
2018-08-27 11:32:59,249 DEBUG Run pluginConsoleOutput
ID:
Traceback (most recent call last):
File "LiveStats.py", line 17, in
omnik_exporter.run()
File "/Users/bertinmayer/Omnik-Data-Logger/first/OmnikExport.py", line 82, in run
plugin.process_message(msg)
File "/Users/bertinmayer/Omnik-Data-Logger/first/outputs/ConsoleOutput.py", line 15, in process_message
print "E Today: {0:>5} Total: {1:<5}".format(msg.e_today, msg.e_total)
File "/Users/bertinmayer/Omnik-Data-Logger/first/InverterMsg.py", line 186, in e_today
return self.__get_short(69, 100) # Divide by 100
File "/Users/bertinmayer/Omnik-Data-Logger/first/InverterMsg.py", line 38, in __get_short
num = struct.unpack('!H', self.raw_msg[begin:begin + 2])[0]
struct.error: unpack requires a string argument of length 2
I've got a wifi card in my Omnik 3k-TL that has a 601 serial number and is not supported by this script. I've made a "packet sniffer" version of this script (with MQTT support and without the MySQL support) that is available at https://github.com/wouterbaake/OmnikMQTT.
The string used for requesting the data from the inverter is different for every inverter. So the script needs a specific binary string per inverter in order to work.
Hi, I have tried to convert your code to Python3 (as I have some dataloggers running that are in Python3), but I seem to get stuck in bit where the juggling with the string/bytes/hex values takes place. (the InverterMsg.generate_string logic)
Anyone who has accompoished this allready?
Hi,
I added support for wifi kits starting with s/n 402. It pushes the data to a public site.
Thanx for the module. Saved a lot of time :-)
Cheers,
widmar
Hoi Wouter,
Ik probeer de omnik uit te lezen. Ik heb de stappen gevolgd. Echter met python LiveStats.py gaat het al fout:
File "/home/user/Omnik-Data-Logger/OmnikExport.py", line 11, in <module>
import ConfigParser
ModuleNotFoundError: No module named 'ConfigParser'
Enig idee wat ik fout doe ? ik heb via pip geprobeerd om ConfigParser te installeren, maar dit was al geinstalleerd.
Sending attributes with mqtt paho client for integration with HomeAssistant
Need Paho Client - >
pip install paho-mqtt
Create new file MQTTOutput.py to /user/Omnik-Data-Logger/outputs
nano /xxxxxxxx/Omnik-Data-Logger/outputs/MQTTOutput.py
Edit config.cfg ->
enabled_plugins = MQTTOutput
######################
Create new sensor Home Assistant:
######## sensor.yaml ########
# - platform: mqtt
# name: "Energia Solare Oggi"
# state_topic: "tele/inverter/SENSOR"
# value_template: "{{value_json['ENERGY'].E_Today }}"
# unit_of_measurement : "kWh"
# expire_after: 120
# .......
############ MQTTOutput.py ################
import os
import PluginLoader
import paho.mqtt.client as mqtt
import json
import datetime
# Define Variables
MQTT_HOST = "192.168.3.10"
MQTT_PORT = 1883
MQTT_USER = "yourUser"
MQTT_PASS = "yourPassword"
MQTT_KEEPALIVE_INTERVAL = 45
MQTT_TOPIC = "tele/inverter/SENSOR"
#######################################################################
class ConsoleOutput(PluginLoader.Plugin):
"""Outputs the data from the Omnik inverter to stdout"""
def process_message(self, msg):
"""Output the information from the inverter to stdout.
Args:
msg (InverterMsg.InverterMsg): Message to process
"""
actual_time = datetime.datetime.now().replace(microsecond=0).isoformat()
json_body={"Time":actual_time,"ENERGY":{"Temp":(msg.temperature),"H_Total":(msg.h_total),"E_Today":(msg.e_today),"E_Total":(msg.e_total),"VPV1":(msg.v_pv(1)),"$
mqttc = mqtt.Client("inverter")
mqttc.username_pw_set(username=MQTT_USER, password=MQTT_PASS)
mqttc.connect(MQTT_HOST, MQTT_PORT, MQTT_KEEPALIVE_INTERVAL)
mqtt_msg=json.dumps(json_body)
mqttc.publish(MQTT_TOPIC, mqtt_msg)
mqttc.disconnect()
Hello,
I have a Omnik 2,5K TL2S with a diffent starting serial number. Is there anyway to upload it to PVoutput?
Greetings,
Maarten
Hey, I see you posted that your script works with modules from 602xxxxxx to 606xxxxxx.
But those codes are 9 digits long, and my module has a code 1603xxxxxx.
Do I need to remove the first 1, or does the code not work for my module
This week received a new inverter with a serial number started with 641.
After update the config file with IP and serial and the output the following error
pi@raspberrypi3:~/inverter $ python LiveStats.py
2019-03-02 11:12:01,513 DEBUG Importing output plugin ConsoleOutput
2019-03-02 11:12:01,516 INFO connecting to 192.168.1.145 port 8899
Traceback (most recent call last):
File "LiveStats.py", line 17, in
omnik_exporter.run()
File "/home/pi/inverter/OmnikExport.py", line 88, in run
data = inverter_socket.recv(1024)
socket.timeout: timed out
No idea what goes wrong ?
Hello, I tried to follow the wiki from Domoticz (https://www.domoticz.com/wiki/Omnik_Solar_Inverter). I get data out of my Omnik, but I'm struggling with the DomoticzOutput.py which was created. Everything is setup as mentioned in the wiki but I get Python errors when running OmnikExport.py.
Errors are:
2019-05-19 11:30:40,837 DEBUG Importing output plugin DomoticzOutput
Traceback (most recent call last):
File "OmnikExport.py", line 170, in
omnik_exporter.run()
File "OmnikExport.py", line 52, in run
import(plugin_name)
File "/home/pi/Omnik-Data-Logger/outputs/DomoticzOutput.py", line 30
def process_message(self, msg):
^
IndentationError: unexpected indent
I have to mention, I cannot read a single line of Python... (sorry), the error mentions Unexpected indent, but I dont know where of what to look for. I'm running Python 2.7.
Can someone help me to the right direction? Also, do I need to run Python 3 or is 2.7 still needed?
Hi!
I'm successfully using your application to pull data from my Omnik and store the CSV output in a unique file every 1 minute. But I'm unable to load the CSV files into jsunnyreports (http://www.jsunnyreports.com/). Problem is, I don't know what values jsunnyreports is expecting at what position in the file... Perhaps you have experience with this?
I also contacted the creator of jsunnyreports and awaiting response. Perhaps more people have issues with this so this issue would perhaps also help other people once we figure this out and post results here.
Thank you.
Ralf.
Beste Woutrrr,
Ik ben bezig om jouw programma werkend te krijgen. Ben geen programmeur en ben nu aan het stoeien met Putty. Is er ook een Jip en Janneke versie van jouw stappenplan?
Thanks.
Ard
Log via wifi works perfect.
But how to via ethernet? (Omnik module)
Hi Wouterrr,
Installed your logger scripts and it worked out-of-the-box, kudos for you! :-) However...
I have a separate Wifi box (1 device with SN 504XXXXXX) that uses RS485 (in a daisy chain) to connect to my 2 inverters. So no individual Wifi-kits on the inverters themselves. Livestats.py produces a neat message as expected, but shows only values of the first inverter, the second one is not shown.
Assuming that the received string holds data of both inverters, is there a way to extract the second one as wel? I know both ID's of the inverters and this could be added to config.cfg so the script could look up the string and parse from there?
I'm no programmer but pretty handy and willing to help/test whatever. TIA
Edit:
I saw this: InverterMsg.py on line 8 says:
def init(self, msg, offset=0):
Could this offset be used to parse several parts of the response message? I tried offsetting here but no visible effect.
Edit2: Can anyone point to the part of the code where I need to iterate parsing the message for more inverters?
When I run LiveStats.py I get:
connecting to 192.168.2.16 port 8899
But no response!
When I connect with my android phone to the converter using wifi followed by an manual mode of the app I immediately get the response below but the app crashes!
ID: NLDN502012AN3070
E Today: 9.73 Total: 15.6
H Total: 26 Temp: 18.1
PV1 V: 403.4 I: 0.2
PV2 V: 419.7 I: 0.1
PV3 V: -1 I: -1
L1 P: 97 V: 220.3 I: 0.4 F: 50.03
L2 P: -1 V: -1 I: -1 F: -1
L3 P: -1 V: -1 I: -1 F: -1
Any idea?
PVoutput has a temperature field for logging of weather conditions. However the temperature of the inverter is submitted. For users who configured a weather station, submitting this value is useless. So uploading of the temperature should be disable-able in the configuration.
Opening on port 8899 does give a connection refused. Scanning my (internal build-in) WIFI does not seem to have a port 8899 (only port 80)
Hello,
i'm missing the power value of L3. L1 and 2 work perfect but L3 is missing.
When I look in InverterMsg.py I see the next code.
I added a print for debug
``
def p_ac(self, i=1):
"""Power output of the output channel
Available channels are 1, 2 or 3; if no tin this range the function will
default to channel 1.
Args:
i (int): output channel (valid values: 1, 2, 3)
Returns:
float: Power output of channel i
"""
if i not in range(1, 4):
i = 1
num = 59 + (i - 1) * 4
print num, ": L", i, ": ", int(self.__get_short(num, 1))
return int(self.__get_short(num, 1)) # Don't divide
``
In the console it looks like:
59 : L 1 : 394
63 : L 2 : 380
67 : L 3 : 0
What can this be? Or is this not the power for each phase?
Nieuwe provider ,dus nieuwe instelling etc.
Die dus aangepast
LiveStats geeft de opbrengst weer maar OmnikExport antwoord met een fout
LibreELEC:/omnik # python OmnikExport.py/omnik # python OmnikExport.py
2020-05-28 10:38:00,574 DEBUG Importing output plugin PVoutputOutput
2020-05-28 10:38:00,722 INFO connecting to 192.168.2.14 port 8899
2020-05-28 10:38:01,433 INFO ID: NLDN2020132S2067
2020-05-28 10:38:01,434 DEBUG Run pluginPVoutputOutput
LibreELEC:
2020-05-28 10:40:21,220 DEBUG Importing output plugin PVoutputOutput
2020-05-28 10:40:21,372 INFO connecting to 192.168.2.14 port 8899
2020-05-28 10:40:22,014 INFO ID: NLDN2020132S2067
2020-05-28 10:40:22,016 DEBUG Run pluginPVoutputOutput
2020-05-28 10:40:22,018 INFO Uploading to PVoutput
Traceback (most recent call last):
File "OmnikExport.py", line 170, in
omnik_exporter.run()
File "OmnikExport.py", line 82, in run
plugin.process_message(msg)
File "/storage/omnik/outputs/PVoutputOutput.py", line 49, in process_message
response = urllib2.urlopen(request_object)
File "/usr/lib/python2.7/urllib2.py", line 154, in urlopen
File "/usr/lib/python2.7/urllib2.py", line 435, in open
File "/usr/lib/python2.7/urllib2.py", line 548, in http_response
File "/usr/lib/python2.7/urllib2.py", line 473, in error
File "/usr/lib/python2.7/urllib2.py", line 407, in _call_chain
File "/usr/lib/python2.7/urllib2.py", line 556, in http_error_default
urllib2.HTTPError: HTTP Error 403: Forbidden
Wat kan er fout zijn
There are 4 issues with the LiveStats.py:
The configuration file doesn't work when the script is run from a other directory.
Hi Woutrrr,
I just got a bunch of solar panels. Your script works great! So thumbs up for that.
I'd like to make the scripts a bit smarter by for instance being able to read data further into the history of the data logger. I assume that the WiFi package has a small storage in case WiFi is temporarily off for whatever reason.
Line 73 of OmnikExport is where you read out the data. I thought it would be cool if the user could provide a start date and then OmnikExport will search back in history where to start. I don't have the API of the WiFi module so haven't got a clue how to read into history. Do you have any idea how this could be achieved?
Best,
hcwinsemius
I followed the instructions to set up de Omnik, but no data and errors. Omnik Vrtual and sensors are visible.
Livestat.py debug gives a error:
%Debug LiveStats.py
Traceback (most recent call last):
File "/home/pi/Omnik-Data-Logger/LiveStats.py", line 7, in
import OmnikExport
File "/home/pi/Omnik-Data-Logger/OmnikExport.py", line 11, in
import ConfigParser
ImportError: No module named 'ConfigParser
========================================
InverterMsg.py debug gives an error:
Python 3.4.2 (/usr/bin/python3)
%Run InverterMsg.py
File "/home/pi/Omnik-Data-Logger/InverterMsg.py", line 73
print self.__get_short(59)
^
SyntaxError: invalid syntax
===========================================
config looks like this:
general]
enabled_plugins = type:DomoticzOutput
[inverter]
ip = 10.10.xxx.xxx. # is ipades visible in Omnik GUI. # 192.168.xxx.xxx = normal ipadres DCHP router ## ??????
port = 8899
wifi_sn = 603080xxx # fill out s/n
#use temperature of inverter for pvoutput
use_temperature = true
[mysql]
host = 127.0.0.1
user =
pass =
database =
[pvout]
#apikey = NOTAREALAPIKEY86e2258d4e29169fb79cf18b00
#sysid = 12345
[csv]
disable_header = false
[log]
type = console
level = debug
filename = omnik-export.log
[domoticz]
domoticz_host = 192.168.xxx.xxx #
domoticz_port = 8080 #
domoticz_url = json.htm
I use a Omnik wifi module starting s/n 603xx
Domoticz version 3.8153
Rapsberrypi. V3
Please help?
thanks
Paul
Your routine InverterMsg.py overlaps other data. i.e. getFAC(2) is equal to getPAC(1) and getFac(3) is equal to getPAC(2), etc. The datastream received from my inverter returns only one FAC value (pos 57, 2 bytes)
Simple question:
How to obtain CSV data?
PVoutput works great.
Output to console works great.
Tried a few things with stdout but no results.
Any help would be great.
Omnik-Data-Logger on Raspberry PI zero-w with Debian Buster 10
Thanks in advance.
I noticed that the python script reads out my inverter correctly.
So maybe README.MD can be updated so people with 603 are not discouraged to try.
Inverter: NLDN2020134J1085
S/N: 603701905
FW Main: NL1_V1.0-0043-4
FW Slave: V1.6-0018
for those who want to use is hereby a small influxdb (json) output script
import PluginLoader
import os
from influxdb import client as influxdb
#enter ip-address of database, port and databasename
db = influxdb.InfluxDBClient("192.168.2.30", 8086, "", "", "databasename")
class ConsoleOutput(PluginLoader.Plugin):
"""Outputs the data from the Omnik inverter to stdout"""
def process_message(self, msg):
"""Output the information from the inverter to stdout.
Args:
msg (InverterMsg.InverterMsg): Message to process
"""
json_body = [
{
"measurement": "zuidpanelen",
"fields": {
"ID": (msg.id),
"Temp": (msg.temperature),
"H_Total": (msg.h_total),
"E_Today": (msg.e_today),
"E_Total": (msg.e_total),
"VPV1": (msg.v_pv(1)),
"VPV2": (msg.v_pv(2)),
"VPV3": (msg.v_pv(3)),
"IPV1": (msg.i_pv(1)),
"IPV2": (msg.i_pv(2)),
"IPV3": (msg.i_pv(3)),
"L1_pac": (msg.p_ac(1)),
"L1_vac": (msg.v_ac(1)),
"L1_iac": (msg.i_ac(1)),
"L1_fac": (msg.f_ac(1)),
"L2_pac": (msg.p_ac(2)),
"L2_vac": (msg.v_ac(2)),
"L2_iac": (msg.i_ac(2)),
"L2_fac": (msg.f_ac(2)),
"L3_pac": (msg.p_ac(3)),
"L3_vac": (msg.v_ac(3)),
"L3_iac": (msg.i_ac(3)),
"L3_fac": (msg.f_ac(3)),
}
}
]
#uncomment row bellow for troubleshooting
#print json_body
db.write_points(json_body )
I have a Solax 3300TL inverter which I believe uses the same wifi module. The script connects to the inverter, but seems to stumble at line 58. My SN starts 613xxx. Any idea how I might debug and update the script in order to get it working?
I use this script on a Hosola inverter that has a wifi module starting with 617. Everything working fine. I used the MQTT version in the pull request.
So this is not an issue, just to update the documentation.
Hi Woutrrr,
I followed your instructions but I can't manage to get any data in Domoticz.
The logfiles are also empty, while the config file says logging enabled.
Used the correct IDX for the virtual sensors in Domoticz, but no data...
Any suggestions?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.