From f4ce21b27bef0816fb25aa95bb7d9e36db7db2b2 Mon Sep 17 00:00:00 2001 From: MikeTheTux <44850211+MikeTheTux@users.noreply.github.com> Date: Mon, 19 Feb 2024 18:49:23 +0100 Subject: [PATCH] [evcc] Add support of heating devices and three new channels (#16378) * added effectiveLimitSoC, chargerFeatureHeating and chargerFeatureIntegratedDevice channels support of heating devices (temperature) in addition to vehicles (SoC) Signed-off-by: Michael Weger Signed-off-by: Ciprian Pascu --- bundles/org.openhab.binding.evcc/README.md | 200 +++++++----- .../evcc/internal/EvccBindingConstants.java | 46 +++ .../binding/evcc/internal/EvccHandler.java | 302 ++++++++++++++---- .../evcc/internal/api/dto/Loadpoint.java | 30 ++ .../binding/evcc/internal/api/dto/Result.java | 20 ++ .../resources/OH-INF/i18n/evcc.properties | 30 ++ .../resources/OH-INF/thing/thing-types.xml | 120 ++++++- 7 files changed, 612 insertions(+), 136 deletions(-) diff --git a/bundles/org.openhab.binding.evcc/README.md b/bundles/org.openhab.binding.evcc/README.md index 3a625b6864b..8481821a324 100644 --- a/bundles/org.openhab.binding.evcc/README.md +++ b/bundles/org.openhab.binding.evcc/README.md @@ -33,7 +33,7 @@ Default value for _refreshInterval_ is 60 seconds. ## Channels -### General channels +### General Channels Those channels exist only once. Please note that some of them are only available when evcc is properly configured. @@ -52,52 +52,84 @@ Please note that some of them are only available when evcc is properly configure | general#gridPower | Number:Power | R | Current power from grid (negative means feed-in) | | general#homePower | Number:Power | R | Current power taken by home | | general#pvPower | Number:Power | R | Current power from photovoltaik | +| general#version | String | R | Current evcc version | +| general#availableVersion | String | R | Available evcc update version | -### Loadpoint channels +### Loadpoint Channels Those channels exist per configured loadpoint. -Please note that you have to replace _N_ with your loadpoint number. +Please note that you have to replace _\_ with your loadpoint id/number. -| Channel | Type | Read/Write | Description | -|-------------------------------------|------------------------|------------|-------------------------------------------------------------------------------------------------------------------| -| loadpointN#activePhases | Number | R | Current number of active phases while charging | -| loadpointN#chargeCurrent | Number:ElectricCurrent | R | Current amperage per connected phase while charging | -| loadpointN#chargeDuration | Number:Time | R | Charging duration | -| loadpointN#chargeRemainingDuration | Number:Time | R | Remaining duration until limit SoC is reached | -| loadpointN#chargeRemainingEnergy | Number:Energy | R | Remaining energy until limit SoC is reached | -| loadpointN#chargePower | Number:Power | R | Current power of charging | -| loadpointN#chargedEnergy | Number:Energy | R | Energy charged since plugged-in | -| loadpointN#charging | Switch | R | Loadpoint is currently charging | -| loadpointN#enabled | Switch | R | Charging enabled (mode is not "off") | -| loadpointN#maxCurrent | Number:ElectricCurrent | RW | Maximum amperage per connected phase with which the car should be charged | -| loadpointN#minCurrent | Number:ElectricCurrent | RW | Minimum amperage per connected phase with which the car should be charged | -| loadpointN#mode | String | RW | Charging mode: "off", "now", "minpv", "pv" | -| loadpointN#phases | Number | RW | The maximum number of phases which can be used | -| loadpointN#limitEnergy | Number:Energy | RW | Amount of energy to charge the vehicle with | -| loadpointN#limitSoC | Number:Dimensionless | RW | Until which state of charge (SoC) should the vehicle be charged | -| loadpointN#title | String | R | Title of loadpoint | -| loadpointN#vehicleConnected | Switch | R | Whether vehicle is connected to loadpoint | -| loadpointN#vehicleConnectedDuration | Number:Time | R | Duration the vehicle is connected to loadpoint | -| loadpointN#vehicleCapacity | Number:Energy | R | Capacity of EV battery | -| loadpointN#vehicleOdometer | Number:Length | R | Total distance travelled by EV | -| loadpointN#vehiclePresent | Switch | R | Whether evcc is able to get data from vehicle | -| loadpointN#vehicleRange | Number:Length | R | Battery range for EV | -| loadpointN#vehicleSoC | Number:Dimensionless | R | Current State of Charge of EV | -| loadpointN#vehicleName | String | R | The unique identifier of the EV used in the evcc configuration (containing no whitespaces nor special characters) | +| Channel | Type | Read/Write | Description | +|-----------------------------------------------|------------------------|------------|-------------------------------------------------------------------------------------------------------------------| +| loadpoint\#activePhases | Number | R | Current number of active phases while charging | +| loadpoint\#chargeCurrent | Number:ElectricCurrent | R | Current amperage per connected phase while charging | +| loadpoint\#chargeDuration | Number:Time | R | Charging duration | +| loadpoint\#chargeRemainingDuration | Number:Time | R | Remaining duration until limit SoC is reached | +| loadpoint\#chargeRemainingEnergy | Number:Energy | R | Remaining energy until limit SoC is reached | +| loadpoint\#chargePower | Number:Power | R | Current power of charging | +| loadpoint\#chargedEnergy | Number:Energy | R | Energy charged since plugged-in | +| loadpoint\#charging | Switch | R | Loadpoint is currently charging | +| loadpoint\#enabled | Switch | R | Charging enabled (mode is not "off") | +| loadpoint\#maxCurrent | Number:ElectricCurrent | RW | Maximum amperage per connected phase with which the car should be charged | +| loadpoint\#minCurrent | Number:ElectricCurrent | RW | Minimum amperage per connected phase with which the car should be charged | +| loadpoint\#mode | String | RW | Charging mode: "off", "now", "minpv", "pv" | +| loadpoint\#phases | Number | RW | The maximum number of phases which can be used | +| loadpoint\#limitEnergy | Number:Energy | RW | Amount of energy to charge the vehicle with | +| loadpoint\#title | String | R | Title of loadpoint | +| loadpoint\#vehicleConnected | Switch | R | Whether vehicle is connected to loadpoint | +| loadpoint\#vehicleConnectedDuration | Number:Time | R | Duration the vehicle is connected to loadpoint | +| loadpoint\#vehicleCapacity | Number:Energy | R | Capacity of EV battery | +| loadpoint\#vehicleOdometer | Number:Length | R | Total distance travelled by EV | +| loadpoint\#vehiclePresent | Switch | R | Whether evcc is able to get data from vehicle | +| loadpoint\#vehicleRange | Number:Length | R | Battery range for EV | +| loadpoint\#vehicleName | String | R | The unique identifier of the EV used in the evcc configuration (containing no whitespaces nor special characters) | +| loadpoint\#chargerFeatureHeating | Switch | R | 'True' for heating device: State of Charge in Degree instead of Percent | +| loadpoint\#chargerFeatureIntegratedDevice | Switch | R | 'True' for integrated device: Operate without a "vehicle" (e.g. heat pump, eBike) | -### Vehicle channels +#### Loadpoint Channels Specific for Vehicles + +| Channel | Type | Read/Write | Description | +|----------------------------------|----------------------|------------|-------------------------------------------------------------------------| +| loadpoint\#limitSoC | Number:Dimensionless | RW | Until which state of charge (SoC) should the vehicle be charged | +| loadpoint\#effectiveLimitSoC | Number:Dimensionless | R | Effective state of charge (SoC) until which the vehicle will be charged | +| loadpoint\#vehicleSoC | Number:Dimensionless | R | Current State of Charge of EV | + +#### Loadpoint Channels Specific for Heating Devices + +| Channel | Type | Read/Write | Description | +|------------------------------------------|--------------------|------------|----------------------------------------------------------------------| +| loadpoint\#limitTemperature | Number:Temperature | RW | Until which Temperature should the heating device be charged | +| loadpoint\#effectiveLimitTemperature | Number:Temperature | R | Effective Temperature until which the heating device will be charged | +| loadpoint\#vehicleTemperature | Number:Temperature | R | Current Temperature of the heating device | + +### Vehicle Channels Those channels exist per configured vehicle. -Please note that you have to replace _ID_ with your vehicle id/name. +Please note that you have to replace _\_ with your vehicle id/name. -| Channel | Type | Read/Write | Description | -|------------------------------|----------------------|------------|--------------------------------------------------------------------------| -| vehicleID#vehicleTitle | String | R | Title of vehicle | -| vehicleID#vehicleMinSoC | Number:Dimensionless | RW | Minimum state of charge (SoC) a vehicle should have | -| vehicleID#vehicleLimitSoC | Number:Dimensionless | RW | Until which state of charge (SoC) should the specific vehicle be charged | -| vehicleID#vehiclePlanEnabled | Switch | RW | Plan for charging enabled | -| vehicleID#vehiclePlanSoC | Number:Dimensionless | RW | Until which state of charge (SoC) should vehicle be charged in plan | -| vehicleID#vehiclePlanTime | DateTime | RW | When the plan SoC should be reached | +| Channel | Type | Read/Write | Description | +|----------------------------------|----------------------|------------|--------------------------------------------------------------------------| +| vehicle\#vehicleTitle | String | R | Title of vehicle | +| vehicle\#vehicleMinSoC | Number:Dimensionless | RW | Minimum state of charge (SoC) a vehicle should have | +| vehicle\#vehicleLimitSoC | Number:Dimensionless | RW | Until which state of charge (SoC) should the specific vehicle be charged | +| vehicle\#vehiclePlanEnabled | Switch | RW | Plan for charging enabled | +| vehicle\#vehiclePlanSoC | Number:Dimensionless | RW | Until which state of charge (SoC) should vehicle be charged in plan | +| vehicle\#vehiclePlanTime | DateTime | RW | When the plan SoC should be reached | + +### Heating Channels + +Those channels exist per configured heating device. +Please note that you have to replace _\_ with your heating device id/name. + +| Channel | Type | Read/Write | Description | +|---------------------------------------|--------------------|------------|-----------------------------------------------------------------------| +| heating\#heatingTitle | String | R | Title of heating device | +| heating\#heatingMinTemperature | Number:Temperature | RW | Minimum Temperature a heating device should have | +| heating\#heatingLimitTemperature | Number:Temperature | RW | Until which Temperature should the specific heating device be charged | +| heating\#heatingPlanEnabled | Switch | RW | Plan for charging enabled | +| heating\#heatingPlanTemperature | Number:Temperature | RW | Until which Temperature should heating device be charged in plan | +| heating\#heatingPlanTime | DateTime | RW | When the plan Temperature should be reached | ## Full Example @@ -111,53 +143,59 @@ Thing evcc:device:demo "evcc Demo" [url="https://demo.evcc.io", refreshInterval= ```java // General -Number:Energy evcc_batteryCapacity "Battery Capacity [%.0f kWh]" {channel="evcc:device:demo:general#batteryCapacity"} -Number:Power evcc_batteryPower "Battery Power [%.1f kW]" {channel="evcc:device:demo:general#batteryPower"} -Number:Dimensionless evcc_batterySoC "Battery SoC [%d %%]" {channel="evcc:device:demo:general#batterySoC"} -Switch evcc_batteryDischargeControl "Battery Discharge Control [%s]" {channel="evcc:device:demo:general#batteryDischargeControl"} -String evcc_batteryMode "Battery Mode [%s]" {channel="evcc:device:demo:general#batteryMode"} -Number:Dimensionless evcc_prioritySoC "Battery Priority SoC [%d %%]" {channel="evcc:device:demo:general#prioritySoC"} -Number:Dimensionless evcc_bufferSoC "Battery Buffer SoC [%d %%]" {channel="evcc:device:demo:general#bufferSoC"} -Number:Dimensionless evcc_bufferStartSoC "Battery Buffer Start SoC [%d %%]" {channel="evcc:device:demo:general#bufferStartSoC"} -Number:Power evcc_residualPower "Grid Residual Power [%.1f kW]" {channel="evcc:device:demo:general#residualPower"} -Number:Power evcc_gridPower "Grid Power [%.1f kW]" {channel="evcc:device:demo:general#gridPower"} -Number:Power evcc_homePower "Home Power [%.1f kW]" {channel="evcc:device:demo:general#homePower"} -Number:Power evcc_pvPower "PV Power [%.1f kW]" {channel="evcc:device:demo:general#pvPower"} +Number:Energy evcc_batteryCapacity "Battery Capacity [%.0f kWh]" {channel="evcc:device:demo:general#batteryCapacity"} +Number:Power evcc_batteryPower "Battery Power [%.1f kW]" {channel="evcc:device:demo:general#batteryPower"} +Number:Dimensionless evcc_batterySoC "Battery SoC [%d %%]" {channel="evcc:device:demo:general#batterySoC"} +Switch evcc_batteryDischargeControl "Battery Discharge Control [%s]" {channel="evcc:device:demo:general#batteryDischargeControl"} +String evcc_batteryMode "Battery Mode [%s]" {channel="evcc:device:demo:general#batteryMode"} +Number:Dimensionless evcc_prioritySoC "Battery Priority SoC [%d %%]" {channel="evcc:device:demo:general#prioritySoC"} +Number:Dimensionless evcc_bufferSoC "Battery Buffer SoC [%d %%]" {channel="evcc:device:demo:general#bufferSoC"} +Number:Dimensionless evcc_bufferStartSoC "Battery Buffer Start SoC [%d %%]" {channel="evcc:device:demo:general#bufferStartSoC"} +Number:Power evcc_residualPower "Grid Residual Power [%.1f kW]" {channel="evcc:device:demo:general#residualPower"} +Number:Power evcc_gridPower "Grid Power [%.1f kW]" {channel="evcc:device:demo:general#gridPower"} +Number:Power evcc_homePower "Home Power [%.1f kW]" {channel="evcc:device:demo:general#homePower"} +Number:Power evcc_pvPower "PV Power [%.1f kW]" {channel="evcc:device:demo:general#pvPower"} +String evcc_version "Version [%s]" {channel="evcc:device:demo:general#version"} +String evcc_availableVersion "Available Version [%s]" {channel="evcc:device:demo:general#availableVersion"} // Loadpoint -Number evcc_loadpoint0_activePhases "Active Phases [%d]" {channel="evcc:device:demo:loadpoint0#activePhases"} -Number:ElectricCurrent evcc_loadpoint0_chargeCurrent "Charging current [%.0f A]" {channel="evcc:device:demo:loadpoint0#chargeCurrent"} -Number:Time evcc_loadpoint0_chargeDuration "Charging duration [%1$tH:%1$tM]"