[growatt] Enhancements for MID inverter and Smart Meter (#17810)

* [growatt] Enhancements for MID inverter and Smart Meter
* remove excess comment

Signed-off-by: AndrewFG <software@whitebear.ch>
This commit is contained in:
Andrew Fiddian-Green 2024-11-30 19:05:02 +00:00 committed by GitHub
parent 9b803b0334
commit 5cf6feaab5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 443 additions and 8 deletions

View File

@ -142,6 +142,25 @@ The list of all possible channels is as follows:
| charge-va | Number:Power | Charging reactive power. | yes |
| inverter-clock-offset | Number:Time | Time offset of inverter clock vs. OH system clock. | yes |
| inverter-fan-speed | Number:Dimensionless | Inverter fan speed percent. | yes |
| pv3-voltage | Number:ElectricPotential | Voltage from solar panel string #3. | yes |
| pv3-current | Number:ElectricCurrent | Current from solar panel string #3. | yes |
| pv3-power | Number:Power | Power from solar panel string #3. | yes |
| pv4-voltage | Number:ElectricPotential | Voltage from solar panel string #4. | yes |
| pv4-current | Number:ElectricCurrent | Current from solar panel string #4. | yes |
| pv4-power | Number:Power | Power from solar panel string #4. | yes |
| pv3-energy-today | Number:Energy | Solar DC energy collected by string #3 today. | yes |
| pv3-energy-total | Number:Energy | Total solar DC energy collected by string #3. | yes |
| power-factor | Number:Percent | Electrical power factor | yes |
| eps-voltage-r | Number:ElectricPotential | Emergency Power Supply voltage (phase #R). | yes |
| eps-voltage-s | Number:ElectricPotential | Emergency Power Supply voltage (phase #S). | yes |
| eps-voltage-t | Number:ElectricPotential | Emergency Power Supply voltage (phase #T). | yes |
| eps-current-r | Number:ElectricCurrent | Emergency Power Supply current (phase #R). | yes |
| eps-current-s | Number:ElectricCurrent | Emergency Power Supply current (phase #S). | yes |
| eps-current-t | Number:ElectricCurrent | Emergency Power Supply current (phase #T). | yes |
| eps-power | Number:Power | Total Emergency Power Supply power. | yes |
| eps-power-r | Number:Power | Emergency Power Supply power (phase #R). | yes |
| eps-power-s | Number:Power | Emergency Power Supply power (phase #S). | yes |
| eps-power-t | Number:Power | Emergency Power Supply power (phase #T). | yes |
## Rule Actions

View File

@ -14,6 +14,9 @@ package org.openhab.binding.growatt.internal;
import java.util.AbstractMap;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import javax.measure.Unit;
@ -206,11 +209,158 @@ public class GrowattChannels {
// inverter
new AbstractMap.SimpleEntry<String, UoM>("inverter-current", new UoM(Units.AMPERE, 10)),
new AbstractMap.SimpleEntry<String, UoM>("inverter-fan-speed", new UoM(Units.PERCENT, 1))
new AbstractMap.SimpleEntry<String, UoM>("inverter-fan-speed", new UoM(Units.PERCENT, 1)),
/*
* ============== CHANNELS ADDED IN PR #17810 ==============
*/
// DC electric data for strings #3 and #4
new AbstractMap.SimpleEntry<String, UoM>("pv3-voltage", new UoM(Units.VOLT, 10)),
new AbstractMap.SimpleEntry<String, UoM>("pv3-current", new UoM(Units.AMPERE, 10)),
new AbstractMap.SimpleEntry<String, UoM>("pv3-power", new UoM(Units.WATT, 10)),
new AbstractMap.SimpleEntry<String, UoM>("pv4-voltage", new UoM(Units.VOLT, 10)),
new AbstractMap.SimpleEntry<String, UoM>("pv4-current", new UoM(Units.AMPERE, 10)),
new AbstractMap.SimpleEntry<String, UoM>("pv4-power", new UoM(Units.WATT, 10)),
// solar DC pv energy
new AbstractMap.SimpleEntry<String, UoM>("pv3-energy-today", new UoM(Units.KILOWATT_HOUR, 10)),
new AbstractMap.SimpleEntry<String, UoM>("pv3-energy-total", new UoM(Units.KILOWATT_HOUR, 10)),
// power factor
new AbstractMap.SimpleEntry<String, UoM>("power-factor", new UoM(Units.PERCENT, 10)),
// emergency power supply (eps)
new AbstractMap.SimpleEntry<String, UoM>("eps-voltage-r", new UoM(Units.VOLT, 10)),
new AbstractMap.SimpleEntry<String, UoM>("eps-voltage-s", new UoM(Units.VOLT, 10)),
new AbstractMap.SimpleEntry<String, UoM>("eps-voltage-t", new UoM(Units.VOLT, 10)),
new AbstractMap.SimpleEntry<String, UoM>("eps-current-r", new UoM(Units.AMPERE, 10)),
new AbstractMap.SimpleEntry<String, UoM>("eps-current-s", new UoM(Units.AMPERE, 10)),
new AbstractMap.SimpleEntry<String, UoM>("eps-current-t", new UoM(Units.AMPERE, 10)),
new AbstractMap.SimpleEntry<String, UoM>("eps-power", new UoM(Units.WATT, 10)),
new AbstractMap.SimpleEntry<String, UoM>("eps-power-r", new UoM(Units.WATT, 10)),
new AbstractMap.SimpleEntry<String, UoM>("eps-power-s", new UoM(Units.WATT, 10)),
new AbstractMap.SimpleEntry<String, UoM>("eps-power-t", new UoM(Units.WATT, 10))
//
);
public static Map<String, UoM> getMap() {
return GrowattChannels.CHANNEL_ID_UOM_MAP;
}
/**
* Map of Growatt JSON field names that are not used in the creation of device Channels.
*/
@SuppressWarnings("unchecked")
public static final Map<String, Set<String>> UNUSED_FIELDS = Stream.of(new Object[][] {
// @formatter:off
// simple inverter
{ "simple", Set.of(
"datalogserial",
"pvserial") },
// sph inverter
{ "sph", Set.of(
"datalogserial",
"pvserial") },
// spf inverter
{ "spf", Set.of(
"datalogserial",
"pvserial") },
// mid inverter
{ "mid", Set.of(
"datalogserial",
"pvserial",
"deratingmode",
"iso",
"dcir",
"dcis",
"dcit",
"gfci",
"ipf",
"realoppercent",
"opfullwatt",
"standbyflag",
"warningcode",
"invstartdelaytime",
"bdconoffstate",
"drycontactstate",
"priority",
"epsfac",
"dcv",
"bdc1_sysstatemode",
"bdc1_faultcode",
"bdc1_warncode",
"bdc1_vbat",
"bdc1_ibat",
"bdc1_soc",
"bdc1_vbus1",
"bdc1_vbus2",
"bdc1_ibb",
"bdc1_illc",
"bdc1_tempb",
"bdc1_edischrtotal",
"bdc1_echrtotal",
"bdc1_flag",
"bdc2_sysstatemode",
"bdc2_faultcode",
"bdc2_warncode",
"bdc2_vbat",
"bdc2_ibat",
"bdc2_soc",
"bdc2_vbus1",
"bdc2_vbus2",
"bdc2_ibb",
"bdc2_illc",
"bdc2_tempa",
"bdc2_tempb",
"bdc2_pdischr",
"bdc2_pchr",
"bdc2_edischrtotal",
"bdc2_echrtotal",
"bdc2_flag",
"bms_status",
"bms_error",
"bms_warninfo",
"bms_batterycurr",
"bms_batterytemp",
"bms_maxcurr",
"bms_deltavolt",
"bms_cyclecnt",
"bms_soh",
"bms_constantvolt",
"bms_bms_info",
"bms_packinfo",
"bms_usingcap",
"bms_fw",
"bms_mcuversion",
"bms_commtype") },
// smart meter
{ "meter", Set.of(
"datalogserial",
"pvserial",
"pvstatus",
"app_power_l1",
"app_power_l2",
"app_power_l3",
"react_power_l1",
"react_power_l2",
"react_power_l3",
"powerfactor_l1",
"powerfactor_l2",
"powerfactor_l3",
"pos_act_power",
"rev_act_power",
"app_power") },
// @formatter:on
}).collect(Collectors.toMap(objects -> (String) objects[0], objects -> (Set<String>) objects[1]));
}

View File

@ -58,7 +58,7 @@ public class GrottValues {
public @Nullable @SerializedName(value = "pv2watt", alternate = { "ppv2" }) Integer pv2_power;
// AC mains electric data (1-phase resp. 3-phase)
public @Nullable @SerializedName(value = "pvfrequentie", alternate = { "line_freq", "outputfreq" }) Integer grid_frequency;
public @Nullable @SerializedName(value = "pvfrequentie", alternate = { "line_freq", "outputfreq", "frequency" }) Integer grid_frequency;
public @Nullable @SerializedName(value = "pvgridvoltage", alternate = { "grid_volt", "outputvolt", "voltage_l1" }) Integer grid_voltage_r;
public @Nullable @SerializedName(value = "pvgridvoltage2", alternate = { "voltage_l2" }) Integer grid_voltage_s;
public @Nullable @SerializedName(value = "pvgridvoltage3", alternate = { "voltage_l3" }) Integer grid_voltage_t;
@ -110,10 +110,10 @@ public class GrottValues {
// solar DC pv energy
public @Nullable @SerializedName(value = "epvtoday") Integer pv_energy_today;
public @Nullable @SerializedName(value = "epv1today", alternate = { "epv1tod" }) Integer pv1_energy_today;
public @Nullable @SerializedName(value = "epv1today", alternate = { "epv1tod", "epv1today " }) Integer pv1_energy_today; // alternate intentionally has trailing space
public @Nullable @SerializedName(value = "epv2today", alternate = { "epv2tod" }) Integer pv2_energy_today;
public @Nullable @SerializedName(value = "epvtotal") Integer pv_energy_total;
public @Nullable @SerializedName(value = "epvtotal", alternate = { "epvtotal " }) Integer pv_energy_total; // alternate intentionally has trailing space
public @Nullable @SerializedName(value = "epv1total", alternate = { "epv1tot" }) Integer pv1_energy_total;
public @Nullable @SerializedName(value = "epv2total", alternate = { "epv2tot" }) Integer pv2_energy_total;
@ -202,5 +202,39 @@ public class GrottValues {
public @Nullable @SerializedName(value = "Inv_Curr") Integer inverter_current;
public @Nullable @SerializedName(value = "invfanspeed") Integer inverter_fan_speed;
/*
* ============== CHANNELS ADDED IN PR #17810 ==============
*/
// DC electric data for strings #3 and #4
public @Nullable @SerializedName(value = "pv3voltage") Integer pv3_voltage;
public @Nullable @SerializedName(value = "pv3current") Integer pv3_current;
public @Nullable @SerializedName(value = "pv3watt") Integer pv3_power;
public @Nullable @SerializedName(value = "pv4voltage") Integer pv4_voltage;
public @Nullable @SerializedName(value = "pv4current") Integer pv4_current;
public @Nullable @SerializedName(value = "pv4watt") Integer pv4_power;
// solar DC pv energy
public @Nullable @SerializedName(value = "epv3today") Integer pv3_energy_today;
public @Nullable @SerializedName(value = "epv3total") Integer pv3_energy_total;
// power factor
public @Nullable @SerializedName(value = "pf", alternate = { "powerfactor" }) Integer power_factor;
// emergency power supply (eps)
public @Nullable @SerializedName(value = "epsvac1") Integer eps_voltage_r;
public @Nullable @SerializedName(value = "epsvac2") Integer eps_voltage_s;
public @Nullable @SerializedName(value = "epsvac3") Integer eps_voltage_t;
public @Nullable @SerializedName(value = "epsiac1") Integer eps_current_r;
public @Nullable @SerializedName(value = "epsiac2") Integer eps_current_s;
public @Nullable @SerializedName(value = "epsiac3") Integer eps_current_t;
public @Nullable @SerializedName(value = "epspac") Integer eps_power;
public @Nullable @SerializedName(value = "epspac1") Integer eps_power_r;
public @Nullable @SerializedName(value = "epspac2") Integer eps_power_s;
public @Nullable @SerializedName(value = "epspac3") Integer eps_power_t;
// @formatter:on
}

View File

@ -45,6 +45,26 @@ thing-type.growatt.inverter.channel.discharge-power.label = Discharge Power
thing-type.growatt.inverter.channel.discharge-power.description = Discharge power from battery.
thing-type.growatt.inverter.channel.discharge-va.label = Discharge VA
thing-type.growatt.inverter.channel.discharge-va.description = Discharge VA from battery.
thing-type.growatt.inverter.channel.eps-current-r.label = EPS Current #R
thing-type.growatt.inverter.channel.eps-current-r.description = Emergency Power Supply current (phase #R).
thing-type.growatt.inverter.channel.eps-current-s.label = EPS Current #S
thing-type.growatt.inverter.channel.eps-current-s.description = Emergency Power Supply current (phase #S).
thing-type.growatt.inverter.channel.eps-current-t.label = EPS Current #T
thing-type.growatt.inverter.channel.eps-current-t.description = Emergency Power Supply current (phase #T).
thing-type.growatt.inverter.channel.eps-power.label = EPS Power
thing-type.growatt.inverter.channel.eps-power.description = Total Emergency Power Supply power.
thing-type.growatt.inverter.channel.eps-power-r.label = EPS Power #R
thing-type.growatt.inverter.channel.eps-power-r.description = Emergency Power Supply power (phase #R).
thing-type.growatt.inverter.channel.eps-power-s.label = EPS Power #S
thing-type.growatt.inverter.channel.eps-power-s.description = Emergency Power Supply power (phase #S).
thing-type.growatt.inverter.channel.eps-power-t.label = EPS Power #T
thing-type.growatt.inverter.channel.eps-power-t.description = Emergency Power Supply power (phase #T).
thing-type.growatt.inverter.channel.eps-voltage-r.label = EPS Voltage #R
thing-type.growatt.inverter.channel.eps-voltage-r.description = Emergency Power Supply voltage (phase #R).
thing-type.growatt.inverter.channel.eps-voltage-s.label = EPS Voltage #S
thing-type.growatt.inverter.channel.eps-voltage-s.description = Emergency Power Supply voltage (phase #S).
thing-type.growatt.inverter.channel.eps-voltage-t.label = EPS Voltage #T
thing-type.growatt.inverter.channel.eps-voltage-t.description = Emergency Power Supply voltage (phase #T).
thing-type.growatt.inverter.channel.erac-today.label = Reactive Energy Today
thing-type.growatt.inverter.channel.erac-today.description = Reactive energy supplied today.
thing-type.growatt.inverter.channel.erac-total.label = Total Reactive Energy
@ -137,6 +157,8 @@ thing-type.growatt.inverter.channel.n-bus-voltage.label = N Bus Voltage
thing-type.growatt.inverter.channel.n-bus-voltage.description = N Bus voltage.
thing-type.growatt.inverter.channel.p-bus-voltage.label = P Bus Voltage
thing-type.growatt.inverter.channel.p-bus-voltage.description = P Bus voltage.
thing-type.growatt.inverter.channel.power-factor.label = Power Factor
thing-type.growatt.inverter.channel.power-factor.description = Electrical power factor
thing-type.growatt.inverter.channel.pv-boost-temperature.label = Boost Temperature
thing-type.growatt.inverter.channel.pv-boost-temperature.description = Boost temperature.
thing-type.growatt.inverter.channel.pv-energy-today.label = DC Energy Today
@ -171,6 +193,22 @@ thing-type.growatt.inverter.channel.pv2-temperature.label = Solar Panel Temperat
thing-type.growatt.inverter.channel.pv2-temperature.description = Temperature of the solar panels (string #2).
thing-type.growatt.inverter.channel.pv2-voltage.label = String #2 Voltage
thing-type.growatt.inverter.channel.pv2-voltage.description = Voltage from solar panel string #2.
thing-type.growatt.inverter.channel.pv3-current.label = String #3 Current
thing-type.growatt.inverter.channel.pv3-current.description = Current from solar panel string #3.
thing-type.growatt.inverter.channel.pv3-energy-today.label = DC Energy #3 Today
thing-type.growatt.inverter.channel.pv3-energy-today.description = Solar DC energy collected by string #3.
thing-type.growatt.inverter.channel.pv3-energy-total.label = DC Energy #3 Total
thing-type.growatt.inverter.channel.pv3-energy-total.description = Total solar DC energy collected by string #3.
thing-type.growatt.inverter.channel.pv3-power.label = String #3 Power
thing-type.growatt.inverter.channel.pv3-power.description = Power from solar panel string #3.
thing-type.growatt.inverter.channel.pv3-voltage.label = String #3 Voltage
thing-type.growatt.inverter.channel.pv3-voltage.description = Voltage from solar panel string #3.
thing-type.growatt.inverter.channel.pv4-current.label = String #4 Current
thing-type.growatt.inverter.channel.pv4-current.description = Current from solar panel string #4.
thing-type.growatt.inverter.channel.pv4-power.label = String #4 Power
thing-type.growatt.inverter.channel.pv4-power.description = Power from solar panel string #4.
thing-type.growatt.inverter.channel.pv4-voltage.label = String #4 Voltage
thing-type.growatt.inverter.channel.pv4-voltage.description = Voltage from solar panel string #4.
thing-type.growatt.inverter.channel.rac.label = Reactive Power
thing-type.growatt.inverter.channel.rac.description = Reactive power output.
thing-type.growatt.inverter.channel.sp-bus-voltage.label = SP Bus Voltage

View File

@ -480,10 +480,99 @@
<description>Inverter fan speed.</description>
</channel>
<!-- ============== CHANNELS ADDED IN PR #17810 ============== -->
<!-- DC electric data for strings #3 and #4 -->
<channel id="pv3-voltage" typeId="advanced-electric-voltage">
<label>String #3 Voltage</label>
<description>Voltage from solar panel string #3.</description>
</channel>
<channel id="pv3-current" typeId="advanced-electric-current">
<label>String #3 Current</label>
<description>Current from solar panel string #3.</description>
</channel>
<channel id="pv3-power" typeId="advanced-electric-power">
<label>String #3 Power</label>
<description>Power from solar panel string #3.</description>
</channel>
<channel id="pv4-voltage" typeId="advanced-electric-voltage">
<label>String #4 Voltage </label>
<description>Voltage from solar panel string #4.</description>
</channel>
<channel id="pv4-current" typeId="advanced-electric-current">
<label>String #4 Current</label>
<description>Current from solar panel string #4.</description>
</channel>
<channel id="pv4-power" typeId="advanced-electric-power">
<label>String #4 Power</label>
<description>Power from solar panel string #4.</description>
</channel>
<!-- solar DC pv energy -->
<channel id="pv3-energy-today" typeId="advanced-electric-energy">
<label>DC Energy #3 Today</label>
<description>Solar DC energy collected by string #3 today.</description>
</channel>
<channel id="pv3-energy-total" typeId="advanced-electric-energy">
<label>DC Energy #3 Total</label>
<description>Total solar DC energy collected by string #3.</description>
</channel>
<!-- power factor -->
<channel id="power-factor" typeId="advanced-percent">
<label>Power Factor</label>
<description>Electrical power factor</description>
</channel>
<!-- emergency power supply (eps) -->
<channel id="eps-voltage-r" typeId="advanced-electric-voltage">
<label>EPS Voltage #R</label>
<description>Emergency Power Supply voltage (phase #R).</description>
</channel>
<channel id="eps-voltage-s" typeId="advanced-electric-voltage">
<label>EPS Voltage #S</label>
<description>Emergency Power Supply voltage (phase #S).</description>
</channel>
<channel id="eps-voltage-t" typeId="advanced-electric-voltage">
<label>EPS Voltage #T</label>
<description>Emergency Power Supply voltage (phase #T).</description>
</channel>
<channel id="eps-current-r" typeId="advanced-electric-current">
<label>EPS Current #R</label>
<description>Emergency Power Supply current (phase #R).</description>
</channel>
<channel id="eps-current-s" typeId="advanced-electric-current">
<label>EPS Current #S</label>
<description>Emergency Power Supply current (phase #S).</description>
</channel>
<channel id="eps-current-t" typeId="advanced-electric-current">
<label>EPS Current #T</label>
<description>Emergency Power Supply current (phase #T).</description>
</channel>
<channel id="eps-power" typeId="advanced-electric-power">
<label>EPS Power</label>
<description>Total Emergency Power Supply power.</description>
</channel>
<channel id="eps-power-r" typeId="advanced-electric-power">
<label>EPS Power #R</label>
<description>Emergency Power Supply power (phase #R).</description>
</channel>
<channel id="eps-power-s" typeId="advanced-electric-power">
<label>EPS Power #S</label>
<description>Emergency Power Supply power (phase #S).</description>
</channel>
<channel id="eps-power-t" typeId="advanced-electric-power">
<label>EPS Power #T</label>
<description>Emergency Power Supply power (phase #T).</description>
</channel>
</channels>
<properties>
<property name="thingTypeVersion">1</property>
<property name="thingTypeVersion">2</property>
</properties>
<config-description>

View File

@ -49,6 +49,107 @@
<description>Inverter fan speed.</description>
</add-channel>
</instruction-set>
<!-- ============== CHANNELS ADDED IN PR #17810 ============== -->
<instruction-set targetVersion="2">
<!-- DC electric data for strings #3 and #4 -->
<add-channel id="pv3-voltage">
<type>growatt:advanced-electric-voltage</type>
<label>String #3 Voltage</label>
<description>Voltage from solar panel string #3.</description>
</add-channel>
<add-channel id="pv3-current">
<type>growatt:advanced-electric-current</type>
<label>String #3 Current</label>
<description>Current from solar panel string #3.</description>
</add-channel>
<add-channel id="pv3-power">
<type>growatt:advanced-electric-power</type>
<label>String #3 Power</label>
<description>Power from solar panel string #3.</description>
</add-channel>
<add-channel id="pv4-voltage">
<type>growatt:advanced-electric-voltage</type>
<label>String #4 Voltage </label>
<description>Voltage from solar panel string #4.</description>
</add-channel>
<add-channel id="pv4-current">
<type>growatt:advanced-electric-current</type>
<label>String #4 Current</label>
<description>Current from solar panel string #4.</description>
</add-channel>
<add-channel id="pv4-power">
<type>growatt:advanced-electric-power</type>
<label>String #4 Power</label>
<description>Power from solar panel string #4.</description>
</add-channel>
<add-channel id="pv3-energy-today">
<type>growatt:advanced-electric-energy</type>
<label>DC Energy #3 Today</label>
<description>Solar DC energy collected by string #3 today.</description>
</add-channel>
<add-channel id="pv3-energy-total">
<type>growatt:advanced-electric-energy</type>
<label>DC Energy #3 Total</label>
<description>Total solar DC energy collected by string #3.</description>
</add-channel>
<add-channel id="power-factor">
<type>growatt:advanced-percent</type>
<label>Power Factor</label>
<description>Electrical power factor</description>
</add-channel>
<add-channel id="eps-voltage-r">
<type>growatt:advanced-electric-voltage</type>
<label>EPS Voltage #R</label>
<description>Emergency Power Supply voltage (phase #R).</description>
</add-channel>
<add-channel id="eps-voltage-s">
<type>growatt:advanced-electric-voltage</type>
<label>EPS Voltage #S</label>
<description>Emergency Power Supply voltage (phase #S).</description>
</add-channel>
<add-channel id="eps-voltage-t">
<type>growatt:advanced-electric-voltage</type>
<label>EPS Voltage #T</label>
<description>Emergency Power Supply voltage (phase #T).</description>
</add-channel>
<add-channel id="eps-current-r">
<type>growatt:advanced-electric-current</type>
<label>EPS Current #R</label>
<description>Emergency Power Supply current (phase #R).</description>
</add-channel>
<add-channel id="eps-current-s">
<type>growatt:advanced-electric-current</type>
<label>EPS Current #S</label>
<description>Emergency Power Supply current (phase #S).</description>
</add-channel>
<add-channel id="eps-current-t">
<type>growatt:advanced-electric-current</type>
<label>EPS Current #T</label>
<description>Emergency Power Supply current (phase #T).</description>
</add-channel>
<add-channel id="eps-power">
<type>growatt:advanced-electric-power</type>
<label>EPS Power</label>
<description>Total Emergency Power Supply power.</description>
</add-channel>
<add-channel id="eps-power-r">
<type>growatt:advanced-electric-power</type>
<label>EPS Power #R</label>
<description>Emergency Power Supply power (phase #R).</description>
</add-channel>
<add-channel id="eps-power-s">
<type>growatt:advanced-electric-power</type>
<label>EPS Power #S</label>
<description>Emergency Power Supply power (phase #S).</description>
</add-channel>
<add-channel id="eps-power-t">
<type>growatt:advanced-electric-power</type>
<label>EPS Power #T</label>
<description>Emergency Power Supply power (phase #T).</description>
</add-channel>
</instruction-set>
</thing-type>
</update:update-descriptions>

View File

@ -26,6 +26,7 @@ import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Objects;
import java.util.stream.Collectors;
import javax.net.ssl.SSLSession;
@ -240,6 +241,8 @@ public class GrowattTest {
testJsonFieldsMappedToDto("simple");
testJsonFieldsMappedToDto("sph");
testJsonFieldsMappedToDto("spf");
testJsonFieldsMappedToDto("meter");
testJsonFieldsMappedToDto("mid");
}
/**
@ -255,7 +258,8 @@ public class GrowattTest {
String json = load(fileName);
JsonParser.parseString(json).getAsJsonObject().get("values").getAsJsonObject().entrySet().forEach(e -> {
String key = e.getKey();
if (!"datalogserial".equals(key) && !"pvserial".equals(key)) {
assertTrue(GrowattChannels.UNUSED_FIELDS.containsKey(fileName));
if (!Objects.requireNonNull(GrowattChannels.UNUSED_FIELDS.get(fileName)).contains(key)) {
JsonObject testJsonObject = new JsonObject();
testJsonObject.add(key, e.getValue());
GrottValues testDto = gson.fromJson(testJsonObject, GrottValues.class);
@ -362,7 +366,7 @@ public class GrowattTest {
Map<String, QuantityType<?>> channelStates = GrottValuesHelper.getChannelStates(grottValues);
assertNotNull(channelStates);
assertEquals(64, channelStates.size());
assertEquals(85, channelStates.size());
assertEquals(QuantityType.valueOf(-36.5, Units.WATT), channelStates.get("inverter-power"));
assertEquals(QuantityType.valueOf(11, Units.PERCENT), channelStates.get("battery-soc"));
@ -379,7 +383,7 @@ public class GrowattTest {
Map<String, QuantityType<?>> channelStates = GrottValuesHelper.getChannelStates(grottValues);
assertNotNull(channelStates);
assertEquals(16, channelStates.size());
assertEquals(18, channelStates.size());
assertEquals(QuantityType.valueOf(809.8, Units.WATT), channelStates.get("import-power"));
assertEquals(QuantityType.valueOf(171.0, Units.WATT), channelStates.get("import-power-s"));