dr-ni / mi600 Goto Github PK
View Code? Open in Web Editor NEWDirect data access bash-script for the solar-inverter bosswerk mi600, mi300 / deye Sun-600G3
License: MIT License
Direct data access bash-script for the solar-inverter bosswerk mi600, mi300 / deye Sun-600G3
License: MIT License
Hi,
thanks for the basic idea, I changed the script to something like this:
#!/bin/bash
host=$1
auth=$2:$3
FILE=$(mktemp)
trap "rm -f $FILE" EXIT
curl -s -u "$auth" "$host"/status.html > $FILE
grep "webdata_now_p =" $FILE | awk -F '"' '{print "Now:", $2, "W"}'
grep "webdata_today_e =" $FILE | awk -F '"' '{print "Today:", $2, "kWh"}'
grep "webdata_total_e =" $FILE | awk -F '"' '{print "Total:", $2, "kWh"}'
So you grab once the status to a temp-file, grep and awk it, and print everything at once. Or something like this:
pnow=$(grep "webdata_now_p =" $FILE | awk -F '"' '{print "Now:", $2, "W"}')
etoday=$(grep "webdata_today_e =" $FILE | awk -F '"' '{print "Today:", $2, "kWh"}')
now=$(date)
echo "$now\t$pnow\t$etoday"
Is it possible that you add some extract string with the value but without extension Unit "W" or "kWh"
or a switch that that extract the 4 value and jump over your then
dat=$4
val=''
[ "$dat" = "webdata_today_e" ] && val=kWh
[ "$dat" = "webdata_total_e" ] && val=kWh
[ "$dat" = "webdata_now_p" ] && val=W
fi
i use your script for my upload data script for VZ-DB
i also add nowaday the total value
i had some Problems with the value maybe that also some idea/problem for your script to take in account
for actual power i had a zero in front
#request value
ACTUAL=$(/usr/local/bin/mi600 $host_pv $user $password webdata_now_p)
#remove Zero in Front
ACTUAL_NUM=$(($ACTUAL))
and for Total Energy i had a Space at the End
#request value TOTAL
TOTAL=$(/usr/local/bin/mi600 $host_pv $user $password webdata_total_e)
#Remove end SPACE-Char
TOTAL_NUM=$(echo $TOTAL | sed 's/[[:space:]]*$//')
Hi
Thank you for the script to get the inverter values.
It works perfectly.
How can I insert and bundle the information in iobroker.
I have seen that many types provide the same information.
Very nice work without having to access a cloud.
I would be happy if there is a possibility to import the data into Iobroker.
Greetings Andre
Please can you give a little more comments and explanations about the steps ( loops)
not all are so deep in bash and would like to improve bash skills as well.
I'm trying to include this script in a project " Volkzähler " visiualization of energy consumption for my home.
to do this it is enough for me to query the data every few minutes as in your script and send the values to the database via json request.
Translated with www.DeepL.com/Translator (free version)
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.