Growatt shows minus value since update of domoticz

Moderator: leecollings

rick8245
Posts: 74
Joined: Wednesday 22 April 2020 15:59
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Growatt shows minus value since update of domoticz

Post by rick8245 »

Hi,

Since the update of Domoticz last week, my Growatt Inverter shows a minus value instead of the correct value.
growatt.png
growatt.png (15.5 KiB) Viewed 2133 times
Does someone knows how to get back the correct value ?

thanks in advance

Rick
User avatar
waltervl
Posts: 5721
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Growatt shows minus value since update of domoticz

Post 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".
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
rick8245
Posts: 74
Joined: Wednesday 22 April 2020 15:59
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Growatt shows minus value since update of domoticz

Post 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
User avatar
waltervl
Posts: 5721
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Growatt shows minus value since update of domoticz

Post by waltervl »

What hardware device/plugin or script are you using for Growatt?
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
rick8245
Posts: 74
Joined: Wednesday 22 April 2020 15:59
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Growatt shows minus value since update of domoticz

Post 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/
User avatar
waltervl
Posts: 5721
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Growatt shows minus value since update of domoticz

Post 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.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
rick8245
Posts: 74
Joined: Wednesday 22 April 2020 15:59
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Growatt shows minus value since update of domoticz

Post by rick8245 »

Thanks I will contact them.
User avatar
sincze
Posts: 1300
Joined: Monday 02 June 2014 22:46
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.4
Location: Netherlands / Breda Area
Contact:

Re: Growatt shows minus value since update of domoticz

Post 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.
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.
rick8245
Posts: 74
Joined: Wednesday 22 April 2020 15:59
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Growatt shows minus value since update of domoticz

Post by rick8245 »

This line is in my .php script. So that must be ok
User avatar
sincze
Posts: 1300
Joined: Monday 02 June 2014 22:46
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.4
Location: Netherlands / Breda Area
Contact:

Re: Growatt shows minus value since update of domoticz

Post by sincze »

Let me check with my code then as currently not expecting issues.
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.
rick8245
Posts: 74
Joined: Wednesday 22 April 2020 15:59
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Growatt shows minus value since update of domoticz

Post by rick8245 »

@Sincze, do you not have this problem ??
I include my script here
Attachments
GW_php_script.txt
(10.08 KiB) Downloaded 70 times
User avatar
sincze
Posts: 1300
Joined: Monday 02 June 2014 22:46
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.4
Location: Netherlands / Breda Area
Contact:

Re: Growatt shows minus value since update of domoticz

Post 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');
}
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.
rick8245
Posts: 74
Joined: Wednesday 22 April 2020 15:59
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Growatt shows minus value since update of domoticz

Post 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 ?
rick8245
Posts: 74
Joined: Wednesday 22 April 2020 15:59
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Growatt shows minus value since update of domoticz

Post 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)
Attachments
growaat_new.png
growaat_new.png (11.79 KiB) Viewed 2049 times
User avatar
sincze
Posts: 1300
Joined: Monday 02 June 2014 22:46
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.4
Location: Netherlands / Breda Area
Contact:

Re: Growatt shows minus value since update of domoticz

Post by sincze »

Wait 24h hours it is the correction.
Look at the code change. :)
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.
rick8245
Posts: 74
Joined: Wednesday 22 April 2020 15:59
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Growatt shows minus value since update of domoticz

Post by rick8245 »

ok , i will keep you informed
User avatar
sincze
Posts: 1300
Joined: Monday 02 June 2014 22:46
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.4
Location: Netherlands / Breda Area
Contact:

Re: Growatt shows minus value since update of domoticz

Post 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
Growatt_Solar.png (20.09 KiB) Viewed 2047 times
As you can see this is pretty much now ;-)
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.
rick8245
Posts: 74
Joined: Wednesday 22 April 2020 15:59
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Growatt shows minus value since update of domoticz

Post by rick8245 »

@Sincze: Thanks for all your support.

It works like a charm again.
Attachments
Growatt_OK.png
Growatt_OK.png (18.71 KiB) Viewed 2030 times
User avatar
sincze
Posts: 1300
Joined: Monday 02 June 2014 22:46
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.4
Location: Netherlands / Breda Area
Contact:

Re: Growatt shows minus value since update of domoticz

Post by sincze »

You are welcome. Maybe we should update GitHub as well. :) Pull request ???
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.
rick8245
Posts: 74
Joined: Wednesday 22 April 2020 15:59
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Growatt shows minus value since update of domoticz

Post by rick8245 »

I do not know how that works .
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest