Skip to content

Commit

Permalink
[ferroamp] Binding for ferroamp 20241107
Browse files Browse the repository at this point in the history
Changes done in:
EhubJsonElements.java
EsmJsonElements.java
EsoJsonElements.java
ferroamp.properties
FerroampBindingConstants.java
FerroampChannelConfiguration.java
FerroampConfiguration.java
FerroampHandler.java
FerroampMqttCommunication.java
SsoJsonElements.java
thing-types.xml

Signed-off-by: Örjan Backsell <[email protected]>
  • Loading branch information
basse04 committed Nov 7, 2024
1 parent a68234a commit 2cd2491
Show file tree
Hide file tree
Showing 12 changed files with 606 additions and 670 deletions.
330 changes: 162 additions & 168 deletions bundles/org.openhab.binding.ferroamp/README.md

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import org.eclipse.jdt.annotation.NonNullByDefault;

/**
* The {@link EhubParameters} is responsible for all parameters regarded to EHUB
* The {@link EhubParameters1} is responsible for all parameters regarded to EHUB
*
* @author Örjan Backsell - Initial contribution
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import org.eclipse.jdt.annotation.NonNullByDefault;

/**
* The {@link EhubParameters} is responsible for all parameters regarded to EHUB
* The {@link EhubParameters1} is responsible for all parameters regarded to EHUB
*
* @author Örjan Backsell - Initial contribution
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import org.eclipse.jdt.annotation.NonNullByDefault;

/**
* The {@link EhubParameters} is responsible for all parameters regarded to EHUB
* The {@link EhubParameters1} is responsible for all parameters regarded to EHUB
*
* @author Örjan Backsell - Initial contribution
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,33 +53,33 @@ public class FerroampBindingConstants {
public static final String CHANNEL_ACECURRENTL1 = "ace-current-l1";
public static final String CHANNEL_ACECURRENTL2 = "ace-current-l2";
public static final String CHANNEL_ACECURRENTL3 = "ace-current-l3";
public static final String CHANNEL_EXTERNALVOLTAGEL1 = "external-voltage-l1";
public static final String CHANNEL_EXTERNALVOLTAGEL2 = "external-voltage-l2";
public static final String CHANNEL_EXTERNALVOLTAGEL3 = "external-voltage-l3";
public static final String CHANNEL_GRIDVOLTAGEL1 = "grid-voltage-l1";
public static final String CHANNEL_GRIDVOLTAGEL2 = "grid-voltage-l2";
public static final String CHANNEL_GRIDVOLTAGEL3 = "grid-voltage-l3";
public static final String CHANNEL_INVERTERRMSCURRENTL1 = "inverter-rms-current-l1";
public static final String CHANNEL_INVERTERRMSCURRENTL2 = "inverter-rms-current-l2";
public static final String CHANNEL_INVERTERRMSCURRENTL3 = "inverter-rms-current-l3";
public static final String CHANNEL_INVERTERCURRENTREACTIVEL1 = "inverter-current-reactive-l1";
public static final String CHANNEL_INVERTERCURRENTREACTIVEL2 = "inverter-current-reactive-l2";
public static final String CHANNEL_INVERTERCURRENTREACTIVEL3 = "inverter-current-reactive-l3";
public static final String CHANNEL_INVERTERCURRENTACTIVEL1 = "inverter-current-active-l1";
public static final String CHANNEL_INVERTERCURRENTACTIVEL2 = "inverter-current-active-l2";
public static final String CHANNEL_INVERTERCURRENTACTIVEL3 = "inverter-current-active-l3";
public static final String CHANNEL_GRIDCURRENTL1 = "grid-current-l1";
public static final String CHANNEL_GRIDCURRENTL2 = "grid-current-l2";
public static final String CHANNEL_GRIDCURRENTL3 = "grid-current-l3";
public static final String CHANNEL_GRIDCURRENTREACTIVEL1 = "grid-current-reactive-l1";
public static final String CHANNEL_GRIDCURRENTREACTIVEL2 = "grid-current-reactive-l2";
public static final String CHANNEL_GRIDCURRENTREACTIVEL3 = "grid-current-reactive-l3";
public static final String CHANNEL_GRIDCURRENTACTIVEL1 = "grid-current-active-l1";
public static final String CHANNEL_GRIDCURRENTACTIVEL2 = "grid-current-active-l2";
public static final String CHANNEL_GRIDCURRENTACTIVEL3 = "grid-current-active-l3";
public static final String CHANNEL_INVERTERREACTIVECURRENTL1 = "inverter-reactive-current-l1";
public static final String CHANNEL_INVERTERREACTIVECURRENTL2 = "inverter-reactive-current-l2";
public static final String CHANNEL_INVERTERREACTIVECURRENTL3 = "inverter-reactive-current-l3";
public static final String CHANNEL_INVERTERLOADL1 = "inverter-load-l1";
public static final String CHANNEL_INVERTERLOADL2 = "inverter-load-l2";
public static final String CHANNEL_INVERTERLOADL3 = "inverter-load-l3";
public static final String CHANNEL_INVERTERACTIVECURRENTL1 = "inverter-active-current-l1";
public static final String CHANNEL_INVERTERACTIVECURRENTL2 = "inverter-active-current-l2";
public static final String CHANNEL_INVERTERACTIVECURRENTL3 = "inverter-active-current-l3";
public static final String CHANNEL_GRIDCURRENTL1 = "grid-current-l1";
public static final String CHANNEL_GRIDCURRENTL2 = "grid-current-l2";
public static final String CHANNEL_GRIDCURRENTL3 = "grid-current-l3";
public static final String CHANNEL_GRIDREACTIVECURRENTL1 = "grid-reactive-current-l1";
public static final String CHANNEL_GRIDREACTIVECURRENTL2 = "grid-reactive-current-l2";
public static final String CHANNEL_GRIDREACTIVECURRENTL3 = "grid-reactive-current-l3";
public static final String CHANNEL_GRIDACTIVECURRENTL1 = "grid-active-current-l1";
public static final String CHANNEL_GRIDACTIVECURRENTL2 = "grid-active-current-l2";
public static final String CHANNEL_GRIDACTIVECURRENTL3 = "grid-active-current-l3";
public static final String CHANNEL_INVERTERLOADREACTIVECURRENTL1 = "inverter-load-reactive-current-l1";
public static final String CHANNEL_INVERTERLOADREACTIVECURRENTL2 = "inverter-load-reactive-current-l2";
public static final String CHANNEL_INVERTERLOADREACTIVECURRENTL3 = "inverter-load-reactive-current-l3";
public static final String CHANNEL_INVERTERLOADACTIVECURRENTL1 = "inverter-load-active-current-l1";
public static final String CHANNEL_INVERTERLOADACTIVECURRENTL2 = "inverter-load-active-current-l2";
public static final String CHANNEL_INVERTERLOADACTIVECURRENTL3 = "inverter-load-active-current-l3";
public static final String CHANNEL_APPARENTPOWER = "apparent-power";
public static final String CHANNEL_GRIDPOWERACTIVEL1 = "grid-power-active-l1";
public static final String CHANNEL_GRIDPOWERACTIVEL2 = "grid-power-active-l2";
Expand Down Expand Up @@ -139,15 +139,6 @@ public class FerroampBindingConstants {
public static final String CHANNEL_TOTALCAPACITYBATTERIES = "total-capacity-batteries";

// List of SSO Channel ids
public static final String CHANNEL_S0ID = "s0-id";
public static final String CHANNEL_S0PVVOLTAGE = "s0-pv-voltage";
public static final String CHANNEL_S0PVCURRENT = "s0-pv-current";
public static final String CHANNEL_S0TOTALSOLARENERGY = "s0-total-solar-energy";
public static final String CHANNEL_S0RELAYSTATUS = "s0-relay-status";
public static final String CHANNEL_S0TEMPERATURE = "s0-temperature";
public static final String CHANNEL_S0FAULTCODE = "s0-fault-code";
public static final String CHANNEL_S0DCLINKVOLTAGE = "s0-dc-link-voltage";
public static final String CHANNEL_S0TIMESTAMP = "s0-timestamp";
public static final String CHANNEL_S1ID = "s1-id";
public static final String CHANNEL_S1PVVOLTAGE = "s1-pv-voltage";
public static final String CHANNEL_S1PVCURRENT = "s1-pv-current";
Expand Down Expand Up @@ -175,6 +166,15 @@ public class FerroampBindingConstants {
public static final String CHANNEL_S3FAULTCODE = "s3-fault-code";
public static final String CHANNEL_S3DCLINKVOLTAGE = "s3-dc-link-voltage";
public static final String CHANNEL_S3TIMESTAMP = "s3-timestamp";
public static final String CHANNEL_S4ID = "s4-id";
public static final String CHANNEL_S4PVVOLTAGE = "s4-pv-voltage";
public static final String CHANNEL_S4PVCURRENT = "s4-pv-current";
public static final String CHANNEL_S4TOTALSOLARENERGY = "s4-total-solar-energy";
public static final String CHANNEL_S4RELAYSTATUS = "s4-relay-status";
public static final String CHANNEL_S4TEMPERATURE = "s4-temperature";
public static final String CHANNEL_S4FAULTCODE = "s4-fault-code";
public static final String CHANNEL_S4DCLINKVOLTAGE = "s4-dc-link-voltage";
public static final String CHANNEL_S4TIMESTAMP = "s4-timestamp";

// List of ESO Channel ids
public static final String CHANNEL_ESOID = "eso-id";
Expand Down Expand Up @@ -202,7 +202,6 @@ public class FerroampBindingConstants {
public static final String CHANNEL_REQUESTCHARGE = "request-charge";
public static final String CHANNEL_REQUESTDISCHARGE = "request-discharge";
public static final String CHANNEL_AUTO = "request-auto";
public static final String CHANNEL_REQUESTEXTAPIVERSION = "request-extapi-version";

public static final Set<ThingTypeUID> SUPPORTED_THING_TYPES_UIDS = Set.of(THING_TYPE_ENERGYHUB);
}
Original file line number Diff line number Diff line change
Expand Up @@ -48,59 +48,59 @@ public static List<FerroampChannelConfiguration> getChannelConfigurationEhub() {
channelConfigurationEhub
.add(new FerroampChannelConfiguration(FerroampBindingConstants.CHANNEL_ACECURRENTL3, Units.AMPERE));
channelConfigurationEhub
.add(new FerroampChannelConfiguration(FerroampBindingConstants.CHANNEL_EXTERNALVOLTAGEL1, Units.VOLT));
.add(new FerroampChannelConfiguration(FerroampBindingConstants.CHANNEL_GRIDVOLTAGEL1, Units.VOLT));
channelConfigurationEhub
.add(new FerroampChannelConfiguration(FerroampBindingConstants.CHANNEL_EXTERNALVOLTAGEL2, Units.VOLT));
.add(new FerroampChannelConfiguration(FerroampBindingConstants.CHANNEL_GRIDVOLTAGEL2, Units.VOLT));
channelConfigurationEhub
.add(new FerroampChannelConfiguration(FerroampBindingConstants.CHANNEL_EXTERNALVOLTAGEL3, Units.VOLT));
.add(new FerroampChannelConfiguration(FerroampBindingConstants.CHANNEL_GRIDVOLTAGEL3, Units.VOLT));
channelConfigurationEhub.add(
new FerroampChannelConfiguration(FerroampBindingConstants.CHANNEL_INVERTERRMSCURRENTL1, Units.AMPERE));
channelConfigurationEhub.add(
new FerroampChannelConfiguration(FerroampBindingConstants.CHANNEL_INVERTERRMSCURRENTL2, Units.AMPERE));
channelConfigurationEhub.add(
new FerroampChannelConfiguration(FerroampBindingConstants.CHANNEL_INVERTERRMSCURRENTL3, Units.AMPERE));
channelConfigurationEhub.add(new FerroampChannelConfiguration(
FerroampBindingConstants.CHANNEL_INVERTERCURRENTREACTIVEL1, Units.AMPERE));
FerroampBindingConstants.CHANNEL_INVERTERREACTIVECURRENTL1, Units.AMPERE));
channelConfigurationEhub.add(new FerroampChannelConfiguration(
FerroampBindingConstants.CHANNEL_INVERTERCURRENTREACTIVEL2, Units.AMPERE));
FerroampBindingConstants.CHANNEL_INVERTERREACTIVECURRENTL2, Units.AMPERE));
channelConfigurationEhub.add(new FerroampChannelConfiguration(
FerroampBindingConstants.CHANNEL_INVERTERCURRENTREACTIVEL3, Units.AMPERE));
FerroampBindingConstants.CHANNEL_INVERTERREACTIVECURRENTL3, Units.AMPERE));
channelConfigurationEhub.add(new FerroampChannelConfiguration(
FerroampBindingConstants.CHANNEL_INVERTERCURRENTACTIVEL1, Units.AMPERE));
FerroampBindingConstants.CHANNEL_INVERTERACTIVECURRENTL1, Units.AMPERE));
channelConfigurationEhub.add(new FerroampChannelConfiguration(
FerroampBindingConstants.CHANNEL_INVERTERCURRENTACTIVEL2, Units.AMPERE));
FerroampBindingConstants.CHANNEL_INVERTERACTIVECURRENTL2, Units.AMPERE));
channelConfigurationEhub.add(new FerroampChannelConfiguration(
FerroampBindingConstants.CHANNEL_INVERTERCURRENTACTIVEL3, Units.AMPERE));
FerroampBindingConstants.CHANNEL_INVERTERACTIVECURRENTL3, Units.AMPERE));
channelConfigurationEhub
.add(new FerroampChannelConfiguration(FerroampBindingConstants.CHANNEL_GRIDCURRENTL1, Units.AMPERE));
channelConfigurationEhub
.add(new FerroampChannelConfiguration(FerroampBindingConstants.CHANNEL_GRIDCURRENTL2, Units.AMPERE));
channelConfigurationEhub
.add(new FerroampChannelConfiguration(FerroampBindingConstants.CHANNEL_GRIDCURRENTL3, Units.AMPERE));
channelConfigurationEhub.add(
new FerroampChannelConfiguration(FerroampBindingConstants.CHANNEL_GRIDCURRENTREACTIVEL1, Units.AMPERE));
new FerroampChannelConfiguration(FerroampBindingConstants.CHANNEL_GRIDREACTIVECURRENTL1, Units.AMPERE));
channelConfigurationEhub.add(
new FerroampChannelConfiguration(FerroampBindingConstants.CHANNEL_GRIDCURRENTREACTIVEL2, Units.AMPERE));
new FerroampChannelConfiguration(FerroampBindingConstants.CHANNEL_GRIDREACTIVECURRENTL2, Units.AMPERE));
channelConfigurationEhub.add(
new FerroampChannelConfiguration(FerroampBindingConstants.CHANNEL_GRIDCURRENTREACTIVEL3, Units.AMPERE));
new FerroampChannelConfiguration(FerroampBindingConstants.CHANNEL_GRIDREACTIVECURRENTL3, Units.AMPERE));
channelConfigurationEhub.add(
new FerroampChannelConfiguration(FerroampBindingConstants.CHANNEL_GRIDCURRENTACTIVEL1, Units.AMPERE));
new FerroampChannelConfiguration(FerroampBindingConstants.CHANNEL_GRIDACTIVECURRENTL1, Units.AMPERE));
channelConfigurationEhub.add(
new FerroampChannelConfiguration(FerroampBindingConstants.CHANNEL_GRIDCURRENTACTIVEL2, Units.AMPERE));
new FerroampChannelConfiguration(FerroampBindingConstants.CHANNEL_GRIDACTIVECURRENTL2, Units.AMPERE));
channelConfigurationEhub.add(
new FerroampChannelConfiguration(FerroampBindingConstants.CHANNEL_GRIDCURRENTACTIVEL3, Units.AMPERE));
new FerroampChannelConfiguration(FerroampBindingConstants.CHANNEL_GRIDACTIVECURRENTL3, Units.AMPERE));
channelConfigurationEhub.add(new FerroampChannelConfiguration(
FerroampBindingConstants.CHANNEL_INVERTERREACTIVECURRENTL1, Units.AMPERE));
FerroampBindingConstants.CHANNEL_INVERTERLOADREACTIVECURRENTL1, Units.AMPERE));
channelConfigurationEhub.add(new FerroampChannelConfiguration(
FerroampBindingConstants.CHANNEL_INVERTERREACTIVECURRENTL2, Units.AMPERE));
FerroampBindingConstants.CHANNEL_INVERTERLOADREACTIVECURRENTL2, Units.AMPERE));
channelConfigurationEhub.add(new FerroampChannelConfiguration(
FerroampBindingConstants.CHANNEL_INVERTERREACTIVECURRENTL3, Units.AMPERE));
channelConfigurationEhub
.add(new FerroampChannelConfiguration(FerroampBindingConstants.CHANNEL_INVERTERLOADL1, Units.AMPERE));
channelConfigurationEhub
.add(new FerroampChannelConfiguration(FerroampBindingConstants.CHANNEL_INVERTERLOADL2, Units.AMPERE));
channelConfigurationEhub
.add(new FerroampChannelConfiguration(FerroampBindingConstants.CHANNEL_INVERTERLOADL3, Units.AMPERE));
FerroampBindingConstants.CHANNEL_INVERTERLOADREACTIVECURRENTL3, Units.AMPERE));
channelConfigurationEhub.add(new FerroampChannelConfiguration(
FerroampBindingConstants.CHANNEL_INVERTERLOADACTIVECURRENTL1, Units.AMPERE));
channelConfigurationEhub.add(new FerroampChannelConfiguration(
FerroampBindingConstants.CHANNEL_INVERTERLOADACTIVECURRENTL2, Units.AMPERE));
channelConfigurationEhub.add(new FerroampChannelConfiguration(
FerroampBindingConstants.CHANNEL_INVERTERLOADACTIVECURRENTL3, Units.AMPERE));
channelConfigurationEhub.add(
new FerroampChannelConfiguration(FerroampBindingConstants.CHANNEL_APPARENTPOWER, Units.VOLT_AMPERE));
channelConfigurationEhub.add(
Expand Down Expand Up @@ -214,29 +214,6 @@ public static List<FerroampChannelConfiguration> getChannelConfigurationEhub() {
return channelConfigurationEhub;
}

public static List<FerroampChannelConfiguration> getChannelConfigurationSsoS0() {
final List<FerroampChannelConfiguration> channelConfigurationSsoS0 = new ArrayList<>();
channelConfigurationSsoS0
.add(new FerroampChannelConfiguration(FerroampBindingConstants.CHANNEL_S0ID, Units.ONE));
channelConfigurationSsoS0
.add(new FerroampChannelConfiguration(FerroampBindingConstants.CHANNEL_S0PVVOLTAGE, Units.VOLT));
channelConfigurationSsoS0
.add(new FerroampChannelConfiguration(FerroampBindingConstants.CHANNEL_S0PVCURRENT, Units.AMPERE));
channelConfigurationSsoS0
.add(new FerroampChannelConfiguration(FerroampBindingConstants.CHANNEL_S0TOTALSOLARENERGY, Units.WATT));
channelConfigurationSsoS0
.add(new FerroampChannelConfiguration(FerroampBindingConstants.CHANNEL_S0RELAYSTATUS, Units.ONE));
channelConfigurationSsoS0
.add(new FerroampChannelConfiguration(FerroampBindingConstants.CHANNEL_S0TEMPERATURE, Units.ONE));
channelConfigurationSsoS0
.add(new FerroampChannelConfiguration(FerroampBindingConstants.CHANNEL_S0FAULTCODE, Units.ONE));
channelConfigurationSsoS0
.add(new FerroampChannelConfiguration(FerroampBindingConstants.CHANNEL_S0DCLINKVOLTAGE, Units.VOLT));
channelConfigurationSsoS0
.add(new FerroampChannelConfiguration(FerroampBindingConstants.CHANNEL_S0TIMESTAMP, Units.ONE));
return channelConfigurationSsoS0;
}

public static List<FerroampChannelConfiguration> getChannelConfigurationSsoS1() {
final List<FerroampChannelConfiguration> channelConfigurationSsoS1 = new ArrayList<>();
channelConfigurationSsoS1
Expand Down Expand Up @@ -306,6 +283,29 @@ public static List<FerroampChannelConfiguration> getChannelConfigurationSsoS3()
return channelConfigurationSsoS3;
}

public static List<FerroampChannelConfiguration> getChannelConfigurationSsoS4() {
final List<FerroampChannelConfiguration> channelConfigurationSsoS4 = new ArrayList<>();
channelConfigurationSsoS4
.add(new FerroampChannelConfiguration(FerroampBindingConstants.CHANNEL_S4ID, Units.ONE));
channelConfigurationSsoS4
.add(new FerroampChannelConfiguration(FerroampBindingConstants.CHANNEL_S4PVVOLTAGE, Units.VOLT));
channelConfigurationSsoS4
.add(new FerroampChannelConfiguration(FerroampBindingConstants.CHANNEL_S4PVCURRENT, Units.AMPERE));
channelConfigurationSsoS4
.add(new FerroampChannelConfiguration(FerroampBindingConstants.CHANNEL_S4TOTALSOLARENERGY, Units.WATT));
channelConfigurationSsoS4
.add(new FerroampChannelConfiguration(FerroampBindingConstants.CHANNEL_S4RELAYSTATUS, Units.ONE));
channelConfigurationSsoS4
.add(new FerroampChannelConfiguration(FerroampBindingConstants.CHANNEL_S4TEMPERATURE, Units.ONE));
channelConfigurationSsoS4
.add(new FerroampChannelConfiguration(FerroampBindingConstants.CHANNEL_S4FAULTCODE, Units.ONE));
channelConfigurationSsoS4
.add(new FerroampChannelConfiguration(FerroampBindingConstants.CHANNEL_S4DCLINKVOLTAGE, Units.VOLT));
channelConfigurationSsoS4
.add(new FerroampChannelConfiguration(FerroampBindingConstants.CHANNEL_S4TIMESTAMP, Units.ONE));
return channelConfigurationSsoS4;
}

public static List<FerroampChannelConfiguration> getChannelConfigurationEso() {
final List<FerroampChannelConfiguration> channelConfigurationEso = new ArrayList<>();
channelConfigurationEso
Expand Down Expand Up @@ -360,8 +360,6 @@ public static List<FerroampChannelConfiguration> getChannelConfigurationRequest(
.add(new FerroampChannelConfiguration(FerroampBindingConstants.CHANNEL_REQUESTDISCHARGE, Units.ONE));
channelConfigurationRequest
.add(new FerroampChannelConfiguration(FerroampBindingConstants.CHANNEL_AUTO, Units.ONE));
channelConfigurationRequest.add(
new FerroampChannelConfiguration(FerroampBindingConstants.CHANNEL_REQUESTEXTAPIVERSION, Units.ONE));
return channelConfigurationRequest;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@ public class FerroampConfiguration {
public String userName = "";
public String password = "";
public boolean hasBattery;
public boolean ssoS0;
public boolean ssoS1;
public boolean ssoS2;
public boolean ssoS3;
public boolean eso;
public boolean esm;
}
Loading

0 comments on commit 2cd2491

Please sign in to comment.