Comments (12)
Yes I think I understand what you mean,
If we grab an other field from the return JSON (total generated) value should always be correct as that one is retrieved from the INVERTER website so should be accurate.
It should be correct...
$todaypower = (float)str_ireplace('kWh', '', $data['todayStr']);
Did you configure your device like:
from domoticz.
I Have been struggling with that and thought it hat to be computed?
Should it be changed?
from domoticz.
from domoticz.
Oeps that works out strangely:
The day before yesterday I changed to "From Device". Very strange result. Suddenly I have a very big number for the output of my solar system. Just before 00:00 hours I switched back to "Computed". Left it during yesterday. but now the per hour bars have disappeared. This morning I tried again. No difference. I cannot get it working again. What to do now?
from domoticz.
I think I spotted the issue. You probably creatd incremental counter.
That is an issue if the counter is reset everyday ''todayStr'' starts with 0 every day.
$todaypower = (float)str_ireplace('kWh', '', $data['todayStr']);
Let me check.
from domoticz.
Can you modify
$todaypower = (float)str_ireplace('kWh', '', $data['todayStr']);
to
$todaypower = (float)str_ireplace('kWh', '', $data['totalValue']);
I've also created a Domoticz plugin.
https://github.com/sincze/Domoticz-Growatt-Webserver-Plugin
from domoticz.
I have updated as proposed. The code now looks like:
if ($continue) { $data = json_decode($result, JSON_PRETTY_PRINT);
$nowpower = (float)str_ireplace('kWh', '', $data['powerValue']);
$todaypower = (float)str_ireplace('kWh', '', $data['totalValue']);
$str=( $nowpower.';'. $todaypower * 1000 ); #times 1000 to convert the 0.1kWh to 100 WattHour and to convert 2.1kWh to 2100 WattHour
lg('Growatt Inverter: '. $nowpower.' for domoticz: '.$str);
ud(DOMOTICZDEVICE,0,$str,'GrowattInverter: Generation updated');
}
It looks better but the values seem 1000 times to high.
Do I need to change the conversion? I am so happy you help me with this. Thank you.
from domoticz.
Huge values. I now changed:
$str=( $nowpower.';'. $todaypower * 1000 ); #times 1000 to convert the 0.1kWh to 100 WattHour and to convert 2.1kWh to 2100 WattHour
To:
$str=( $nowpower.';'. $todaypower * 1 ); #times 1000 to convert the 0.1kWh to 100 WattHour and to convert 2.1kWh to 2100 WattHour
Values reported in the log file now seem okay. Don't know how to update the values in Domoticz. But that is an nice task for the upcoming days. I am hopeful it works now.
from domoticz.
After I changed the multiplication factor the yellow line is fine. The blue bars stay at zero. I have been looking at the code but donot understand this enough to try something else. The log file says now:
2020-04-13 11:35:02.904 Status: --->> Cookie File: /home/pi/domoticz/scripts/pass2php/growatt.cookie exists!
2020-04-13 11:35:02.907 Status: --->> Cookie File: /home/pi/domoticz/scripts/pass2php/growatt.cookie is writable!
2020-04-13 11:35:04.191 Status: --->> Growatt Inverter: 1880.7 for domoticz: 1880.7;569.1
2020-04-13 11:35:04.213 Status: --->> (udevice) | 11 => 0,1880.7;569.1
Where before I changed the multiplication factor from 1000 to 1 the logfile showed:
2020-04-13 09:50:02.175 Status: --->> Cookie File: /home/pi/domoticz/scripts/pass2php/growatt.cookie exists!
2020-04-13 09:50:02.179 Status: --->> Cookie File: /home/pi/domoticz/scripts/pass2php/growatt.cookie is writable!
2020-04-13 09:50:03.367 Status: --->> Growatt Inverter: 386.1 for domoticz: 386.1;567400
2020-04-13 09:50:03.381 Status: --->> (udevice) | 11 => 0,386.1;567400
Hope this helps.
from domoticz.
Leave the code as I suggested it works just fine.
If you never worked with totalvalue before you will indeed notice a big spike..
ONLY After 24h it is okay and you can remove the big spike as that is the number of generated energy since installation. )
from domoticz.
You are very right! It works fine now. Thank you very much very your detailed help, much appreciated!
from domoticz.
Haha well I've sailed that boat many times. ;-) and sometimes I remember stuff.
from domoticz.
Related Issues (7)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from domoticz.