Doc is always a nightmare: for those writing it, as it's hard to put everything in understandable form, for those reading it, as it's hard to try to understand what has been written
In our case, reformatting JSON may help. Here's the same payload, indented:
Code: Select all
"device": "RX04020003",
"time": "2024-02-17T11:52:04",
"buffered": "no",
"values": {
"datalogserial": "AH24030766",
"pvserial": "RX04020003",
"pvstatus": 1,
"pvpowerin": 5278,
"pv1voltage": 2858,
"pv1current": 9,
"pv1watt": 2572,
"pv2voltage": 3007,
"pv2current": 9,
"pv2watt": 2706,
"pvpowerout": 5056,
"pvfrequentie": 4999,
"pvgridvoltage": 2374,
"pvgridcurrent": 7,
"pvgridpower": 1661,
"pvgridvoltage2": 2345,
"pvgridcurrent2": 7,
"pvgridpower2": 1641,
"pvgridvoltage3": 2356,
"pvgridcurrent3": 7,
"pvgridpower3": 1649,
"pvenergytoday": 10,
"pvenergytotal": 498842,
"totworktime": 263661315,
"pvtemperature": 224,
"pvipmtemperature": 0,
"epv1today": 5,
"epv1total": 254644,
"epv2today": 5,
"epv2total": 254255,
"epvtotal": 508899
}
}
As you can see, item "pv1voltage" is not at first level, but after "values". It's name should be "value/pv1voltage" to find it. See "Item deeper in JSON message / L'item est enfoui dans le message JSON" in plugin doc.
Then, as per Domoticz's documentation (
https://www.domoticz.com/wiki/Developin ... vice_Types), voltage device is type=243, subtype=8. Expected data (
https://www.domoticz.com/wiki/Domoticz_API/JSON_URL%27s) is voltage in floating (or integer) representation. Visibly, returned JSON data gives voltage in 1/10 of Volt, so you need to divide it by 10 to get correct Volt value. See "With multiplier / Avec Multiplicateur" in plugin doc.
Giving that, let's try with
Code: Select all
{
"PV1 voltage": {
"topic": "energy/growatt",
"type": "243", "subtype": "8", "switchtype": "0",
"mapping": {"item": "values/pv1voltage", "multiplier": 0.1}
}
}
Now, should you want to extract more values from the same topic, you may use the "key" keyword into definition. see "One topic/Multiple devices / Un topic/Plusieurs dispositifs" in plugin doc.
For example, adding current (type243, subtype 23), example will become:
Code: Select all
{
"PV1 voltage": {
"topic": "energy/growatt",
"key": "energy/growatt/pv1voltage",
"type": "243", "subtype": "8", "switchtype": "0",
"mapping": {"item": "values/pv1voltage", "multiplier": 0.1}
},
"PV1 current": {
"topic": "energy/growatt",
"key": "energy/growatt/pv1current",
"type": "243", "subtype": "23", "switchtype": "0",
"mapping": {"item": "values/pv1current"}
}
}
Adding frequency is a bit more complicated, as there's no frequency device in Domoticz. However, there's a custom counter (type 243, subtype 31). Axis name can be specified in options (see "Device options (partial) list / Liste (partielle) des options" in plugin doc). As described, options specifies the multiplier (here frequency is given with 2 decimals, as 4999 in you example, so we must multiply by 0.01), and unit is Hz, so options should be 0.01;Hz.
New example becomes:
Code: Select all
{
"PV1 voltage": {
"topic": "energy/growatt",
"key": "energy/growatt/pv1Volt",
"type": "243", "subtype": "8", "switchtype": "0",
"mapping": {"item": "values/pv1voltage", "multiplier": 0.1}
},
"PV1 current": {
"topic": "energy/growatt",
"key": "energy/growatt/pv1Amp",
"type": "243", "subtype": "23", "switchtype": "0",
"mapping": {"item": "values/pv1current"}
},
"PV1 frequency": {
"topic": "energy/growatt",
"key": "energy/growatt/pvHz",
"type": "243", "subtype": "31", "switchtype": "0",
"options": {"Custom":"0.01;Hz"},
"mapping": {"item": "values/pvfrequentie"}
}
}
Few words about energy devices, as you may want to use them if you understand keywords meaning in JSON file. Globally speaking, they need (at least) 2 values : instantaneous consumption (in W) and global consumption (since device initialization), in Wh (even if data is shown in KWh in Domoticz).
It seems you have daily and total data in your JSON data. Don't use daily but total data (Domoticz will compute daily delta at midnight).
Hope this helps