Omniksol solar inverter

Moderator: leecollings

Post Reply
Pischy
Posts: 1
Joined: Thursday 09 May 2019 21:13
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Omniksol solar inverter

Post by Pischy »

I've been trying to get my solar panels to report to domoticz for a while now, but due to the high s/n of the wifi kits couldn't get any of the various omnik-data-logger solutions I found working.

Finally I found a quite straight forward bash script that reads the status.js file from the inverter and filters out the current power and daily energy produced to send to domoticz. As you can see below I have two slightly different inverters, so they require different grep commands. And combining of theire outputs to get the totals

Code: Select all

#! /bin/bash

energy1=$(wget --user admin --password admin http://INVERTER1_IP/js/status.js -q -O - | sed -e 's/;/\n/g' | grep -e "^myDeviceArray" | cut -d'=' -f 2 | sed -e 's/"/,/g' | cut -d, -f8)
energy2=$(wget --user admin --password admin http://INVERTER2_IP/js/status.js -q -O - | sed -e 's/;/\n/g' | grep -e "^var" | grep -i webdata | sed -e 's/var webData=/,/g' | sed -e 's/"//g' | cut -d, -f8)

# Multiply by ten to get kWh
energy10=$(expr 10 '*' $energy1)
energy20=$(expr 10 '*' $energy2)


# echo "Energy generated (3k): " $energy10
# echo "Energy generated (2k): " $energy20
totalenergy=$(expr $energy10 + $energy20)

echo "Total energy generated: " $totalenergy

power1=$(wget --user admin --password admin http://INVERTER1_IP/js/status.js -q -O - | sed -e 's/;/\n/g' | grep -e "^myDeviceArray" | cut -d'=' -f 2 | sed -e 's/"/,/g' | cut -d, -f7)
power2=$(wget --user admin --password admin http://INVERTER2_IP/js/status.js -q -O - | sed -e 's/;/\n/g' | grep -e "^var" | grep -i webdata | sed -e 's/var webData=/,/g' | sed -e 's/"//g' | cut -d, -f7)

# echo "Current power (3k): " $power1
# echo "Current power (2k): " $power2

totalpower=$(expr $power1 + $power2)

echo "Total current power: " $totalpower

curl -s "http://DOMOTICZ_IP:8080/json.htm?type=command&param=udevice&idx=455&nvalue=0&svalue="$totalpower";"$totalenergy

With little modification you should also be able to send the total genereted energy, if your interested in that

As you see this script queries the inverter twice, once for the engery and once for the current power. My bash experiance is limited, so any optimization help is welcome!
User avatar
sincze
Posts: 1302
Joined: Monday 02 June 2014 22:46
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.4
Location: Netherlands / Breda Area
Contact:

Re: Omniksol solar inverter

Post by sincze »

Maybe this is an option as well?

http://www.mb200d.nl/wordpress/2015/11/ ... -wifi-kit/

Sent from my ONEPLUS A6003 using Tapatalk

Pass2php
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave, Sonoff 3
MQTT: ZIgbee2MQTT,
ZWAVE: Zwave-JS-UI
WIFI: Mi-light, Tasmota, Xiaomi Shelly
Solar: Omnik, PVOutput
Video: Kodi, Harmony HUB, Chromecast
Sensors: You name it I got 1.
User avatar
sincze
Posts: 1302
Joined: Monday 02 June 2014 22:46
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.4
Location: Netherlands / Breda Area
Contact:

Re: Omniksol solar inverter

Post by sincze »

Pischy wrote: Thursday 09 May 2019 21:41 I've been trying to get my solar panels to report to domoticz for a while now, but due to the high s/n of the wifi kits couldn't get any of the various omnik-data-logger solutions I found working.

Finally I found a quite straight forward bash script that reads the status.js file from the inverter and filters out the current power and daily energy produced to send to domoticz. As you can see below I have two slightly different inverters, so they require different grep commands. And combining of theire outputs to get the totals

Code: Select all

#! /bin/bash

energy1=$(wget --user admin --password admin http://INVERTER1_IP/js/status.js -q -O - | sed -e 's/;/\n/g' | grep -e "^myDeviceArray" | cut -d'=' -f 2 | sed -e 's/"/,/g' | cut -d, -f8)
energy2=$(wget --user admin --password admin http://INVERTER2_IP/js/status.js -q -O - | sed -e 's/;/\n/g' | grep -e "^var" | grep -i webdata | sed -e 's/var webData=/,/g' | sed -e 's/"//g' | cut -d, -f8)

# Multiply by ten to get kWh
energy10=$(expr 10 '*' $energy1)
energy20=$(expr 10 '*' $energy2)


# echo "Energy generated (3k): " $energy10
# echo "Energy generated (2k): " $energy20
totalenergy=$(expr $energy10 + $energy20)

echo "Total energy generated: " $totalenergy

power1=$(wget --user admin --password admin http://INVERTER1_IP/js/status.js -q -O - | sed -e 's/;/\n/g' | grep -e "^myDeviceArray" | cut -d'=' -f 2 | sed -e 's/"/,/g' | cut -d, -f7)
power2=$(wget --user admin --password admin http://INVERTER2_IP/js/status.js -q -O - | sed -e 's/;/\n/g' | grep -e "^var" | grep -i webdata | sed -e 's/var webData=/,/g' | sed -e 's/"//g' | cut -d, -f7)

# echo "Current power (3k): " $power1
# echo "Current power (2k): " $power2

totalpower=$(expr $power1 + $power2)

echo "Total current power: " $totalpower

curl -s "http://DOMOTICZ_IP:8080/json.htm?type=command&param=udevice&idx=455&nvalue=0&svalue="$totalpower";"$totalenergy

With little modification you should also be able to send the total genereted energy, if your interested in that

As you see this script queries the inverter twice, once for the engery and once for the current power. My bash experiance is limited, so any optimization help is welcome!
recently created a plugin for that for testing:
https://github.com/sincze/Domoticz-Omni ... Web-Plugin
Pass2php
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave, Sonoff 3
MQTT: ZIgbee2MQTT,
ZWAVE: Zwave-JS-UI
WIFI: Mi-light, Tasmota, Xiaomi Shelly
Solar: Omnik, PVOutput
Video: Kodi, Harmony HUB, Chromecast
Sensors: You name it I got 1.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest