Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 20 commits into from
Feb 2, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
a1ea5f7
[omnikinverter] Added temprature sensor
leansoft Jan 18, 2023
1abbcec
[Omnikinverter] Bugfix for wrong channeltype item-type
leansoft Jan 18, 2023
a67dbea
Update bundles/org.openhab.binding.omnikinverter/src/main/java/org/op…
leansoft Jan 19, 2023
1ac65fb
Update bundles/org.openhab.binding.omnikinverter/README.md
leansoft Jan 19, 2023
f5e4567
Update bundles/org.openhab.binding.omnikinverter/src/main/java/org/op…
leansoft Jan 19, 2023
a7a0249
Update bundles/org.openhab.binding.omnikinverter/src/main/resources/O…
leansoft Jan 19, 2023
9a37972
Update bundles/org.openhab.binding.omnikinverter/src/main/resources/O…
leansoft Jan 19, 2023
4dd77b4
[omnikinverter] README.md alignment fix
leansoft Jan 19, 2023
8b99c49
[omnikinverter] Fixed typo
leansoft Jan 19, 2023
b6b422a
[omnikinverter] Added test coverage for temperature
leansoft Jan 19, 2023
a834fda
[omnikinverter] Added extra data for AC and hours running
leansoft Jan 19, 2023
ebb6178
Update bundles/org.openhab.binding.omnikinverter/src/main/resources/O…
leansoft Jan 19, 2023
f30f30f
Update bundles/org.openhab.binding.omnikinverter/src/main/resources/O…
leansoft Jan 19, 2023
d5d80a0
[omnikinverter] Updated readme for new parameters
leansoft Jan 19, 2023
108ec4c
[omnikinverter] Updated things-types to use System State Channel Types
leansoft Jan 19, 2023
9e08e04
[omnikinverter] Formatting
leansoft Jan 19, 2023
f25b9b2
[omnikinverter] Changes as requested bij PR (#2)
leansoft Jan 24, 2023
5002298
Merge branch 'openhab:main' into main
leansoft Jan 24, 2023
7c92d5b
[Omnikinverter] Fixes for small iteration (#3)
leansoft Feb 2, 2023
625007c
Merge branch 'openhab:main' into main
leansoft Feb 2, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions bundles/org.openhab.binding.omnikinverter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,20 @@ 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 |
| 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 |
| temprature | Number:Temperature | The temprature from the sensor |
leansoft marked this conversation as resolved.
Show resolved Hide resolved
leansoft marked this conversation as resolved.
Show resolved Hide resolved

## Full Example

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,6 @@ public class OmnikInverterBindingConstants {
public static final String CHANNEL_ENERGY_TODAY = "energyToday";

public static final String CHANNEL_ENERGY_TOTAL = "energyTotal";

public static final String CHANNEL_TEMPRATURE = "temprature";
leansoft marked this conversation as resolved.
Show resolved Hide resolved
}
Original file line number Diff line number Diff line change
Expand Up @@ -194,4 +194,12 @@ public double getEnergyToday() {
public double getTotalEnergy() {
return getInt(71, 10);
}

/**
*
* @return the current temprature in Celcius
leansoft marked this conversation as resolved.
Show resolved Hide resolved
*/
public double getTemperature() {
return getShort(31, 10);
}
leansoft marked this conversation as resolved.
Show resolved Hide resolved
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
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;
Expand Down Expand Up @@ -127,6 +128,9 @@ private void updateData() {

updateState(OmnikInverterBindingConstants.CHANNEL_ENERGY_TOTAL,
new QuantityType<>(message.getTotalEnergy(), Units.KILOWATT_HOUR));

updateState(OmnikInverterBindingConstants.CHANNEL_TEMPRATURE,
new QuantityType<>(message.getTemperature(), SIUnits.CELSIUS));
}
} catch (UnknownHostException | NoRouteToHostException | ConnectException e) {
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, e.getMessage());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
<channel id="voltagePV3" typeId="voltagePV3"/>
<channel id="energyToday" typeId="energyToday"/>
<channel id="energyTotal" typeId="energyTotal"/>
<channel id="temprature" typeId="temprature"/>
leansoft marked this conversation as resolved.
Show resolved Hide resolved
</channels>

<config-description>
Expand Down Expand Up @@ -67,37 +68,37 @@
<state readOnly="true" pattern="%.1f %unit%"/>
</channel-type>
<channel-type id="currentPV1">
<item-type>Number:Current</item-type>
<item-type>Number:ElectricCurrent</item-type>
<label>Current PV1</label>
<description>The current on input string 1</description>
<state readOnly="true" pattern="%.1f %unit%"/>
</channel-type>
<channel-type id="currentPV2">
<item-type>Number:Current</item-type>
<item-type>Number:ElectricCurrent</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>
<item-type>Number:ElectricCurrent</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>
<item-type>Number:ElectricPotential</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>
<item-type>Number:ElectricPotential</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>
<item-type>Number:ElectricPotential</item-type>
<label>The voltage on input string 3</label>
<description>The voltage PV3</description>
<state readOnly="true" pattern="%.1f %unit%"/>
Expand All @@ -114,5 +115,10 @@
<description>The amount of generated energy in total</description>
<state readOnly="true" pattern="%.2f %unit%"/>
</channel-type>

<channel-type id="temprature">
leansoft marked this conversation as resolved.
Show resolved Hide resolved
<item-type>Number:Temperature</item-type>
<label>Temperature</label>
<description>Current temperature</description>
leansoft marked this conversation as resolved.
Show resolved Hide resolved
leansoft marked this conversation as resolved.
Show resolved Hide resolved
<state readOnly="true" pattern="%.f %unit%"/>
</channel-type>
</thing:thing-descriptions>