Page 1 of 1

Omniksol solar inverter

Posted: Thursday 09 May 2019 21:41
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!

Re: Omniksol solar inverter

Posted: Friday 10 May 2019 20:04
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


Re: Omniksol solar inverter

Posted: Tuesday 30 July 2019 18:59
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