Page 1 of 2
Growatt shows minus value since update of domoticz
Posted: Friday 23 April 2021 9:09
by rick8245
Hi,
Since the update of Domoticz last week, my Growatt Inverter shows a minus value instead of the correct value.

- growatt.png (15.5 KiB) Viewed 2534 times
Does someone knows how to get back the correct value ?
thanks in advance
Rick
Re: Growatt shows minus value since update of domoticz
Posted: Friday 23 April 2021 14:08
by waltervl
Looks like
viewtopic.php?f=6&t=36076 or
viewtopic.php?f=6&t=35610 or
viewtopic.php?f=14&t=35958
Solution: Change the script (or is it domoticz hardware plugin?) or change (edit button) on the device the daily energy read from "from device" to "computed".
Re: Growatt shows minus value since update of domoticz
Posted: Saturday 24 April 2021 11:11
by rick8245
Thanks for the answer Waltervl,
Unfortunately none of the suggestiosn did not work out for me yet.
Any other ideas ??
Thanks in advance,
Rick
Re: Growatt shows minus value since update of domoticz
Posted: Saturday 24 April 2021 12:31
by waltervl
What hardware device/plugin or script are you using for Growatt?
Re: Growatt shows minus value since update of domoticz
Posted: Saturday 24 April 2021 14:03
by rick8245
Hardware is dummy and for the device I followed this page (which is in Dutch)
but the commands may give you the needed info.
https://robothuis.nl/2020/01/13/zonnepa ... -domoticz/
Re: Growatt shows minus value since update of domoticz
Posted: Saturday 24 April 2021 14:21
by waltervl
Perhaps ask it in a remark on that page. Things have changed somewhat in these devices so that php script probably needs a modification.
Re: Growatt shows minus value since update of domoticz
Posted: Saturday 24 April 2021 14:28
by rick8245
Thanks I will contact them.
Re: Growatt shows minus value since update of domoticz
Posted: Saturday 24 April 2021 14:33
by sincze
Please check you are using the latest version that has:
Code: Select all
//$todaypower = (float)str_ireplace('kWh', '', $data['todayStr']);
$todaypower = (float)str_ireplace('kWh', '', $data['totalStr']); // 18-04-2020
in it.
Re: Growatt shows minus value since update of domoticz
Posted: Saturday 24 April 2021 16:20
by rick8245
This line is in my .php script. So that must be ok
Re: Growatt shows minus value since update of domoticz
Posted: Saturday 24 April 2021 18:33
by sincze
Let me check with my code then as currently not expecting issues.
Re: Growatt shows minus value since update of domoticz
Posted: Saturday 24 April 2021 18:59
by rick8245
@Sincze, do you not have this problem ??
I include my script here
Re: Growatt shows minus value since update of domoticz
Posted: Saturday 24 April 2021 22:49
by sincze
Slight difference so it seems.
Mine has:
Code: Select all
$data = json_decode($result, JSON_PRETTY_PRINT);
if(!empty($data['todayStr']) && !empty($data['totalValue'])) {
$nowpower = (float)$data['powerValue'];
$todaypower = (float)$data['todayValue']; // kWH
$allpower = (float)$data['totalValue']; // [totalStr] => 1505.4kWh [totalValue] => 1505.4
$allpower = $allpower*1000; // Convert to Wh
$str=( $nowpower.';'.$allpower ); // 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');
}
Re: Growatt shows minus value since update of domoticz
Posted: Sunday 25 April 2021 12:13
by rick8245
Hi Sincze,
If I modify my old block with your block it looks like this:
curl_close($curl);
$data = json_decode($result, JSON_PRETTY_PRINT);
if(!empty($data['todayStr']) && !empty($data['totalValue'])) {
$nowpower = (float)$data['powerValue'];
$todaypower = (float)$data['todayValue']; // kWH
$allpower = (float)$data['totalValue']; // [totalStr] => 1505.4kWh [totalValue] => 1505.4
$allpower = $allpower*1000; // Convert to Wh
$str=( $nowpower.';'.$allpower ); // 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');
}
But....unfortunately the result is still the same.
Can you send me your whole script ?
Re: Growatt shows minus value since update of domoticz
Posted: Sunday 25 April 2021 12:29
by rick8245
Now I see this value at today value : 3201.900
So this looks not OK. It should be 1.5 (it is cloudy outside)
Re: Growatt shows minus value since update of domoticz
Posted: Sunday 25 April 2021 12:34
by sincze
Wait 24h hours it is the correction.
Look at the code change.

Re: Growatt shows minus value since update of domoticz
Posted: Sunday 25 April 2021 12:41
by rick8245
ok , i will keep you informed
Re: Growatt shows minus value since update of domoticz
Posted: Sunday 25 April 2021 12:51
by sincze
If you look at what changed in the code

this will explain why you see the big value. (we went from daily to total generation)
Domoticz needed this 1 time correction, hence the -xx values every day.
Next day it will look like:

- Growatt_Solar.png (20.09 KiB) Viewed 2448 times
As you can see this is pretty much now

Re: Growatt shows minus value since update of domoticz
Posted: Monday 26 April 2021 10:19
by rick8245
@Sincze: Thanks for all your support.
It works like a charm again.
Re: Growatt shows minus value since update of domoticz
Posted: Monday 26 April 2021 10:46
by sincze
You are welcome. Maybe we should update GitHub as well.

Pull request ???
Re: Growatt shows minus value since update of domoticz
Posted: Monday 26 April 2021 10:57
by rick8245
I do not know how that works .