[omnikinverter] added extra parameters (temperature, AC frequency, AC current, AC voltage and total hours running) (#14244)

* [omnikinverter] Added temperature sensor
* [Omnikinverter] Bugfix for wrong channeltype item-type

Prevents 'Received HTTP PUT request with an invalid item name' when adding items

* [Omnik] Added AC Voltage, Currrent and Frequency and total running hours

Signed-off-by: Dave <leansoft@users.noreply.github.com>
This commit is contained in:
Dave 2023-02-02 12:46:46 +01:00 committed by GitHub
parent a42b92b183
commit baf077d71d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 336 additions and 79 deletions

View File

@ -21,20 +21,31 @@ No autodiscovery available
## Channels
| Channel Type Id | Item Type | Description |
|:---------------|:--------------|:------------------------------------------------------------------------------------------------------------------|
| power | Number:Power | The instantaneous power generation for feed 1 to the grid, in Watt by default (**deprecated**; same as powerAC1) |
| powerAC1 | Number:Power | The instantaneous power generation for feed 1 to the grid, in Watt by default |
| powerAC2 | Number:Power | The instantaneous power generation for feed 2 to the grid, in Watt by default |
| powerAC3 | Number:Power | The instantaneous power generation for feed 3 to the grid, in Watt by default |
| currentPV1 | Number:Current | The current generation for input string 1, in ampere by default |
| currentPV2 | Number:Current | The current generation for input string 2, in ampere by default |
| currentPV3 | Number:Current | The current generation for input string 3, in ampere by default |
| voltagePV1 | Number:Voltage | The voltage on input string 1, in volt by default |
| voltagePV2 | Number:Voltage | The voltage on input string 2, in volt by default |
| voltagePV3 | Number:Voltage | The voltage on input string 3, in volt by default |
| energyToday | Number:Energy | The amount of energy generated today, in kWh by default |
| energyTotal | Number:Energy | The total amount of energy generated, in kWh by default |
| Channel Type Id | Item Type | Description |
|:----------------|:-------------------------|:-----------------------------------------------------------------------------------------------------------------|
| power | Number:Power | The instantaneous power generation for feed 1 to the grid, in Watt by default (**deprecated**; same as powerAC1) |
| powerAC1 | Number:Power | The instantaneous power generation for feed 1 to the grid, in Watt by default |
| powerAC2 | Number:Power | The instantaneous power generation for feed 2 to the grid, in Watt by default |
| powerAC3 | Number:Power | The instantaneous power generation for feed 3 to the grid, in Watt by default |
| voltageAC1 | Number:ElectricPotential | The voltage for feed 1 to the grid, in Volt by default |
| voltageAC2 | Number:ElectricPotential | The voltage for feed 2 to the grid, in Volt by default |
| voltageAC3 | Number:ElectricPotential | The voltage for feed 3 to the grid, in Volt by default |
| currentAC1 | Number:ElectricCurrent | The current for feed 1 to the grid, in ampere by default |
| currentAC2 | Number:ElectricCurrent | The current for feed 2 to the grid, in ampere by default |
| currentAC3 | Number:ElectricCurrent | The current for feed 3 to the grid, in ampere by default |
| frequencyAC1 | Number:Frequency | The frequrence of feed 1 of the grid, in hertz by default |
| frequencyAC2 | Number:Frequency | The frequrence of feed 2 of the grid, in hertz by default |
| frequencyAC3 | Number:Frequency | The frequrence of feed 3 of the grid, in hertz by default |
| currentPV1 | Number:ElectricCurrent | The current generation for input string 1, in ampere by default |
| currentPV2 | Number:ElectricCurrent | The current generation for input string 2, in ampere by default |
| currentPV3 | Number:ElectricCurrent | The current generation for input string 3, in ampere by default |
| voltagePV1 | Number:ElectricPotential | The voltage on input string 1, in volt by default |
| voltagePV2 | Number:ElectricPotential | The voltage on input string 2, in volt by default |
| voltagePV3 | Number:ElectricPotential | The voltage on input string 3, in volt by default |
| energyToday | Number:Energy | The amount of energy generated today, in kWh by default |
| energyTotal | Number:Energy | The total amount of energy generated, in kWh by default |
| temperature | Number:Temperature | The temperature from the sensor |
| hoursTotal | Number:Time | The total amount of running hours |
## Full Example

View File

@ -43,7 +43,23 @@ public class OmnikInverterBindingConstants {
public static final String CHANNEL_POWER_AC2 = "powerAC2";
public static final String CHANNEL_POWER_AC3 = "powerAC3";
public static final String CHANNEL_VOLTAGE_AC1 = "voltageAC1";
public static final String CHANNEL_VOLTAGE_AC2 = "voltageAC2";
public static final String CHANNEL_VOLTAGE_AC3 = "voltageAC3";
public static final String CHANNEL_CURRENT_AC1 = "currentAC1";
public static final String CHANNEL_CURRENT_AC2 = "currentAC2";
public static final String CHANNEL_CURRENT_AC3 = "currentAC3";
public static final String CHANNEL_FREQUENCY_AC1 = "frequencyAC1";
public static final String CHANNEL_FREQUENCY_AC2 = "frequencyAC2";
public static final String CHANNEL_FREQUENCY_AC3 = "frequencyAC3";
public static final String CHANNEL_ENERGY_TODAY = "energyToday";
public static final String CHANNEL_ENERGY_TOTAL = "energyTotal";
public static final String CHANNEL_TEMPERATURE = "temperature";
public static final String CHANNEL_HOURS_TOTAL = "hoursTotal";
}

View File

@ -87,23 +87,23 @@ public class OmnikInverterMessage {
}
/**
* @return the amperage for AC1
* @return the current for AC1
*/
public double getAmperageAC1() {
public double getCurrentAC1() {
return getShort(45, 10);
}
/**
* @return the amperage for AC2
* @return the current for AC2
*/
public double getAmperageAC2() {
public double getCurrentAC2() {
return getShort(47, 10);
}
/**
* @return the amperage for AC3
* @return the current for AC3
*/
public double getAmperageAC3() {
public double getCurrentAC3() {
return getShort(49, 10);
}
@ -141,7 +141,7 @@ public class OmnikInverterMessage {
* @deprecated
*/
public double getPower() {
return getShort(59, 1);
return getPowerAC1();
}
/**
@ -194,4 +194,20 @@ public class OmnikInverterMessage {
public double getTotalEnergy() {
return getInt(71, 10);
}
/**
*
* @return the current temperature in Celsius
*/
public double getTemperature() {
return getShort(31, 10);
}
/**
*
* @return the total amount of hours the inverter produced energy
*/
public double getHoursTotal() {
return getInt(75, 1);
}
}

View File

@ -21,6 +21,7 @@ import java.util.concurrent.TimeUnit;
import javax.measure.quantity.ElectricCurrent;
import javax.measure.quantity.ElectricPotential;
import javax.measure.quantity.Frequency;
import javax.measure.quantity.Power;
import org.eclipse.jdt.annotation.NonNullByDefault;
@ -30,6 +31,7 @@ import org.openhab.binding.omnikinverter.internal.OmnikInverterBindingConstants;
import org.openhab.binding.omnikinverter.internal.OmnikInverterConfiguration;
import org.openhab.binding.omnikinverter.internal.OmnikInverterMessage;
import org.openhab.core.library.types.QuantityType;
import org.openhab.core.library.unit.SIUnits;
import org.openhab.core.library.unit.Units;
import org.openhab.core.thing.ChannelUID;
import org.openhab.core.thing.Thing;
@ -92,6 +94,9 @@ public class OmnikInverterHandler extends BaseThingHandler {
updateStatus(ThingStatus.ONLINE);
/**
* AC
**/
QuantityType<Power> powerQuantity = new QuantityType<>(message.getPower(), Units.WATT);
updateState(OmnikInverterBindingConstants.CHANNEL_POWER, powerQuantity);
@ -104,6 +109,43 @@ public class OmnikInverterHandler extends BaseThingHandler {
QuantityType<Power> powerQuantity3 = new QuantityType<>(message.getPowerAC3(), Units.WATT);
updateState(OmnikInverterBindingConstants.CHANNEL_POWER_AC3, powerQuantity3);
QuantityType<ElectricPotential> voltageQuantity1 = new QuantityType<>(message.getVoltageAC1(),
Units.VOLT);
updateState(OmnikInverterBindingConstants.CHANNEL_VOLTAGE_AC1, voltageQuantity1);
QuantityType<ElectricPotential> voltageQuantity2 = new QuantityType<>(message.getVoltageAC2(),
Units.VOLT);
updateState(OmnikInverterBindingConstants.CHANNEL_VOLTAGE_AC2, voltageQuantity2);
QuantityType<ElectricPotential> voltageQuantity3 = new QuantityType<>(message.getVoltageAC3(),
Units.VOLT);
updateState(OmnikInverterBindingConstants.CHANNEL_VOLTAGE_AC3, voltageQuantity3);
QuantityType<ElectricCurrent> currentQuantity1 = new QuantityType<>(message.getCurrentAC1(),
Units.AMPERE);
updateState(OmnikInverterBindingConstants.CHANNEL_CURRENT_AC1, currentQuantity1);
QuantityType<ElectricCurrent> currentQuantity2 = new QuantityType<>(message.getCurrentAC2(),
Units.AMPERE);
updateState(OmnikInverterBindingConstants.CHANNEL_CURRENT_AC2, currentQuantity2);
QuantityType<ElectricCurrent> currentQuantity3 = new QuantityType<>(message.getCurrentAC3(),
Units.AMPERE);
updateState(OmnikInverterBindingConstants.CHANNEL_CURRENT_AC3, currentQuantity3);
QuantityType<Frequency> frequencyQuantity1 = new QuantityType<>(message.getFrequencyAC1(), Units.HERTZ);
updateState(OmnikInverterBindingConstants.CHANNEL_FREQUENCY_AC1, frequencyQuantity1);
QuantityType<Frequency> frequencyQuantity2 = new QuantityType<>(message.getFrequencyAC2(), Units.HERTZ);
updateState(OmnikInverterBindingConstants.CHANNEL_FREQUENCY_AC2, frequencyQuantity2);
QuantityType<Frequency> frequencyQuantity3 = new QuantityType<>(message.getFrequencyAC3(), Units.HERTZ);
updateState(OmnikInverterBindingConstants.CHANNEL_FREQUENCY_AC3, frequencyQuantity3);
/**
* PV
**/
QuantityType<ElectricCurrent> pvAmp1 = new QuantityType<>(message.getCurrentPV1(), Units.AMPERE);
updateState(OmnikInverterBindingConstants.CHANNEL_CURRENT_PV1, pvAmp1);
@ -122,11 +164,20 @@ public class OmnikInverterHandler extends BaseThingHandler {
QuantityType<ElectricPotential> pvVoltage3 = new QuantityType<>(message.getVoltagePV3(), Units.VOLT);
updateState(OmnikInverterBindingConstants.CHANNEL_VOLTAGE_PV3, pvVoltage3);
/**
* MISC
**/
updateState(OmnikInverterBindingConstants.CHANNEL_ENERGY_TODAY,
new QuantityType<>(message.getEnergyToday(), Units.KILOWATT_HOUR));
updateState(OmnikInverterBindingConstants.CHANNEL_ENERGY_TOTAL,
new QuantityType<>(message.getTotalEnergy(), Units.KILOWATT_HOUR));
updateState(OmnikInverterBindingConstants.CHANNEL_TEMPERATURE,
new QuantityType<>(message.getTemperature(), SIUnits.CELSIUS));
updateState(OmnikInverterBindingConstants.CHANNEL_HOURS_TOTAL,
new QuantityType<>(message.getHoursTotal(), Units.HOUR));
}
} catch (UnknownHostException | NoRouteToHostException | ConnectException e) {
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, e.getMessage());

View File

@ -7,6 +7,42 @@ addon.omnikinverter.description = This is the binding for the Omnik solar grid i
thing-type.omnikinverter.omnik.label = OmnikInverter Binding Thing
thing-type.omnikinverter.omnik.description = Thing for OmnikInverter Binding
thing-type.omnikinverter.omnik.channel.currentAC1.label = Current AC1
thing-type.omnikinverter.omnik.channel.currentAC1.description = The current for output channel 1
thing-type.omnikinverter.omnik.channel.currentAC2.label = Current AC2
thing-type.omnikinverter.omnik.channel.currentAC2.description = The current for output channel 2
thing-type.omnikinverter.omnik.channel.currentAC3.label = Current AC3
thing-type.omnikinverter.omnik.channel.currentAC3.description = The current for output channel 3
thing-type.omnikinverter.omnik.channel.currentPV1.label = Current PV1
thing-type.omnikinverter.omnik.channel.currentPV1.description = The current on input string 1
thing-type.omnikinverter.omnik.channel.currentPV2.label = Current PV2
thing-type.omnikinverter.omnik.channel.currentPV2.description = The current on input string 2
thing-type.omnikinverter.omnik.channel.currentPV3.label = Current PV3
thing-type.omnikinverter.omnik.channel.currentPV3.description = The current on input string 3
thing-type.omnikinverter.omnik.channel.frequencyAC1.label = Frequency AC1
thing-type.omnikinverter.omnik.channel.frequencyAC1.description = The frequency for output channel 1
thing-type.omnikinverter.omnik.channel.frequencyAC2.label = Frequency AC2
thing-type.omnikinverter.omnik.channel.frequencyAC2.description = The frequency for output channel 2
thing-type.omnikinverter.omnik.channel.frequencyAC3.label = Frequency AC3
thing-type.omnikinverter.omnik.channel.frequencyAC3.description = The frequency for output channel 3
thing-type.omnikinverter.omnik.channel.powerAC1.label = Instantaneous Power AC1
thing-type.omnikinverter.omnik.channel.powerAC1.description = The instantaneous power for output channel 1
thing-type.omnikinverter.omnik.channel.powerAC2.label = Instantaneous Power AC2
thing-type.omnikinverter.omnik.channel.powerAC2.description = The instantaneous power for output channel 2
thing-type.omnikinverter.omnik.channel.powerAC3.label = Instantaneous Power AC3
thing-type.omnikinverter.omnik.channel.powerAC3.description = The instantaneous power for output channel 3
thing-type.omnikinverter.omnik.channel.voltageAC1.label = Voltage AC1
thing-type.omnikinverter.omnik.channel.voltageAC1.description = The voltage for output channel 1
thing-type.omnikinverter.omnik.channel.voltageAC2.label = Voltage AC2
thing-type.omnikinverter.omnik.channel.voltageAC2.description = The voltage for output channel 2
thing-type.omnikinverter.omnik.channel.voltageAC3.label = Voltage AC3
thing-type.omnikinverter.omnik.channel.voltageAC3.description = The voltage for output channel 3
thing-type.omnikinverter.omnik.channel.voltagePV1.label = Voltage PV1
thing-type.omnikinverter.omnik.channel.voltagePV1.description = The voltage on the input string 1
thing-type.omnikinverter.omnik.channel.voltagePV2.label = Voltage PV2
thing-type.omnikinverter.omnik.channel.voltagePV2.description = The voltage on the input string 2
thing-type.omnikinverter.omnik.channel.voltagePV3.label = Voltage PV3
thing-type.omnikinverter.omnik.channel.voltagePV3.description = The voltage on the input string 3
# thing types config
@ -19,9 +55,19 @@ thing-type.config.omnikinverter.omnik.serial.description = The serial of the Omn
# channel types
channel-type.omnikinverter.currentAC.label = Current AC
channel-type.omnikinverter.currentPV.label = Current PV
channel-type.omnikinverter.energyToday.label = Energy Today
channel-type.omnikinverter.energyToday.description = The amount of energy generated today
channel-type.omnikinverter.energyTotal.label = Total Generated Energy
channel-type.omnikinverter.energyTotal.description = The amount of generated energy in total
channel-type.omnikinverter.frequencyAC.label = Frequency AC
channel-type.omnikinverter.hoursTotal.label = Running Hours
channel-type.omnikinverter.hoursTotal.description = The total amount of running hours
channel-type.omnikinverter.power.label = Instantaneous Power
channel-type.omnikinverter.power.description = The instantaneous power generation
channel-type.omnikinverter.power.description = Deprecated! See channel 'powerAC1'
channel-type.omnikinverter.powerAC.label = Instantaneous Power AC
channel-type.omnikinverter.temperature.label = Current Temperature
channel-type.omnikinverter.temperature.description = The temperature from the sensor
channel-type.omnikinverter.voltageAC.label = Voltage AC
channel-type.omnikinverter.voltagePV.label = Voltage PV

View File

@ -9,20 +9,85 @@
<description>Thing for OmnikInverter Binding</description>
<channels>
<channel id="power" typeId="power"/>
<channel id="powerAC1" typeId="powerAC1"/>
<channel id="powerAC2" typeId="powerAC2"/>
<channel id="powerAC3" typeId="powerAC3"/>
<channel id="currentPV1" typeId="currentPV1"/>
<channel id="currentPV2" typeId="currentPV2"/>
<channel id="currentPV3" typeId="currentPV3"/>
<channel id="voltagePV1" typeId="voltagePV1"/>
<channel id="voltagePV2" typeId="voltagePV2"/>
<channel id="voltagePV3" typeId="voltagePV3"/>
<channel id="powerAC1" typeId="powerAC">
<label>Instantaneous Power AC1</label>
<description>The instantaneous power for output channel 1</description>
</channel>
<channel id="powerAC2" typeId="powerAC">
<label>Instantaneous Power AC2</label>
<description>The instantaneous power for output channel 2</description>
</channel>
<channel id="powerAC3" typeId="powerAC">
<label>Instantaneous Power AC3</label>
<description>The instantaneous power for output channel 3</description>
</channel>
<channel id="voltageAC1" typeId="voltageAC">
<label>Voltage AC1</label>
<description>The voltage for output channel 1</description>
</channel>
<channel id="voltageAC2" typeId="voltageAC">
<label>Voltage AC2</label>
<description>The voltage for output channel 2</description>
</channel>
<channel id="voltageAC3" typeId="voltageAC">
<label>Voltage AC3</label>
<description>The voltage for output channel 3</description>
</channel>
<channel id="currentAC1" typeId="currentAC">
<label>Current AC1</label>
<description>The current for output channel 1</description>
</channel>
<channel id="currentAC2" typeId="currentAC">
<label>Current AC2</label>
<description>The current for output channel 2</description>
</channel>
<channel id="currentAC3" typeId="currentAC">
<label>Current AC3</label>
<description>The current for output channel 3</description>
</channel>
<channel id="frequencyAC1" typeId="frequencyAC">
<label>Frequency AC1</label>
<description>The frequency for output channel 1</description>
</channel>
<channel id="frequencyAC2" typeId="frequencyAC">
<label>Frequency AC2</label>
<description>The frequency for output channel 2</description>
</channel>
<channel id="frequencyAC3" typeId="frequencyAC">
<label>Frequency AC3</label>
<description>The frequency for output channel 3</description>
</channel>
<channel id="currentPV1" typeId="currentPV">
<label>Current PV1</label>
<description>The current on input string 1</description>
</channel>
<channel id="currentPV2" typeId="currentPV">
<label>Current PV2</label>
<description>The current on input string 2</description>
</channel>
<channel id="currentPV3" typeId="currentPV">
<label>Current PV3</label>
<description>The current on input string 3</description>
</channel>
<channel id="voltagePV1" typeId="voltagePV">
<label>Voltage PV1</label>
<description>The voltage on the input string 1</description>
</channel>
<channel id="voltagePV2" typeId="voltagePV">
<label>Voltage PV2</label>
<description>The voltage on the input string 2</description>
</channel>
<channel id="voltagePV3" typeId="voltagePV">
<label>Voltage PV3</label>
<description>The voltage on the input string 3</description>
</channel>
<channel id="energyToday" typeId="energyToday"/>
<channel id="energyTotal" typeId="energyTotal"/>
<channel id="temperature" typeId="temperature"/>
<channel id="hoursTotal" typeId="hoursTotal"/>
</channels>
<config-description>
<parameter name="hostname" type="text" required="true">
<label>Hostname</label>
@ -39,67 +104,43 @@
<description>The serial of the Omnik inverter's Wifi module. This the number part only.</description>
</parameter>
</config-description>
</thing-type>
<channel-type id="power">
<item-type>Number:Power</item-type>
<label>Instantaneous Power</label>
<description>The instantaneous power generation for output 1</description>
<description>Deprecated! See channel 'powerAC1'</description>
<state readOnly="true" pattern="%.1f %unit%"/>
</channel-type>
<channel-type id="powerAC1">
<channel-type id="powerAC">
<item-type>Number:Power</item-type>
<label>Instantaneous Power AC1</label>
<description>The instantaneous power generation for output 1</description>
<label>Instantaneous Power AC</label>
<state readOnly="true" pattern="%.1f %unit%"/>
</channel-type>
<channel-type id="powerAC2">
<item-type>Number:Power</item-type>
<label>Instantaneous Power AC2</label>
<description>The instantaneous power generation for output 2</description>
<channel-type id="voltageAC">
<item-type>Number:ElectricPotential</item-type>
<label>Voltage AC</label>
<state readOnly="true" pattern="%.1f %unit%"/>
</channel-type>
<channel-type id="powerAC3">
<item-type>Number:Power</item-type>
<label>Instantaneous Power AC3</label>
<description>The instantaneous power generation for output 3</description>
<channel-type id="currentAC">
<item-type>Number:ElectricCurrent</item-type>
<label>Current AC</label>
<state readOnly="true" pattern="%.1f %unit%"/>
</channel-type>
<channel-type id="currentPV1">
<item-type>Number:Current</item-type>
<label>Current PV1</label>
<description>The current on input string 1</description>
<channel-type id="frequencyAC">
<item-type>Number:Frequency</item-type>
<label>Frequency AC</label>
<state readOnly="true" pattern="%.2f %unit%"/>
</channel-type>
<channel-type id="currentPV">
<item-type>Number:ElectricCurrent</item-type>
<label>Current PV</label>
<state readOnly="true" pattern="%.1f %unit%"/>
</channel-type>
<channel-type id="currentPV2">
<item-type>Number:Current</item-type>
<label>Current PV2</label>
<description>The current on input string 2</description>
<state readOnly="true" pattern="%.1f %unit%"/>
</channel-type>
<channel-type id="currentPV3">
<item-type>Number:Current</item-type>
<label>Current PV3</label>
<description>The current on input string 3</description>
<state readOnly="true" pattern="%.1f %unit%"/>
</channel-type>
<channel-type id="voltagePV1">
<item-type>Number:Voltage</item-type>
<label>Voltage PV1</label>
<description>The voltage on input string 1</description>
<state readOnly="true" pattern="%.1f %unit%"/>
</channel-type>
<channel-type id="voltagePV2">
<item-type>Number:Voltage</item-type>
<label>Voltage PV2</label>
<description>The voltage on input string 2</description>
<state readOnly="true" pattern="%.1f %unit%"/>
</channel-type>
<channel-type id="voltagePV3">
<item-type>Number:Voltage</item-type>
<label>The voltage on input string 3</label>
<description>The voltage PV3</description>
<channel-type id="voltagePV">
<item-type>Number:ElectricPotential</item-type>
<label>Voltage PV</label>
<state readOnly="true" pattern="%.1f %unit%"/>
</channel-type>
<channel-type id="energyToday">
@ -112,7 +153,28 @@
<item-type>Number:Energy</item-type>
<label>Total Generated Energy</label>
<description>The amount of generated energy in total</description>
<state readOnly="true" pattern="%.2f %unit%"/>
</channel-type>
<channel-type id="temperature">
<item-type>Number:Temperature</item-type>
<label>Current Temperature</label>
<description>The temperature from the sensor</description>
<category>Temperature</category>
<tags>
<tag>Measurement</tag>
<tag>Temperature</tag>
</tags>
<state readOnly="true" pattern="%.f %unit%"/>
</channel-type>
<channel-type id="hoursTotal">
<item-type>Number:Time</item-type>
<label>Running Hours</label>
<description>The total amount of running hours</description>
<state readOnly="true" pattern="%.f %unit%"/>
</channel-type>
<channel-type id="hoursTotal">
<item-type>Number:Time</item-type>
<label>Running Hours</label>
<description>The total amount of running hours</description>
<state readOnly="true" pattern="%.f %unit%"/>
</channel-type>
</thing:thing-descriptions>

View File

@ -55,6 +55,51 @@ public class OmnikInverterMessageTest {
assertEquals(-1.0, message.getPowerAC3(), 0.01);
}
@Test
public void testGetVoltageAC1() {
assertEquals(236.0, message.getVoltageAC1(), 0.01);
}
@Test
public void testGetVoltageAC2() {
assertEquals(-0.1, message.getVoltageAC2(), 0.01);
}
@Test
public void testGetVoltageAC3() {
assertEquals(-0.1, message.getVoltageAC3(), 0.01);
}
@Test
public void testGetCurrentAC1() {
assertEquals(0.5, message.getCurrentAC1(), 0.01);
}
@Test
public void testGetCurrentAC2() {
assertEquals(-0.1, message.getCurrentAC2(), 0.01);
}
@Test
public void testGetCurrentAC3() {
assertEquals(-0.1, message.getCurrentAC3(), 0.01);
}
@Test
public void testGetFrequencyAC1() {
assertEquals(50.06, message.getFrequencyAC1(), 0.01);
}
@Test
public void testGetFrequencyAC2() {
assertEquals(-0.01, message.getFrequencyAC2(), 0.01);
}
@Test
public void testGetFrequencyAC3() {
assertEquals(-0.01, message.getFrequencyAC3(), 0.01);
}
@Test
public void testGetCurrentPV1() {
assertEquals(0.5, message.getCurrentPV1(), 0.01);
@ -94,4 +139,14 @@ public class OmnikInverterMessageTest {
public void testGetEnergyToday() {
assertEquals(11.13, message.getEnergyToday(), 0.01);
}
@Test
public void testGetTemperature() {
assertEquals(31.7, message.getTemperature(), 0.01);
}
@Test
public void testGetHoursTotal() {
assertEquals(17693, message.getHoursTotal(), 0.01);
}
}