diff --git a/CODEOWNERS b/CODEOWNERS
index 0a4f724322f04..ecbb283567a33 100755
--- a/CODEOWNERS
+++ b/CODEOWNERS
@@ -113,6 +113,7 @@
/bundles/org.openhab.binding.exec/ @kgoderis
/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.fineoffsetweatherstation/ @Andy2003
/bundles/org.openhab.binding.flicbutton/ @pfink
/bundles/org.openhab.binding.fmiweather/ @ssalonen
diff --git a/bom/openhab-addons/pom.xml b/bom/openhab-addons/pom.xml
index e95b1542ac8f5..39a9ad7801ce3 100644
--- a/bom/openhab-addons/pom.xml
+++ b/bom/openhab-addons/pom.xml
@@ -556,6 +556,11 @@
org.openhab.binding.feican
${project.version}
+
+ org.openhab.addons.bundles
+ org.openhab.binding.fenecon
+ ${project.version}
+
org.openhab.addons.bundles
org.openhab.binding.fineoffsetweatherstation
diff --git a/bundles/org.openhab.binding.fenecon/NOTICE b/bundles/org.openhab.binding.fenecon/NOTICE
new file mode 100644
index 0000000000000..38d625e349232
--- /dev/null
+++ b/bundles/org.openhab.binding.fenecon/NOTICE
@@ -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
diff --git a/bundles/org.openhab.binding.fenecon/README.md b/bundles/org.openhab.binding.fenecon/README.md
new file mode 100644
index 0000000000000..a2369af576917
--- /dev/null
+++ b/bundles/org.openhab.binding.fenecon/README.md
@@ -0,0 +1,160 @@
+# FENECON Binding
+
+The FENECON Binding integrates the [FENECON energy storage system](https://fenecon.de/) device into the openHAB system via [REST-API](https://docs.fenecon.de/_/de/fems/fems-app/OEM_App_REST_JSON.html).
+
+With the binding, it is possible to request status information from FENECON Home to allow you home automation decisions based on the current energy management.
+
+This makes it possible, for example, to switch on other consumers such as the dishwasher or washing machine in the case of power overproduction.
+
+## Supported Things
+
+Currently only one Thing is supported: The `home-device` connection to the FENECON energy storage system.
+
+This Binding was tested with an [FENECON HOME 10](https://fenecon.de/fenecon-home-10/) device.
+
+## Discovery
+
+Auto-discovery is not supported.
+
+## Thing Configuration
+
+The FENECON Thing only needs to be configured with the `hostname`, all other parameters are optional and prefilled with the suitable default values:
+
+| Parameter | Description |
+|-----------------|----------------------------------------------------------------------------------|
+| hostname | Hostname or IP address of the FENECON device, e.g. 192.168.1.11 |
+| password | Password of the FENECON device. The password for guest access is set by default. |
+| port | Port of the FENECON device. Default: 8084 |
+| refreshInterval | Interval the device is polled in sec. Default 30 seconds |
+
+## Channels
+
+The FENECON binding currently only provides access to read out the values from the energy storage system.
+
+| Channel | Type | Read/Write | Description |
+|-------------------------------|----------------------|------------|-----------------------------------------------------------------------------|
+| state | String | R | FENECON system state: Ok, Info, Warning or Fault |
+| last-update | DateTime | R | Last successful update via REST-API from the FENECON system |
+| ess-soc | Number:Dimensionless | R | Battery state of charge in percent |
+| charger-power | Number:Power | R | Current charger power of energy storage system in watt. |
+| discharger-power | Number:Power | R | Current discharger power of energy storage system in watt. |
+| emergency-power-mode | Switch | R | Indicates if there is grid power is off and the emergency power mode is on. |
+| production-active-power | Number:Power | R | Current active power producer load in watt. |
+| production-max-active-power | Number:Power | R | Maximum active production power in watt that was measured. |
+| export-to-grid-power | Number:Power | R | Current export power to grid in watt. |
+| exported-to-grid-energy | Number:Energy | R | Total energy exported to the grid in watt per hour. |
+| consumption-active-power | Number:Power | R | Current active power consumer load in watt. |
+| consumption-max-active-power | Number:Power | R | Maximum active consumption power in watt that was measured. |
+| consumption-active-power-l1 | Number:Power | R | Current active power consumer load in watt on phase 1. |
+| consumption-active-power-l2 | Number:Power | R | Current active power consumer load in watt on phase 2. |
+| consumption-active-power-l3 | Number:Power | R | Current active power consumer load in watt on phase 3. |
+| import-from-grid-power | Number:Power | R | Current import power from grid in watt. |
+| imported-from-grid-energy | Number:Energy | R | Total energy imported from the grid in watt per hour. |
+
+## Full Example
+
+### fenecon.things
+
+```java
+Thing fenecon:home-device:local "FENECON Home" [hostname="192.168.1.11", refreshInterval=5]
+```
+
+### demo.items
+
+```java
+// Sitemap Items
+Group Home "MyHome" ["Indoor"]
+Group GF "GroundFloor" (Home) ["GroundFloor"]
+// Utility room
+Group GF_UtilityRoom "Utility room" (Home, GF) ["Room"]
+Group GF_UtilityRoomSolar "Utility room solar" (GF_UtilityRoom) ["Inverter"]
+
+// FENECON items
+String EssState (GF_UtilityRoomSolar) ["Status"] {channel="fenecon:home-device:local:state"}
+DateTime LastFeneconUpdate (GF_UtilityRoomSolar) ["Status"] {channel="fenecon:home-device:local:last-update"}
+Number:Dimensionless EssSoc (GF_UtilityRoomSolar) ["Measurement"] {unit="%", channel="fenecon:home-device:local:ess-soc"}
+Number:Power ChargerPower (GF_UtilityRoomSolar) ["Measurement", "Power"] {channel="fenecon:home-device:local:charger-power"}
+Number:Power DischargerPower (GF_UtilityRoomSolar) ["Measurement", "Power"] {channel="fenecon:home-device:local:discharger-power"}
+Switch EmergencyPowerMode (GF_UtilityRoomSolar) ["Switch"] {channel="fenecon:home-device:local:emergency-power-mode"}
+
+Number:Power ProductionActivePower (GF_UtilityRoomSolar) ["Measurement", "Power"] {channel="fenecon:home-device:local:production-active-power"}
+Number:Power ProductionMaxActivePower (GF_UtilityRoomSolar) ["Measurement", "Power"] {channel="fenecon:home-device:local:production-max-active-power"}
+Number:Power SellToGridPower (GF_UtilityRoomSolar) ["Measurement", "Power"] {channel="fenecon:home-device:local:export-to-grid-power"}
+Number:Energy TotalSellEnergy (GF_UtilityRoomSolar) ["Measurement", "Energy"] {channel="fenecon:home-device:local:exported-to-grid-energy"}
+
+Number:Power ConsumptionActivePower (GF_UtilityRoomSolar) ["Measurement", "Power"] {channel="fenecon:home-device:local:consumption-active-power"}
+Number:Power ConsumptionMaxActivePower (GF_UtilityRoomSolar) ["Measurement", "Power"] {channel="fenecon:home-device:local:consumption-max-active-power"}
+Number:Power ConsumptionActivePowerPhase1 (GF_UtilityRoomSolar) ["Measurement", "Power"] {channel="fenecon:home-device:local:consumption-active-power-l1"}
+Number:Power ConsumptionActivePowerPhase2 (GF_UtilityRoomSolar) ["Measurement", "Power"] {channel="fenecon:home-device:local:consumption-active-power-l2"}
+Number:Power ConsumptionActivePowerPhase3 (GF_UtilityRoomSolar) ["Measurement", "Power"] {channel="fenecon:home-device:local:consumption-active-power-l3"}
+Number:Power BuyFromGridPower (GF_UtilityRoomSolar) ["Measurement", "Power"] {channel="fenecon:home-device:local:import-from-grid-power"}
+Number:Energy TotalBuyEnergy (GF_UtilityRoomSolar) ["Measurement", "Energy"] {channel="fenecon:home-device:local:imported-from-grid-energy"}
+
+// Examples of items for calculating the energy purchased and sold. Look at the demo.rules section.
+Number:Currency SoldEnergy "Total sold energy [%.2f €]" (GF_UtilityRoomSolar)
+Number:Currency PurchasedEnergy "Total purchased energy [%.2f €]" (GF_UtilityRoomSolar)
+
+```
+
+### demo.sitemap
+
+```perl
+sitemap demo label="FENECON Example Sitemap" {
+ Frame label="Groundfloor" icon="groundfloor" {
+ Group item=GF_UtilityRoom
+ }
+}
+```
+
+### demo.rules
+
+:::: tabs
+
+::: tab DSL
+
+```java
+rule "Blackout detection"
+when
+ Item EmergencyPowerMode changed to ON
+then
+ val msg = "🚨 Power blackout detected, emergency power mode running."
+ logInfo("PowerBlackout", msg)
+ sendBroadcastNotification(msg)
+end
+
+rule "Battery 100 percent"
+when
+ Item EssSoc changed
+then
+ var batteryState = (EssSoc.getState() as Number).intValue()
+ if(batteryState == 100){
+ val msg = "🔋 Full battery, consumers can be activated."
+ logInfo("FullBattery", msg)
+ sendBroadcastNotification(msg)
+ }
+end
+
+rule "Calculation sold energy"
+when
+ Item TotalSellEnergy changed
+then
+ val sellingPricePerKiloWattHour = 0.07 // €
+ var current = (TotalSellEnergy.getState() as Number).intValue()
+ var result = current * sellingPricePerKiloWattHour;
+ SoldEnergy.postUpdate(result)
+end
+
+rule "Calculation purchased energy"
+when
+ Item TotalBuyEnergy changed
+then
+ val purchasedPricePerKiloWattHour = 0.32 // €
+ var current = (TotalBuyEnergy.getState() as Number).intValue()
+ var result = current * purchasedPricePerKiloWattHour;
+ PurchasedEnergy.postUpdate(result)
+end
+```
+
+:::
+
+::::
diff --git a/bundles/org.openhab.binding.fenecon/pom.xml b/bundles/org.openhab.binding.fenecon/pom.xml
new file mode 100644
index 0000000000000..fd76dac5b0b88
--- /dev/null
+++ b/bundles/org.openhab.binding.fenecon/pom.xml
@@ -0,0 +1,17 @@
+
+
+
+ 4.0.0
+
+
+ org.openhab.addons.bundles
+ org.openhab.addons.reactor.bundles
+ 4.3.0-SNAPSHOT
+
+
+ org.openhab.binding.fenecon
+
+ openHAB Add-ons :: Bundles :: FENECON Binding
+
+
diff --git a/bundles/org.openhab.binding.fenecon/src/main/feature/feature.xml b/bundles/org.openhab.binding.fenecon/src/main/feature/feature.xml
new file mode 100644
index 0000000000000..fc124c77f4110
--- /dev/null
+++ b/bundles/org.openhab.binding.fenecon/src/main/feature/feature.xml
@@ -0,0 +1,9 @@
+
+
+ mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features
+
+
+ openhab-runtime-base
+ mvn:org.openhab.addons.bundles/org.openhab.binding.fenecon/${project.version}
+
+
diff --git a/bundles/org.openhab.binding.fenecon/src/main/java/org/openhab/binding/fenecon/internal/FeneconBindingConstants.java b/bundles/org.openhab.binding.fenecon/src/main/java/org/openhab/binding/fenecon/internal/FeneconBindingConstants.java
new file mode 100644
index 0000000000000..d8218ab8dbead
--- /dev/null
+++ b/bundles/org.openhab.binding.fenecon/src/main/java/org/openhab/binding/fenecon/internal/FeneconBindingConstants.java
@@ -0,0 +1,75 @@
+/**
+ * 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.fenecon.internal;
+
+import java.util.List;
+
+import org.eclipse.jdt.annotation.NonNullByDefault;
+import org.openhab.core.thing.ThingTypeUID;
+
+/**
+ * The {@link FeneconBindingConstants} class defines common constants, which are
+ * used across the whole binding.
+ *
+ * @author Philipp Schneider - Initial contribution
+ */
+@NonNullByDefault
+public class FeneconBindingConstants {
+
+ private static final String BINDING_ID = "fenecon";
+
+ // List of all Thing Type UIDs
+ public static final ThingTypeUID THING_TYPE_HOME_DEVICE = new ThingTypeUID(BINDING_ID, "home-device");
+
+ // List of all FENECON Addresses
+ public static final String STATE_ADDRESS = "_sum/State";
+ public static final String ESS_SOC_ADDRESS = "_sum/EssSoc";
+ public static final String CONSUMPTION_ACTIVE_POWER_ADDRESS = "_sum/ConsumptionActivePower";
+ public static final String CONSUMPTION_ACTIVE_POWER_PHASE1_ADDRESS = "_sum/ConsumptionActivePowerL1";
+ public static final String CONSUMPTION_ACTIVE_POWER_PHASE2_ADDRESS = "_sum/ConsumptionActivePowerL2";
+ public static final String CONSUMPTION_ACTIVE_POWER_PHASE3_ADDRESS = "_sum/ConsumptionActivePowerL3";
+ public static final String CONSUMPTION_MAX_ACTIVE_POWER_ADDRESS = "_sum/ConsumptionMaxActivePower";
+ public static final String PRODUCTION_MAX_ACTIVE_POWER_ADDRESS = "_sum/ProductionMaxActivePower";
+ public static final String PRODUCTION_ACTIVE_POWER_ADDRESS = "_sum/ProductionActivePower";
+ public static final String GRID_ACTIVE_POWER_ADDRESS = "_sum/GridActivePower";
+ public static final String ESS_DISCHARGE_POWER_ADDRESS = "_sum/EssDischargePower";
+ public static final String GRID_MODE_ADDRESS = "_sum/GridMode";
+ public static final String GRID_SELL_ACTIVE_ENERGY_ADDRESS = "_sum/GridSellActiveEnergy";
+ public static final String GRID_BUY_ACTIVE_ENERGY_ADDRESS = "_sum/GridBuyActiveEnergy";
+ // Group of all FENECON Addresses
+ public static final List ADDRESSES = List.of(STATE_ADDRESS, GRID_MODE_ADDRESS,
+ CONSUMPTION_ACTIVE_POWER_ADDRESS, CONSUMPTION_ACTIVE_POWER_PHASE1_ADDRESS,
+ CONSUMPTION_ACTIVE_POWER_PHASE2_ADDRESS, CONSUMPTION_ACTIVE_POWER_PHASE3_ADDRESS,
+ CONSUMPTION_MAX_ACTIVE_POWER_ADDRESS, PRODUCTION_MAX_ACTIVE_POWER_ADDRESS, PRODUCTION_ACTIVE_POWER_ADDRESS,
+ GRID_ACTIVE_POWER_ADDRESS, GRID_BUY_ACTIVE_ENERGY_ADDRESS, GRID_SELL_ACTIVE_ENERGY_ADDRESS, ESS_SOC_ADDRESS,
+ ESS_DISCHARGE_POWER_ADDRESS);
+
+ // List of all Channel IDs
+ public static final String STATE_CHANNEL = "state";
+ public static final String ESS_SOC_CHANNEL = "ess-soc";
+ public static final String CONSUMPTION_ACTIVE_POWER_CHANNEL = "consumption-active-power";
+ public static final String CONSUMPTION_ACTIVE_POWER_PHASE1_CHANNEL = "consumption-active-power-l1";
+ public static final String CONSUMPTION_ACTIVE_POWER_PHASE2_CHANNEL = "consumption-active-power-l2";
+ public static final String CONSUMPTION_ACTIVE_POWER_PHASE3_CHANNEL = "consumption-active-power-l3";
+ public static final String CONSUMPTION_MAX_ACTIVE_POWER_CHANNEL = "consumption-max-active-power";
+ public static final String PRODUCTION_MAX_ACTIVE_POWER_CHANNEL = "production-max-active-power";
+ public static final String PRODUCTION_ACTIVE_POWER_CHANNEL = "production-active-power";
+ public static final String EXPORT_TO_GRID_POWER_CHANNEL = "export-to-grid-power";
+ public static final String IMPORT_FROM_GRID_POWER_CHANNEL = "import-from-grid-power";
+ public static final String ESS_CHARGER_POWER_CHANNEL = "charger-power";
+ public static final String ESS_DISCHARGER_POWER_CHANNEL = "discharger-power";
+ public static final String EMERGENCY_POWER_MODE_CHANNEL = "emergency-power-mode";
+ public static final String EXPORTED_TO_GRID_ENERGY_CHANNEL = "exported-to-grid-energy";
+ public static final String IMPORTED_FROM_GRID_ENERGY_CHANNEL = "imported-from-grid-energy";
+ public static final String LAST_UPDATE_CHANNEL = "last-update";
+}
diff --git a/bundles/org.openhab.binding.fenecon/src/main/java/org/openhab/binding/fenecon/internal/FeneconConfiguration.java b/bundles/org.openhab.binding.fenecon/src/main/java/org/openhab/binding/fenecon/internal/FeneconConfiguration.java
new file mode 100644
index 0000000000000..8a5127f5f9cfe
--- /dev/null
+++ b/bundles/org.openhab.binding.fenecon/src/main/java/org/openhab/binding/fenecon/internal/FeneconConfiguration.java
@@ -0,0 +1,29 @@
+/**
+ * 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.fenecon.internal;
+
+import org.eclipse.jdt.annotation.NonNullByDefault;
+
+/**
+ * The {@link FeneconConfiguration} class contains fields mapping thing configuration parameters.
+ *
+ * @author Philipp Schneider - Initial contribution
+ */
+@NonNullByDefault
+public class FeneconConfiguration {
+
+ public String hostname = "";
+ public String password = "user";
+ public int port = 8084;
+ public int refreshInterval = 30;
+}
diff --git a/bundles/org.openhab.binding.fenecon/src/main/java/org/openhab/binding/fenecon/internal/FeneconHandler.java b/bundles/org.openhab.binding.fenecon/src/main/java/org/openhab/binding/fenecon/internal/FeneconHandler.java
new file mode 100644
index 0000000000000..4598079e633af
--- /dev/null
+++ b/bundles/org.openhab.binding.fenecon/src/main/java/org/openhab/binding/fenecon/internal/FeneconHandler.java
@@ -0,0 +1,189 @@
+/**
+ * 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.fenecon.internal;
+
+import java.util.Optional;
+import java.util.concurrent.ScheduledFuture;
+import java.util.concurrent.TimeUnit;
+
+import org.eclipse.jdt.annotation.NonNullByDefault;
+import org.eclipse.jdt.annotation.Nullable;
+import org.eclipse.jetty.client.HttpClient;
+import org.openhab.binding.fenecon.internal.api.BatteryPower;
+import org.openhab.binding.fenecon.internal.api.FeneconController;
+import org.openhab.binding.fenecon.internal.api.FeneconResponse;
+import org.openhab.binding.fenecon.internal.api.GridPower;
+import org.openhab.binding.fenecon.internal.api.State;
+import org.openhab.binding.fenecon.internal.exception.FeneconException;
+import org.openhab.core.library.types.DateTimeType;
+import org.openhab.core.library.types.OnOffType;
+import org.openhab.core.library.types.QuantityType;
+import org.openhab.core.library.types.StringType;
+import org.openhab.core.library.unit.Units;
+import org.openhab.core.thing.ChannelUID;
+import org.openhab.core.thing.Thing;
+import org.openhab.core.thing.ThingStatus;
+import org.openhab.core.thing.ThingStatusDetail;
+import org.openhab.core.thing.binding.BaseThingHandler;
+import org.openhab.core.types.Command;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * The {@link FeneconHandler} is responsible for handling commands, which are
+ * sent to one of the channels.
+ *
+ * @author Philipp Schneider - Initial contribution
+ */
+@NonNullByDefault
+public class FeneconHandler extends BaseThingHandler {
+
+ private final Logger logger = LoggerFactory.getLogger(FeneconHandler.class);
+
+ private FeneconConfiguration config = new FeneconConfiguration();
+ private @Nullable ScheduledFuture> pollingJob;
+ private @Nullable FeneconController feneconController;
+ private final HttpClient httpClient;
+
+ public FeneconHandler(Thing thing, HttpClient httpClient) {
+ super(thing);
+ this.httpClient = httpClient;
+ }
+
+ @Override
+ public void initialize() {
+ config = getConfigAs(FeneconConfiguration.class);
+
+ updateStatus(ThingStatus.UNKNOWN);
+
+ feneconController = new FeneconController(config, this.httpClient);
+ pollingJob = scheduler.scheduleWithFixedDelay(this::pollingCode, 0, config.refreshInterval, TimeUnit.SECONDS);
+ }
+
+ private void pollingCode() {
+ for (String eachChannel : FeneconBindingConstants.ADDRESSES) {
+ try {
+ @SuppressWarnings("null")
+ Optional response = feneconController.requestChannel(eachChannel);
+
+ if (response.isPresent()) {
+ processDataPoint(response.get());
+ }
+
+ updateStatus(ThingStatus.ONLINE);
+ } catch (FeneconException err) {
+ logger.trace("FENECON - connection problem on FENECON channel {}", eachChannel, err);
+ updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.OFFLINE.COMMUNICATION_ERROR, err.getMessage());
+ return;
+ }
+ }
+
+ // Set last successful update cycle
+ updateState(FeneconBindingConstants.LAST_UPDATE_CHANNEL, new DateTimeType());
+ }
+
+ private void processDataPoint(FeneconResponse response) throws FeneconException {
+ switch (response.address()) {
+ case FeneconBindingConstants.STATE_ADDRESS:
+ // {"address":"_sum/State","type":"INTEGER","accessMode":"RO","text":"0:Ok, 1:Info, 2:Warning,
+ // 3:Fault","unit":"","value":0}
+ State state = State.get(response);
+ updateState(FeneconBindingConstants.STATE_CHANNEL, new StringType(state.state()));
+ break;
+ case FeneconBindingConstants.ESS_SOC_ADDRESS:
+ updateState(FeneconBindingConstants.ESS_SOC_CHANNEL,
+ new QuantityType<>(Integer.valueOf(response.value()), Units.PERCENT));
+ break;
+ case FeneconBindingConstants.CONSUMPTION_ACTIVE_POWER_ADDRESS:
+ updateState(FeneconBindingConstants.CONSUMPTION_ACTIVE_POWER_CHANNEL,
+ new QuantityType<>(Integer.valueOf(response.value()), Units.WATT));
+ break;
+ case FeneconBindingConstants.CONSUMPTION_ACTIVE_POWER_PHASE1_ADDRESS:
+ updateState(FeneconBindingConstants.CONSUMPTION_ACTIVE_POWER_PHASE1_CHANNEL,
+ new QuantityType<>(Integer.valueOf(response.value()), Units.WATT));
+ break;
+ case FeneconBindingConstants.CONSUMPTION_ACTIVE_POWER_PHASE2_ADDRESS:
+ updateState(FeneconBindingConstants.CONSUMPTION_ACTIVE_POWER_PHASE2_CHANNEL,
+ new QuantityType<>(Integer.valueOf(response.value()), Units.WATT));
+ break;
+ case FeneconBindingConstants.CONSUMPTION_ACTIVE_POWER_PHASE3_ADDRESS:
+ updateState(FeneconBindingConstants.CONSUMPTION_ACTIVE_POWER_PHASE3_CHANNEL,
+ new QuantityType<>(Integer.valueOf(response.value()), Units.WATT));
+ break;
+ case FeneconBindingConstants.CONSUMPTION_MAX_ACTIVE_POWER_ADDRESS:
+ updateState(FeneconBindingConstants.CONSUMPTION_MAX_ACTIVE_POWER_CHANNEL,
+ new QuantityType<>(Integer.valueOf(response.value()), Units.WATT));
+ break;
+ case FeneconBindingConstants.PRODUCTION_MAX_ACTIVE_POWER_ADDRESS:
+ updateState(FeneconBindingConstants.PRODUCTION_MAX_ACTIVE_POWER_CHANNEL,
+ new QuantityType<>(Integer.valueOf(response.value()), Units.WATT));
+ break;
+ case FeneconBindingConstants.PRODUCTION_ACTIVE_POWER_ADDRESS:
+ updateState(FeneconBindingConstants.PRODUCTION_ACTIVE_POWER_CHANNEL,
+ new QuantityType<>(Integer.valueOf(response.value()), Units.WATT));
+ break;
+ case FeneconBindingConstants.GRID_ACTIVE_POWER_ADDRESS:
+ // Grid exchange power. Negative values for sell-to-grid; positive for buy-from-grid"
+ GridPower gridPower = GridPower.get(response);
+
+ updateState(FeneconBindingConstants.EXPORT_TO_GRID_POWER_CHANNEL,
+ new QuantityType<>(gridPower.sellTo(), Units.WATT));
+ updateState(FeneconBindingConstants.IMPORT_FROM_GRID_POWER_CHANNEL,
+ new QuantityType<>(gridPower.buyFrom(), Units.WATT));
+ break;
+ case FeneconBindingConstants.ESS_DISCHARGE_POWER_ADDRESS:
+ // Actual AC-side battery discharge power of Energy Storage System.
+ // Negative values for charge; positive for discharge
+ BatteryPower batteryPower = BatteryPower.get(response);
+
+ updateState(FeneconBindingConstants.ESS_CHARGER_POWER_CHANNEL,
+ new QuantityType<>(batteryPower.chargerPower(), Units.WATT));
+ updateState(FeneconBindingConstants.ESS_DISCHARGER_POWER_CHANNEL,
+ new QuantityType<>(batteryPower.dischargerPower(), Units.WATT));
+ break;
+ case FeneconBindingConstants.GRID_MODE_ADDRESS:
+ // text":"1:On-Grid, 2:Off-Grid","unit":"","value":1
+ Integer gridMod = Integer.valueOf(response.value());
+ updateState(FeneconBindingConstants.EMERGENCY_POWER_MODE_CHANNEL,
+ gridMod == 2 ? OnOffType.ON : OnOffType.OFF);
+ break;
+ case FeneconBindingConstants.GRID_SELL_ACTIVE_ENERGY_ADDRESS:
+ // {"address":"_sum/GridSellActiveEnergy","type":"LONG","accessMode":"RO","text":"","unit":"Wh_Σ","value":374242}
+ updateState(FeneconBindingConstants.EXPORTED_TO_GRID_ENERGY_CHANNEL,
+ new QuantityType<>(Integer.valueOf(response.value()), Units.WATT_HOUR));
+ break;
+ case FeneconBindingConstants.GRID_BUY_ACTIVE_ENERGY_ADDRESS:
+ // "address":"_sum/GridBuyActiveEnergy","type":"LONG","accessMode":"RO","text":"","unit":"Wh_Σ","value":1105}
+ updateState(FeneconBindingConstants.IMPORTED_FROM_GRID_ENERGY_CHANNEL,
+ new QuantityType<>(Integer.valueOf(response.value()), Units.WATT_HOUR));
+ break;
+ default:
+ logger.trace("FENECON - No channel ID to address {} found.", response.address());
+ break;
+ }
+ }
+
+ @Override
+ public void dispose() {
+ ScheduledFuture> job = pollingJob;
+ if (job != null) {
+ job.cancel(true);
+ pollingJob = null;
+ }
+ }
+
+ @Override
+ public void handleCommand(ChannelUID channelUID, Command command) {
+ // Noop
+ }
+}
diff --git a/bundles/org.openhab.binding.fenecon/src/main/java/org/openhab/binding/fenecon/internal/FeneconHandlerFactory.java b/bundles/org.openhab.binding.fenecon/src/main/java/org/openhab/binding/fenecon/internal/FeneconHandlerFactory.java
new file mode 100644
index 0000000000000..0ac1eaaf5cb8d
--- /dev/null
+++ b/bundles/org.openhab.binding.fenecon/src/main/java/org/openhab/binding/fenecon/internal/FeneconHandlerFactory.java
@@ -0,0 +1,64 @@
+/**
+ * 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.fenecon.internal;
+
+import static org.openhab.binding.fenecon.internal.FeneconBindingConstants.THING_TYPE_HOME_DEVICE;
+
+import java.util.Set;
+
+import org.eclipse.jdt.annotation.NonNullByDefault;
+import org.eclipse.jdt.annotation.Nullable;
+import org.openhab.core.io.net.http.HttpClientFactory;
+import org.openhab.core.thing.Thing;
+import org.openhab.core.thing.ThingTypeUID;
+import org.openhab.core.thing.binding.BaseThingHandlerFactory;
+import org.openhab.core.thing.binding.ThingHandler;
+import org.openhab.core.thing.binding.ThingHandlerFactory;
+import org.osgi.service.component.annotations.Activate;
+import org.osgi.service.component.annotations.Component;
+import org.osgi.service.component.annotations.Reference;
+
+/**
+ * The {@link FeneconHandlerFactory} is responsible for creating things and thing
+ * handlers.
+ *
+ * @author Philipp Schneider - Initial contribution
+ */
+@NonNullByDefault
+@Component(configurationPid = "binding.fenecon", service = ThingHandlerFactory.class)
+public class FeneconHandlerFactory extends BaseThingHandlerFactory {
+
+ private static final Set SUPPORTED_THING_TYPES_UIDS = Set.of(THING_TYPE_HOME_DEVICE);
+ private final HttpClientFactory httpClientFactory;
+
+ @Activate
+ public FeneconHandlerFactory(@Reference HttpClientFactory httpClientFactory) {
+ this.httpClientFactory = httpClientFactory;
+ }
+
+ @Override
+ public boolean supportsThingType(ThingTypeUID thingTypeUID) {
+ return SUPPORTED_THING_TYPES_UIDS.contains(thingTypeUID);
+ }
+
+ @Override
+ protected @Nullable ThingHandler createHandler(Thing thing) {
+ ThingTypeUID thingTypeUID = thing.getThingTypeUID();
+
+ if (THING_TYPE_HOME_DEVICE.equals(thingTypeUID)) {
+ return new FeneconHandler(thing, httpClientFactory.getCommonHttpClient());
+ }
+
+ return null;
+ }
+}
diff --git a/bundles/org.openhab.binding.fenecon/src/main/java/org/openhab/binding/fenecon/internal/api/BatteryPower.java b/bundles/org.openhab.binding.fenecon/src/main/java/org/openhab/binding/fenecon/internal/api/BatteryPower.java
new file mode 100644
index 0000000000000..01587ef9da628
--- /dev/null
+++ b/bundles/org.openhab.binding.fenecon/src/main/java/org/openhab/binding/fenecon/internal/api/BatteryPower.java
@@ -0,0 +1,39 @@
+/**
+ * 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.fenecon.internal.api;
+
+import org.eclipse.jdt.annotation.NonNullByDefault;
+
+/**
+ * The {@link BatteryPower} is a small helper class to convert the power value from battery.
+ *
+ * @author Philipp Schneider - Initial contribution
+ */
+@NonNullByDefault
+public record BatteryPower(int chargerPower, int dischargerPower) {
+
+ public static BatteryPower get(FeneconResponse response) {
+ // Actual AC-side battery discharge power of Energy Storage System.
+ // Negative values for charge; positive for discharge
+ Integer powerValue = Integer.valueOf(response.value());
+ int chargerPower = 0;
+ int dischargerPower = 0;
+ if (powerValue < 0) {
+ chargerPower = powerValue * -1;
+ } else {
+ dischargerPower = powerValue;
+ }
+
+ return new BatteryPower(chargerPower, dischargerPower);
+ }
+}
diff --git a/bundles/org.openhab.binding.fenecon/src/main/java/org/openhab/binding/fenecon/internal/api/FeneconController.java b/bundles/org.openhab.binding.fenecon/src/main/java/org/openhab/binding/fenecon/internal/api/FeneconController.java
new file mode 100644
index 0000000000000..36fff36bb1f0a
--- /dev/null
+++ b/bundles/org.openhab.binding.fenecon/src/main/java/org/openhab/binding/fenecon/internal/api/FeneconController.java
@@ -0,0 +1,125 @@
+/**
+ * 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.fenecon.internal.api;
+
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.Optional;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.TimeoutException;
+
+import org.eclipse.jdt.annotation.NonNullByDefault;
+import org.eclipse.jetty.client.HttpClient;
+import org.eclipse.jetty.client.api.AuthenticationStore;
+import org.eclipse.jetty.client.api.ContentResponse;
+import org.eclipse.jetty.client.api.Request;
+import org.eclipse.jetty.client.util.BasicAuthentication;
+import org.eclipse.jetty.http.HttpMethod;
+import org.openhab.binding.fenecon.internal.FeneconConfiguration;
+import org.openhab.binding.fenecon.internal.exception.FeneconAuthenticationException;
+import org.openhab.binding.fenecon.internal.exception.FeneconCommunicationException;
+import org.openhab.binding.fenecon.internal.exception.FeneconException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.google.gson.JsonObject;
+import com.google.gson.JsonParser;
+import com.google.gson.JsonSyntaxException;
+
+/**
+ * The {@link FeneconController} class provides API access to the FENECON system.
+ *
+ * @author Philipp Schneider - Initial contribution
+ */
+@NonNullByDefault
+public class FeneconController {
+
+ private final Logger logger = LoggerFactory.getLogger(FeneconController.class);
+
+ private final FeneconConfiguration config;
+ private final HttpClient httpClient;
+
+ public FeneconController(FeneconConfiguration config, HttpClient httpClient) {
+ this.config = config;
+ this.httpClient = httpClient;
+
+ logger.debug("FENECON: initialize REST-API connection to {} with polling interval: {} sec", getBaseUrl(config),
+ config.refreshInterval);
+
+ // Set BasicAuthentication for all requests on the http connection
+ AuthenticationStore auth = httpClient.getAuthenticationStore();
+ URI uri = URI.create(getBaseUrl(config));
+ auth.addAuthenticationResult(new BasicAuthentication.BasicResult(uri, "x", config.password));
+ }
+
+ private String getBaseUrl(FeneconConfiguration config) {
+ return "http://" + config.hostname + ":" + config.port + "/";
+ }
+
+ /**
+ * Queries the data for a specified channel.
+ *
+ * @param channel Channel to be queried, e.g. _sum/State .
+ * @return {@link FeneconResponse} can be optional if values are not available.
+ * @throws FeneconException is thrown if there are problems with the connection or processing of data to the FENECON
+ * system.
+ */
+ public Optional requestChannel(String channel) throws FeneconException {
+ try {
+ URI uri = new URI(getBaseUrl(config) + "rest/channel/" + channel);
+
+ Request request = httpClient.newRequest(uri).timeout(10, TimeUnit.SECONDS).method(HttpMethod.GET);
+ logger.trace("FENECON - request: {}", request);
+
+ ContentResponse response = request.send();
+ logger.trace("FENECON - response status code: {} body: {}", response.getStatus(),
+ response.getContentAsString());
+
+ int statusCode = response.getStatus();
+ if (statusCode > 300) {
+ // Authentication error
+ if (statusCode == 401) {
+ throw new FeneconAuthenticationException(
+ "Authentication on the FENECON system was not possible. Check password.");
+ } else {
+ throw new FeneconCommunicationException("Unexpected http status code: " + statusCode);
+ }
+ } else {
+ return createResponseFromJson(JsonParser.parseString(response.getContentAsString()).getAsJsonObject());
+ }
+ } catch (TimeoutException | ExecutionException | UnsupportedOperationException | InterruptedException err) {
+ throw new FeneconCommunicationException("Communication error with FENECON system on channel: " + channel,
+ err);
+ } catch (URISyntaxException | JsonSyntaxException err) {
+ throw new FeneconCommunicationException("Syntax error on channel: " + channel, err);
+ }
+ }
+
+ private Optional createResponseFromJson(JsonObject response) {
+ // Example response: {"address":"_sum/EssSoc","type":"INTEGER","accessMode":"RO","text":"Range
+ // 0..100","unit":"%","value":99}
+
+ if (response.get("value").isJsonNull()) {
+ // Example problem response: {"address":"_sum/EssSoc","type":"INTEGER","accessMode":"RO","text":"Range
+ // 0..100","unit":"%","value":null}
+ return Optional.empty();
+ }
+
+ String address = response.get("address").getAsString();
+ String text = response.get("text").getAsString();
+ String value = response.get("value").getAsString();
+
+ return Optional.of(new FeneconResponse(address, text, value));
+ }
+}
diff --git a/bundles/org.openhab.binding.fenecon/src/main/java/org/openhab/binding/fenecon/internal/api/FeneconResponse.java b/bundles/org.openhab.binding.fenecon/src/main/java/org/openhab/binding/fenecon/internal/api/FeneconResponse.java
new file mode 100644
index 0000000000000..49b2943e27489
--- /dev/null
+++ b/bundles/org.openhab.binding.fenecon/src/main/java/org/openhab/binding/fenecon/internal/api/FeneconResponse.java
@@ -0,0 +1,24 @@
+/**
+ * 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.fenecon.internal.api;
+
+import org.eclipse.jdt.annotation.NonNullByDefault;
+
+/**
+ * The {@link FeneconResponse} class provides the response from the FENECON system.
+ *
+ * @author Philipp Schneider - Initial contribution
+ */
+@NonNullByDefault
+public record FeneconResponse(String address, String text, String value) {
+};
diff --git a/bundles/org.openhab.binding.fenecon/src/main/java/org/openhab/binding/fenecon/internal/api/GridPower.java b/bundles/org.openhab.binding.fenecon/src/main/java/org/openhab/binding/fenecon/internal/api/GridPower.java
new file mode 100644
index 0000000000000..9ad036522e71a
--- /dev/null
+++ b/bundles/org.openhab.binding.fenecon/src/main/java/org/openhab/binding/fenecon/internal/api/GridPower.java
@@ -0,0 +1,38 @@
+/**
+ * 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.fenecon.internal.api;
+
+import org.eclipse.jdt.annotation.NonNullByDefault;
+
+/**
+ * The {@link GridPower} is a small helper class to convert the grid value.
+ *
+ * @author Philipp Schneider - Initial contribution
+ */
+@NonNullByDefault
+public record GridPower(int sellTo, int buyFrom) {
+
+ public static GridPower get(FeneconResponse response) {
+ // Grid exchange power. Negative values for sell-to-grid; positive for buy-from-grid"
+ Integer gridValue = Integer.valueOf(response.value());
+ int selltoGridPower = 0;
+ int buyFromGridPower = 0;
+ if (gridValue < 0) {
+ selltoGridPower = gridValue * -1;
+ } else {
+ buyFromGridPower = gridValue;
+ }
+
+ return new GridPower(selltoGridPower, buyFromGridPower);
+ }
+}
diff --git a/bundles/org.openhab.binding.fenecon/src/main/java/org/openhab/binding/fenecon/internal/api/State.java b/bundles/org.openhab.binding.fenecon/src/main/java/org/openhab/binding/fenecon/internal/api/State.java
new file mode 100644
index 0000000000000..4de497f819dfc
--- /dev/null
+++ b/bundles/org.openhab.binding.fenecon/src/main/java/org/openhab/binding/fenecon/internal/api/State.java
@@ -0,0 +1,43 @@
+/**
+ * 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.fenecon.internal.api;
+
+import org.eclipse.jdt.annotation.NonNullByDefault;
+
+/**
+ * The {@link State} is a small helper class to convert the state value.
+ *
+ * @author Philipp Schneider - Initial contribution
+ */
+@NonNullByDefault
+public record State(String state) {
+
+ public static State get(FeneconResponse response) {
+ // {"address":"_sum/State","type":"INTEGER","accessMode":"RO","text":"0:Ok, 1:Info, 2:Warning,
+ // 3:Fault","unit":"","value":0}
+ String text = response.text();
+ int begin = text.indexOf(response.value() + ":");
+ int end = text.indexOf(",", begin);
+
+ // No value to text mapping
+ if (begin < 0) {
+ return new State("Unknown");
+ }
+
+ // Last text
+ if (end < 0) {
+ end = text.length();
+ }
+ return new State(text.substring(begin + 2, end));
+ }
+}
diff --git a/bundles/org.openhab.binding.fenecon/src/main/java/org/openhab/binding/fenecon/internal/exception/FeneconAuthenticationException.java b/bundles/org.openhab.binding.fenecon/src/main/java/org/openhab/binding/fenecon/internal/exception/FeneconAuthenticationException.java
new file mode 100644
index 0000000000000..de93031d26026
--- /dev/null
+++ b/bundles/org.openhab.binding.fenecon/src/main/java/org/openhab/binding/fenecon/internal/exception/FeneconAuthenticationException.java
@@ -0,0 +1,30 @@
+/**
+ * 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.fenecon.internal.exception;
+
+import org.eclipse.jdt.annotation.NonNullByDefault;
+
+/**
+ * The class {@link FeneconAuthenticationException} is thrown if a authentication on the FENECON system is not possible.
+ *
+ * @author Philipp Schneider - Initial contribution
+ */
+@NonNullByDefault
+public class FeneconAuthenticationException extends FeneconException {
+
+ private static final long serialVersionUID = -9206453599559316730L;
+
+ public FeneconAuthenticationException(String message) {
+ super(message);
+ }
+}
diff --git a/bundles/org.openhab.binding.fenecon/src/main/java/org/openhab/binding/fenecon/internal/exception/FeneconCommunicationException.java b/bundles/org.openhab.binding.fenecon/src/main/java/org/openhab/binding/fenecon/internal/exception/FeneconCommunicationException.java
new file mode 100644
index 0000000000000..6099170f04cec
--- /dev/null
+++ b/bundles/org.openhab.binding.fenecon/src/main/java/org/openhab/binding/fenecon/internal/exception/FeneconCommunicationException.java
@@ -0,0 +1,34 @@
+/**
+ * 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.fenecon.internal.exception;
+
+import org.eclipse.jdt.annotation.NonNullByDefault;
+
+/**
+ * The class {@link FeneconCommunicationException} is thrown if a communication problem occurs with the FENECON system.
+ *
+ * @author Philipp Schneider - Initial contribution
+ */
+@NonNullByDefault
+public class FeneconCommunicationException extends FeneconException {
+
+ private static final long serialVersionUID = -4334759327203382902L;
+
+ public FeneconCommunicationException(String message) {
+ super(message);
+ }
+
+ public FeneconCommunicationException(String message, Exception exception) {
+ super(message, exception);
+ }
+}
diff --git a/bundles/org.openhab.binding.fenecon/src/main/java/org/openhab/binding/fenecon/internal/exception/FeneconException.java b/bundles/org.openhab.binding.fenecon/src/main/java/org/openhab/binding/fenecon/internal/exception/FeneconException.java
new file mode 100644
index 0000000000000..ffad81841b1a2
--- /dev/null
+++ b/bundles/org.openhab.binding.fenecon/src/main/java/org/openhab/binding/fenecon/internal/exception/FeneconException.java
@@ -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.fenecon.internal.exception;
+
+import org.eclipse.jdt.annotation.NonNullByDefault;
+
+/**
+ * The {@link FeneconException} class provides general exception for this binding.
+ *
+ * @author Philipp Schneider - Initial contribution
+ */
+@NonNullByDefault
+public class FeneconException extends Exception {
+
+ private static final long serialVersionUID = 4454633961827361165L;
+
+ public FeneconException() {
+ // noop
+ }
+
+ public FeneconException(String message) {
+ super(message);
+ }
+
+ public FeneconException(Exception exception) {
+ super(exception);
+ }
+
+ public FeneconException(String message, Exception exception) {
+ super(message, exception);
+ }
+}
diff --git a/bundles/org.openhab.binding.fenecon/src/main/resources/OH-INF/addon/addon.xml b/bundles/org.openhab.binding.fenecon/src/main/resources/OH-INF/addon/addon.xml
new file mode 100644
index 0000000000000..0602d75e0a904
--- /dev/null
+++ b/bundles/org.openhab.binding.fenecon/src/main/resources/OH-INF/addon/addon.xml
@@ -0,0 +1,11 @@
+
+
+
+ binding
+ FENECON Home Binding
+ This is the binding for FENECON Home.
+ local
+
+
diff --git a/bundles/org.openhab.binding.fenecon/src/main/resources/OH-INF/i18n/fenecon.properties b/bundles/org.openhab.binding.fenecon/src/main/resources/OH-INF/i18n/fenecon.properties
new file mode 100644
index 0000000000000..ea8a61f272b47
--- /dev/null
+++ b/bundles/org.openhab.binding.fenecon/src/main/resources/OH-INF/i18n/fenecon.properties
@@ -0,0 +1,57 @@
+# add-on
+
+addon.fenecon.name = FENECON Home Binding
+addon.fenecon.description = This is the binding for FENECON Home.
+
+# thing types
+
+thing-type.fenecon.home-device.label = FENECON Home
+thing-type.fenecon.home-device.description = Thing for FENECON Home Device
+
+# thing types config
+
+thing-type.config.fenecon.home-device.hostname.label = Hostname
+thing-type.config.fenecon.home-device.hostname.description = Hostname or IP address of the FENECON device, e.g. 192.168.1.11
+thing-type.config.fenecon.home-device.password.label = Password
+thing-type.config.fenecon.home-device.password.description = Password to access the device. The password for guest access is set by default.
+thing-type.config.fenecon.home-device.port.label = Port
+thing-type.config.fenecon.home-device.port.description = Port of the FENECON device
+thing-type.config.fenecon.home-device.refreshInterval.label = Refresh Interval
+thing-type.config.fenecon.home-device.refreshInterval.description = Interval the device is polled in sec.
+
+# channel types
+
+channel-type.fenecon.charger-power.label = Charger Power
+channel-type.fenecon.charger-power.description = Current charger power of energy storage system in watt.
+channel-type.fenecon.consumption-active-power-phase.label = Consumer Power Phase
+channel-type.fenecon.consumption-active-power-phase.description = Current active power consumer load in watt on the corresponding phase.
+channel-type.fenecon.consumption-active-power.label = Consumer Power
+channel-type.fenecon.consumption-active-power.description = Current active power consumer load in watt.
+channel-type.fenecon.consumption-max-active-power.label = Consumer Max Power
+channel-type.fenecon.consumption-max-active-power.description = Maximum active consumption power in watt that was measured.
+channel-type.fenecon.discharger-power.label = Discharger Power
+channel-type.fenecon.discharger-power.description = Current discharger power of energy storage system in watt.
+channel-type.fenecon.emergency-power-mode.label = Emergency Power Mode
+channel-type.fenecon.emergency-power-mode.description = Indicates if there is no power from the grid and the emergency power mode is on.
+channel-type.fenecon.ess-soc.label = Battery State
+channel-type.fenecon.ess-soc.description = Battery state of charge in percent
+channel-type.fenecon.export-to-grid-power.label = Export Grid Power
+channel-type.fenecon.export-to-grid-power.description = Current export power to grid in watt.
+channel-type.fenecon.exported-to-grid-energy.label = Exported Grid Energy
+channel-type.fenecon.exported-to-grid-energy.description = Total energy exported to the grid in watt per hour.
+channel-type.fenecon.import-from-grid-power.label = Import Grid Power
+channel-type.fenecon.import-from-grid-power.description = Current import power from grid in watt.
+channel-type.fenecon.imported-from-grid-energy.label = Imported Grid Energy
+channel-type.fenecon.imported-from-grid-energy.description = Total energy imported from the grid in watt per hour.
+channel-type.fenecon.last-update.label = Last Update
+channel-type.fenecon.last-update.description = Last successful update via REST-API from the FENECON system
+channel-type.fenecon.production-active-power.label = Producer Power
+channel-type.fenecon.production-active-power.description = Current active power producer load in watt.
+channel-type.fenecon.production-max-active-power.label = Producer Max Power
+channel-type.fenecon.production-max-active-power.description = Maximum active production power in watt that was measured.
+channel-type.fenecon.state.label = System State
+channel-type.fenecon.state.description = FENECON system state
+channel-type.fenecon.state.state.option.OK = Ok
+channel-type.fenecon.state.state.option.INFO = Info
+channel-type.fenecon.state.state.option.WARN = Warning
+channel-type.fenecon.state.state.option.FAULT = Fault
diff --git a/bundles/org.openhab.binding.fenecon/src/main/resources/OH-INF/thing/thing-types.xml b/bundles/org.openhab.binding.fenecon/src/main/resources/OH-INF/thing/thing-types.xml
new file mode 100644
index 0000000000000..1ae8c93676abe
--- /dev/null
+++ b/bundles/org.openhab.binding.fenecon/src/main/resources/OH-INF/thing/thing-types.xml
@@ -0,0 +1,177 @@
+
+
+
+
+
+
+ FENECON Home
+ Thing for FENECON Home Device
+ Solarplant
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ network-address
+ Hostname
+ Hostname or IP address of the FENECON device, e.g. 192.168.1.11
+
+
+ password
+ Password
+ user
+ Password to access the device. The password for guest access is set by default.
+ true
+
+
+ network-address
+ Port
+ Port of the FENECON device
+ 8084
+ true
+
+
+ Refresh Interval
+ Interval the device is polled in sec.
+ 30
+ true
+
+
+
+
+
+
+ String
+ System State
+ FENECON system state
+ Text
+
+
+ Ok
+ Info
+ Warning
+ Fault
+
+
+
+
+ DateTime
+ Last Update
+ Last successful update via REST-API from the FENECON system
+ Time
+
+
+
+ Number:Dimensionless
+ Battery State
+ Battery state of charge in percent
+ BatteryLevel
+
+
+
+ Number:Power
+ Charger Power
+ Current charger power of energy storage system in watt.
+ Energy
+
+
+
+ Number:Power
+ Discharger Power
+ Current discharger power of energy storage system in watt.
+ Energy
+
+
+
+ Switch
+ Emergency Power Mode
+ Indicates if there is no power from the grid and the emergency power mode is on.
+ Switch
+
+
+
+ Number:Power
+ Producer Power
+ Current active power producer load in watt.
+ Energy
+
+
+
+ Number:Power
+ Export Grid Power
+ Current export power to grid in watt.
+ Energy
+
+
+
+ Number:Energy
+ Exported Grid Energy
+ Total energy exported to the grid in watt per hour.
+ Energy
+
+
+
+ Number:Power
+ Consumer Power
+ Current active power consumer load in watt.
+ Energy
+
+
+
+ Number:Power
+ Consumer Power Phase
+ Current active power consumer load in watt on the corresponding phase.
+ Energy
+
+
+
+ Number:Power
+ Consumer Max Power
+ Maximum active consumption power in watt that was measured.
+ Energy
+
+
+
+ Number:Power
+ Producer Max Power
+ Maximum active production power in watt that was measured.
+ Energy
+
+
+
+ Number:Power
+ Import Grid Power
+ Current import power from grid in watt.
+ Energy
+
+
+
+ Number:Energy
+ Imported Grid Energy
+ Total energy imported from the grid in watt per hour.
+ Energy
+
+
+
+
diff --git a/bundles/org.openhab.binding.fenecon/src/test/java/org/openhab/binding/fenecon/internal/FeneconBindingConstantsTest.java b/bundles/org.openhab.binding.fenecon/src/test/java/org/openhab/binding/fenecon/internal/FeneconBindingConstantsTest.java
new file mode 100644
index 0000000000000..01d67c89bff23
--- /dev/null
+++ b/bundles/org.openhab.binding.fenecon/src/test/java/org/openhab/binding/fenecon/internal/FeneconBindingConstantsTest.java
@@ -0,0 +1,48 @@
+/**
+ * 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.fenecon.internal;
+
+import static org.junit.jupiter.api.Assertions.*;
+
+import java.lang.reflect.Field;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jdt.annotation.NonNullByDefault;
+import org.junit.jupiter.api.Test;
+
+/**
+ * Test for {@link FeneconBindingConstants}.
+ *
+ * @author Philipp Schneider - Initial contribution
+ */
+@NonNullByDefault
+public class FeneconBindingConstantsTest {
+
+ @Test
+ void checkAllAddressesAreListed() throws IllegalArgumentException, IllegalAccessException {
+ List findAddresses = new ArrayList<>();
+
+ for (Field eachDeclaredField : FeneconBindingConstants.class.getDeclaredFields()) {
+ if (eachDeclaredField.getName().endsWith("_ADDRESS")) {
+ String address = (String) eachDeclaredField.get(FeneconBindingConstants.class);
+ if (address != null) {
+ findAddresses.add(address);
+ }
+ }
+ }
+
+ assertEquals(FeneconBindingConstants.ADDRESSES.size(), findAddresses.size());
+ assertTrue(findAddresses.containsAll(FeneconBindingConstants.ADDRESSES));
+ }
+}
diff --git a/bundles/org.openhab.binding.fenecon/src/test/java/org/openhab/binding/fenecon/internal/api/BatteryPowerTest.java b/bundles/org.openhab.binding.fenecon/src/test/java/org/openhab/binding/fenecon/internal/api/BatteryPowerTest.java
new file mode 100644
index 0000000000000..dfa78cb49459d
--- /dev/null
+++ b/bundles/org.openhab.binding.fenecon/src/test/java/org/openhab/binding/fenecon/internal/api/BatteryPowerTest.java
@@ -0,0 +1,44 @@
+/**
+ * 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.fenecon.internal.api;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+import org.eclipse.jdt.annotation.NonNullByDefault;
+import org.junit.jupiter.api.Test;
+import org.openhab.binding.fenecon.internal.FeneconBindingConstants;
+
+/**
+ * Test for {@link BatteryPower}.
+ *
+ * @author Philipp Schneider - Initial contribution
+ */
+@NonNullByDefault
+public class BatteryPowerTest {
+
+ @Test
+ void testCharging() {
+ BatteryPower batteryPower = BatteryPower
+ .get(new FeneconResponse(FeneconBindingConstants.ESS_DISCHARGE_POWER_ADDRESS, "comment", "-1777"));
+ assertEquals(1777, batteryPower.chargerPower());
+ assertEquals(0, batteryPower.dischargerPower());
+ }
+
+ @Test
+ void testDischarging() {
+ BatteryPower batteryPower = BatteryPower
+ .get(new FeneconResponse(FeneconBindingConstants.ESS_DISCHARGE_POWER_ADDRESS, "comment", "1777"));
+ assertEquals(1777, batteryPower.dischargerPower());
+ assertEquals(0, batteryPower.chargerPower());
+ }
+}
diff --git a/bundles/org.openhab.binding.fenecon/src/test/java/org/openhab/binding/fenecon/internal/api/GridPowerTest.java b/bundles/org.openhab.binding.fenecon/src/test/java/org/openhab/binding/fenecon/internal/api/GridPowerTest.java
new file mode 100644
index 0000000000000..1ed981df9e66e
--- /dev/null
+++ b/bundles/org.openhab.binding.fenecon/src/test/java/org/openhab/binding/fenecon/internal/api/GridPowerTest.java
@@ -0,0 +1,44 @@
+/**
+ * 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.fenecon.internal.api;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+import org.eclipse.jdt.annotation.NonNullByDefault;
+import org.junit.jupiter.api.Test;
+import org.openhab.binding.fenecon.internal.FeneconBindingConstants;
+
+/**
+ * Test for {@link GridPower}.
+ *
+ * @author Philipp Schneider - Initial contribution
+ */
+@NonNullByDefault
+public class GridPowerTest {
+
+ @Test
+ void testSelling() {
+ GridPower gridValue = GridPower
+ .get(new FeneconResponse(FeneconBindingConstants.GRID_ACTIVE_POWER_ADDRESS, "comment", "-1777"));
+ assertEquals(1777, gridValue.sellTo());
+ assertEquals(0, gridValue.buyFrom());
+ }
+
+ @Test
+ void testBuying() {
+ GridPower gridValue = GridPower
+ .get(new FeneconResponse(FeneconBindingConstants.GRID_ACTIVE_POWER_ADDRESS, "comment", "1777"));
+ assertEquals(1777, gridValue.buyFrom());
+ assertEquals(0, gridValue.sellTo());
+ }
+}
diff --git a/bundles/org.openhab.binding.fenecon/src/test/java/org/openhab/binding/fenecon/internal/api/StateTest.java b/bundles/org.openhab.binding.fenecon/src/test/java/org/openhab/binding/fenecon/internal/api/StateTest.java
new file mode 100644
index 0000000000000..fa947a2268cab
--- /dev/null
+++ b/bundles/org.openhab.binding.fenecon/src/test/java/org/openhab/binding/fenecon/internal/api/StateTest.java
@@ -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.fenecon.internal.api;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+import org.eclipse.jdt.annotation.NonNullByDefault;
+import org.junit.jupiter.api.Test;
+import org.openhab.binding.fenecon.internal.FeneconBindingConstants;
+
+/**
+ * Test for {@link State}.
+ *
+ * @author Philipp Schneider - Initial contribution
+ */
+@NonNullByDefault
+public class StateTest {
+
+ @Test
+ void testStateOk() {
+ State state = State.get(
+ new FeneconResponse(FeneconBindingConstants.STATE_ADDRESS, "0:Ok, 1:Info, 2:Warning, 3:Fault", "0"));
+ assertEquals("Ok", state.state());
+ }
+
+ @Test
+ void testStateInfo() {
+ State state = State.get(
+ new FeneconResponse(FeneconBindingConstants.STATE_ADDRESS, "0:Ok, 1:Info, 2:Warning, 3:Fault", "1"));
+ assertEquals("Info", state.state());
+ }
+
+ @Test
+ void testStateWarning() {
+ State state = State.get(
+ new FeneconResponse(FeneconBindingConstants.STATE_ADDRESS, "0:Ok, 1:Info, 2:Warning, 3:Fault", "2"));
+ assertEquals("Warning", state.state());
+ }
+
+ @Test
+ void testStateFault() {
+ State state = State.get(
+ new FeneconResponse(FeneconBindingConstants.STATE_ADDRESS, "0:Ok, 1:Info, 2:Warning, 3:Fault", "3"));
+ assertEquals("Fault", state.state());
+ }
+
+ @Test
+ void testStateUnknown() {
+ State state = State.get(
+ new FeneconResponse(FeneconBindingConstants.STATE_ADDRESS, "0:Ok, 1:Info, 2:Warning, 3:Fault", "4"));
+ assertEquals("Unknown", state.state());
+ }
+}
diff --git a/bundles/pom.xml b/bundles/pom.xml
index 1f26e09f2c2d3..452cf82e9ead5 100644
--- a/bundles/pom.xml
+++ b/bundles/pom.xml
@@ -146,6 +146,7 @@
org.openhab.binding.exec
org.openhab.binding.feed
org.openhab.binding.feican
+ org.openhab.binding.fenecon
org.openhab.binding.fineoffsetweatherstation
org.openhab.binding.flicbutton
org.openhab.binding.fmiweather