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

[ferroamp] Binding for Ferroamp 20241010 #17536

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@
/bundles/org.openhab.binding.feed/ @openhab/add-ons-maintainers
/bundles/org.openhab.binding.feican/ @Hilbrand
/bundles/org.openhab.binding.fenecon/ @nixoso
/bundles/org.openhab.binding.ferroamp/ @basse04
/bundles/org.openhab.binding.fineoffsetweatherstation/ @Andy2003
/bundles/org.openhab.binding.flicbutton/ @pfink
/bundles/org.openhab.binding.fmiweather/ @ssalonen
Expand Down
5 changes: 5 additions & 0 deletions bom/openhab-addons/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,11 @@
<artifactId>org.openhab.binding.fenecon</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.binding.ferroamp</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.binding.fineoffsetweatherstation</artifactId>
Expand Down
13 changes: 13 additions & 0 deletions bundles/org.openhab.binding.ferroamp/NOTICE
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
This content is produced and maintained by the openHAB project.

* Project home: https://www.openhab.org

== Declared Project Licenses

This program and the accompanying materials are made available under the terms
of the Eclipse Public License 2.0 which is available at
https://www.eclipse.org/legal/epl-2.0/.

== Source Code

https://github.com/openhab/openhab-addons
241 changes: 241 additions & 0 deletions bundles/org.openhab.binding.ferroamp/README.md

Large diffs are not rendered by default.

26 changes: 26 additions & 0 deletions bundles/org.openhab.binding.ferroamp/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">

<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.addons.reactor.bundles</artifactId>
<version>4.3.0-SNAPSHOT</version>
</parent>

<artifactId>org.openhab.binding.ferroamp</artifactId>

<name>openHAB Add-ons :: Bundles :: Ferroamp Binding</name>

<dependencies>
<dependency>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.binding.mqtt</artifactId>
<version>${project.version}</version>
<scope>provided</scope>
</dependency>
</dependencies>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<features name="org.openhab.binding.ferroamp-${project.version}" xmlns="http://karaf.apache.org/xmlns/features/v1.4.0">
<repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository>

<feature name="openhab-binding-ferroamp" description="ferroamp Binding" version="${project.version}">
<feature>openhab-runtime-base</feature>
<feature>openhab-transport-mqtt</feature>
<bundle dependency="true">mvn:org.openhab.addons.bundles/org.openhab.binding.mqtt/${project.version}</bundle>

<bundle start-level="80">mvn:org.openhab.addons.bundles/org.openhab.binding.mqtt/${project.version}</bundle>
<bundle start-level="81">mvn:org.openhab.addons.bundles/org.openhab.binding.ferroamp/${project.version}</bundle>
</feature>
</features>
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/**
* Copyright (c) 2010-2024 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/

package org.openhab.binding.ferroamp.dto;

/**
* The {@link GetGeneralLx} is responsible for parsing of Lx parts of received MQTT messages.
*
* @author Örjan Backsell - Initial contribution
*
*/

public class GetGeneralLx {
private String L1;
private String L2;
private String L3;

public void setL1(String L1) {
this.L1 = L1;
}

public String getL1() {
return L1;
}

public void setL2(String L2) {
this.L2 = L2;
}

public String getL2() {
return L2;
}

public void setL3(String L3) {
this.L3 = L3;
}

public String getL3() {
return L3;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/**
* Copyright (c) 2010-2024 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/

package org.openhab.binding.ferroamp.dto;

/**
* The {@link GetGeneralValLx} is responsible for parsing of value parts of received MQTT messages.
*
* @author Örjan Backsell - Initial contribution
*
*/

public class GetGeneralValues {
private String name;
private String val;

public void setName(String name) {
this.name = name;
}

public void setVal(String val) {
this.val = val;
}

public String getName() {
return name;
}

public String getVal() {
return val;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/**
* Copyright (c) 2010-2024 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/

package org.openhab.binding.ferroamp.dto;

/**
* The {@link GetUdc} is responsible for parsing of Udc part of received MQTT messages.
*
* @author Örjan Backsell - Initial contribution
*
*/

public class GetUdc {
private String pos;
private String neg;

public void setPos(String pos) {
this.pos = pos;
}

public String getPos() {
return pos;
}

public void setNeg(String neg) {
this.neg = neg;
}

public String getNeg() {
return neg;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
/**
* Copyright (c) 2010-2024 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.binding.ferroamp.internal;

import java.util.ArrayList;
import java.util.List;

import org.eclipse.jdt.annotation.NonNullByDefault;

/**
* The {@link EhubParameters} is responsible for all parameters regarded to EHUB
*
* @author Örjan Backsell - Initial contribution
*
*/

@NonNullByDefault
public class EhubJsonElements {
public String ehubJsonElements;

public EhubJsonElements(String ehubJsonElements) {
this.ehubJsonElements = ehubJsonElements;
}

public static List<String> getJsonElementsEhub() {
final List<String> jsonElementsEhub = new ArrayList<>();
jsonElementsEhub.add(new String("gridfreq"));
jsonElementsEhub.add(new String("iace"));
jsonElementsEhub.add(new String("ul"));
jsonElementsEhub.add(new String("il"));
jsonElementsEhub.add(new String("ild"));
jsonElementsEhub.add(new String("ilq"));
jsonElementsEhub.add(new String("iext"));
jsonElementsEhub.add(new String("iextd"));
jsonElementsEhub.add(new String("iextq"));
jsonElementsEhub.add(new String("iloadd"));
jsonElementsEhub.add(new String("iloadq"));
jsonElementsEhub.add(new String("sext"));
jsonElementsEhub.add(new String("pext"));
jsonElementsEhub.add(new String("pextreactive"));
jsonElementsEhub.add(new String("pinv"));
jsonElementsEhub.add(new String("pinvreactive"));
jsonElementsEhub.add(new String("pload"));
jsonElementsEhub.add(new String("ploadreactive"));
jsonElementsEhub.add(new String("ppv"));
jsonElementsEhub.add(new String("udc"));
jsonElementsEhub.add(new String("wextprodq"));
jsonElementsEhub.add(new String("wextconsq"));
jsonElementsEhub.add(new String("winvprodq"));
jsonElementsEhub.add(new String("winvconsq"));
jsonElementsEhub.add(new String("wloadprodq"));
jsonElementsEhub.add(new String("wloadconsq"));
jsonElementsEhub.add(new String("wextprodq_3p"));
jsonElementsEhub.add(new String("wextconsq_3p"));
jsonElementsEhub.add(new String("winvprodq_3p"));
jsonElementsEhub.add(new String("winvconsq_3p"));
jsonElementsEhub.add(new String("wloadprodq_3p"));
jsonElementsEhub.add(new String("wloadconsq_3p"));
jsonElementsEhub.add(new String("wpv"));
jsonElementsEhub.add(new String("state"));
jsonElementsEhub.add(new String("ts"));
jsonElementsEhub.add(new String("wbatprod"));
jsonElementsEhub.add(new String("wpbatcons"));
jsonElementsEhub.add(new String("soc"));
jsonElementsEhub.add(new String("soh"));
jsonElementsEhub.add(new String("pbat"));
jsonElementsEhub.add(new String("ratedcap"));
return jsonElementsEhub;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
/**
* Copyright (c) 2010-2024 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.binding.ferroamp.internal;

import java.util.Arrays;
import java.util.List;

import org.eclipse.jdt.annotation.NonNullByDefault;

/**
* The {@link EhubParameters} is responsible for all parameters regarded to EHUB
*
* @author Örjan Backsell - Initial contribution
*
*/

@NonNullByDefault
public class EhubParameters {
public String jsonPostEhub;

public EhubParameters(String jsonPostEhub) {
this.jsonPostEhub = jsonPostEhub;
}

public static List<String> getChannelParametersEhub() {
final List<String> channelParametersEhub = Arrays.asList("grid-frequency", "ace-current-l1", "ace-current-l2",
"ace-current-l3", "external-voltage-l1", "external-voltage-l2", "external-voltage-l3",
"inverter-rms-current-l1", "inverter-rms-current-l2", "inverter-rms-current-l3",
"inverter-current-reactive-l1", "inverter-current-reactive-l2", "inverter-current-reactive-l3",
"inverter-current-active-l1", "inverter-current-active-l2", "inverter-current-active-l3",
"grid-current-l1", "grid-current-l2", "grid-current-l3", "grid-current-reactive-l1",
"grid-current-reactive-l2", "grid-current-reactive-l3", "grid-current-active-l1",
"grid-current-active-l2", "grid-current-active-l3", "inverter-load-l1", "inverter-load-l2",
"inverter-load-l3", "apparent-power", "grid-power-active-l1", "grid-power-active-l2",
"grid-power-active-l3", "grid-power-reactive-l1", "grid-power-reactive-l2", "grid-power-reactive-l3",
"inverter-power-active-l1", "inverter-power-active-l2", "inverter-power-active-l3",
"inverter-power-reactive-l1", "inverter-power-reactive-l2", "inverter-power-reactive-l3",
"consumption-power-l1", "consumption-power-l2", "consumption-power-l3", "consumption-power-reactive-l1",
"consumption-power-reactive-l2", "consumption-power-reactive-l3", "solar-pv",
"positive-dc-link-voltage", "negative-dc-link-voltage", "grid-energy-produced-l1",
"grid-energy-produced-l2", "grid-energy-produced-l3", "grid-energy-consumed-l1",
"grid-energy-consumed-l2", "grid-energy-consumed-l3", "inverter-energy-produced-l1",
"inverter-energy-produced-l2", "inverter-energy-produced-l3", "inverter-energy-consumed-l1",
"inverter-energy-consumed-l2", "inverter-energy-consumed-l3", "load-energy-produced-l1",
"load-energy-produced-l2", "load-energy-produced-l3", "load-energy-consumed-l1",
"load-energy-consumed-l2", "load-energy-consumed-l3", "grid-energy-produced-total",
"grid-energy-consumed-total", "inverter-energy-produced-total", "inverter-energy-consumed-total",
"load-energy-produced-3p", "load-energy-consumed-3p", "total-solar-energy", "state", "timestamp",
"battery-energy-produced", "battery-energy-consumed", "soc", "soh", "power-battery",
"total-capacity-batteries");
return channelParametersEhub;
}
}
Loading