Skip to content

Commit ade8d7d

Browse files
MikeTheTuxflorian-h05
authored andcommitted
[evcc] fixed channels vehicle/capacity and vehicle/vehicleName, added channels for current Vehicle/HeatingDevice per Loadpoint (openhab#16428)
* removed loadpoint/vehicleCapacity, added vehicle/capacity (bugfix) implemented currentVehicle / currentHeating per loadpoint (enhancement) fixed update of channeld vehicleTitle (bugfix) Signed-off-by: Michael Weger <[email protected]> (cherry picked from commit b423933)
1 parent d7ea627 commit ade8d7d

File tree

7 files changed

+359
-125
lines changed

7 files changed

+359
-125
lines changed

bundles/org.openhab.binding.evcc/README.md

+48-37
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ Please note that you have to replace _\<N\>_ with your loadpoint id/number.
7979
| loadpoint\<N\>#title | String | R | Title of loadpoint |
8080
| loadpoint\<N\>#vehicleConnected | Switch | R | Whether vehicle is connected to loadpoint |
8181
| loadpoint\<N\>#vehicleConnectedDuration | Number:Time | R | Duration the vehicle is connected to loadpoint |
82-
| loadpoint\<N\>#vehicleCapacity | Number:Energy | R | Capacity of EV battery |
8382
| loadpoint\<N\>#vehicleOdometer | Number:Length | R | Total distance travelled by EV |
8483
| loadpoint\<N\>#vehiclePresent | Switch | R | Whether evcc is able to get data from vehicle |
8584
| loadpoint\<N\>#vehicleRange | Number:Length | R | Battery range for EV |
@@ -105,31 +104,43 @@ Please note that you have to replace _\<N\>_ with your loadpoint id/number.
105104

106105
### Vehicle Channels
107106

108-
Those channels exist per configured vehicle.
109-
Please note that you have to replace _\<ID\>_ with your vehicle id/name.
107+
Those channels exist:
110108

111-
| Channel | Type | Read/Write | Description |
112-
|----------------------------------|----------------------|------------|--------------------------------------------------------------------------|
113-
| vehicle\<ID\>#vehicleTitle | String | R | Title of vehicle |
114-
| vehicle\<ID\>#vehicleMinSoC | Number:Dimensionless | RW | Minimum state of charge (SoC) a vehicle should have |
115-
| vehicle\<ID\>#vehicleLimitSoC | Number:Dimensionless | RW | Until which state of charge (SoC) should the specific vehicle be charged |
116-
| vehicle\<ID\>#vehiclePlanEnabled | Switch | RW | Plan for charging enabled |
117-
| vehicle\<ID\>#vehiclePlanSoC | Number:Dimensionless | RW | Until which state of charge (SoC) should vehicle be charged in plan |
118-
| vehicle\<ID\>#vehiclePlanTime | DateTime | RW | When the plan SoC should be reached |
109+
* 1 per configured loadpoint with `chargerFeatureHeating = false`:
110+
* These channels point to the heating device that is currently active/connected at/to the loadpoint
111+
* Please note that you have to replace _\<N\>_ with your loadpoint id/number
112+
* 1 per configured vehicle:
113+
* Please note that you have to replace _\<ID\>_ with your vehicle id/name
114+
115+
| Channel | Type | Read/Write | Description |
116+
|----------------------------------------------------|----------------------|------------|--------------------------------------------------------------------------|
117+
| [loadpoint\<N\>\|vehicle\<ID\]>#vehicleTitle | String | R | Title of vehicle |
118+
| [loadpoint\<N\>\|vehicle\<ID\]>#vehicleMinSoC | Number:Dimensionless | RW | Minimum state of charge (SoC) a vehicle should have |
119+
| [loadpoint\<N\>\|vehicle\<ID\]>#vehicleLimitSoC | Number:Dimensionless | RW | Until which state of charge (SoC) should the specific vehicle be charged |
120+
| [loadpoint\<N\>\|vehicle\<ID\]>#vehicleCapacity | Number:Energy | R | Capacity of EV battery |
121+
| [loadpoint\<N\>\|vehicle\<ID\]>#vehiclePlanEnabled | Switch | RW | Plan for charging enabled |
122+
| [loadpoint\<N\>\|vehicle\<ID\]>#vehiclePlanSoC | Number:Dimensionless | RW | Until which state of charge (SoC) should vehicle be charged in plan |
123+
| [loadpoint\<N\>\|vehicle\<ID\]>#vehiclePlanTime | DateTime | RW | When the plan SoC should be reached |
119124

120125
### Heating Channels
121126

122-
Those channels exist per configured heating device.
123-
Please note that you have to replace _\<ID\>_ with your heating device id/name.
127+
Those channels exist:
128+
129+
* 1 per configured loadpoint with `chargerFeatureHeating = true`:
130+
* These channels point to the heating device that is currently active/connected at/to the loadpoint
131+
* Please note that you have to replace _\<N\>_ with your loadpoint id/number
132+
* 1 per configured heating device:
133+
* Please note that you have to replace _\<ID\>_ with your heating device id/name
124134

125-
| Channel | Type | Read/Write | Description |
126-
|---------------------------------------|--------------------|------------|-----------------------------------------------------------------------|
127-
| heating\<ID\>#heatingTitle | String | R | Title of heating device |
128-
| heating\<ID\>#heatingMinTemperature | Number:Temperature | RW | Minimum Temperature a heating device should have |
129-
| heating\<ID\>#heatingLimitTemperature | Number:Temperature | RW | Until which Temperature should the specific heating device be charged |
130-
| heating\<ID\>#heatingPlanEnabled | Switch | RW | Plan for charging enabled |
131-
| heating\<ID\>#heatingPlanTemperature | Number:Temperature | RW | Until which Temperature should heating device be charged in plan |
132-
| heating\<ID\>#heatingPlanTime | DateTime | RW | When the plan Temperature should be reached |
135+
| Channel | Type | Read/Write | Description |
136+
|---------------------------------------------------------|--------------------|------------|-----------------------------------------------------------------------|
137+
| [loadpoint\<N\>\|heating\<ID\]>#heatingTitle | String | R | Title of heating device |
138+
| [loadpoint\<N\>\|heating\<ID\]>#heatingMinTemperature | Number:Temperature | RW | Minimum Temperature a heating device should have |
139+
| [loadpoint\<N\>\|heating\<ID\]>#heatingLimitTemperature | Number:Temperature | RW | Until which Temperature should the specific heating device be charged |
140+
| [loadpoint\<N\>\|heating\<ID\]>#heatingCapacity | Number:Energy | R | Capacity of heating device |
141+
| [loadpoint\<N\>\|heating\<ID\]>#heatingPlanEnabled | Switch | RW | Plan for charging enabled |
142+
| [loadpoint\<N\>\|heating\<ID\]>#heatingPlanTemperature | Number:Temperature | RW | Until which Temperature should heating device be charged in plan |
143+
| [loadpoint\<N\>\|heating\<ID\]>#heatingPlanTime | DateTime | RW | When the plan Temperature should be reached |
133144

134145
## Full Example
135146

@@ -179,23 +190,23 @@ String evcc_loadpoint0_title "Loadpoint
179190
Switch evcc_loadpoint0_chargerFeatureHeating "Feature: Heating [%s]" <switch> {channel="evcc:device:demo:loadpoint0#chargerFeatureHeating"}
180191
Switch evcc_loadpoint0_chargerFeatureIntegratedDevice "Feature: Integrated Device [%s]" <switch> {channel="evcc:device:demo:loadpoint0#chargerFeatureIntegratedDevice"}
181192

182-
// Vehicle on loadpoint
193+
// Loadpoint vehicle channels
183194
Switch evcc_loadpoint0_vehicleConnected "Vehicle connected [%s]" <switch> {channel="evcc:device:demo:loadpoint0#vehicleConnected"}
184195
Number:Time evcc_loadpoint0_vehicleConnectedDuration "Vehicle connected duration [%.1f h]" <time> {channel="evcc:device:demo:loadpoint0#vehicleConnectedDuration"}
185-
Number:Energy evcc_loadpoint0_vehicleCapacity "Vehicle capacity [%.0f kWh]" <batterylevel> {channel="evcc:device:demo:loadpoint0#vehicleCapacity"}
186196
Number:Length evcc_loadpoint0_vehicleOdometer "Vehicle odometer [%.1f km]" {channel="evcc:device:demo:loadpoint0#vehicleOdometer"}
187197
Switch evcc_loadpoint0_vehiclePresent "Vehicle present [%s]" <switch> {channel="evcc:device:demo:loadpoint0#vehiclePresent"}
188198
Number:Length evcc_loadpoint0_vehicleRange "Vehicle Range [%.0f km]" {channel="evcc:device:demo:loadpoint0#vehicleRange"}
189199
Number:Dimensionless evcc_loadpoint0_vehicleSoC "Vehicle SoC [%d %%]" <batterylevel> {channel="evcc:device:demo:loadpoint0#vehicleSoC"}
190200
String evcc_loadpoint0_VehicleName "Vehicle name [%s]" <text> {channel="evcc:device:demo:loadpoint0#vehicleName"}
191201

192-
// Vehicle
193-
String evcc_vehicle0_vehicleTitle "Vehicle title [%s]" <text> {channel="evcc:device:demo:vehicle0#vehicleTitle"}
194-
Number:Dimensionless evcc_vehicle0_vehicleMinSoC "Vehicle minimum SoC [%d %%]" <batterylevel> {channel="evcc:device:demo:vehicle0#vehicleMinSoC"}
195-
Number:Dimensionless evcc_vehicle0_vehicleLimitSoC "Vehicle limit SoC [%d %%]" <batterylevel> {channel="evcc:device:demo:vehicle0#vehicleLimitSoC"}
196-
Switch evcc_vehicle0_vehiclePlanEnabled "Vehicle plan enabled [%s]" <switch> {channel="evcc:device:demo:vehicle0#vehiclePlanEnabled"}
197-
Number:Dimensionless evcc_vehicle0_vehiclePlanSoC "Vehicle plan SoC [%d %%]" <batterylevel> {channel="evcc:device:demo:vehicle0#vehiclePlanSoC"}
198-
DateTime evcc_vehicle0_vehiclePlanTime "Vehicle plan time [%1$td.%1$tm.%1$tY, %1$tH:%1$tM]" <time> {channel="evcc:device:demo:vehicle0#vehiclePlanTime"}
202+
// Vehicle on loadpoint
203+
String evcc_loadpoint0current_vehicleTitle "Vehicle title [%s]" <text> {channel="evcc:device:demo:loadpoint0current#vehicleTitle"}
204+
Number:Dimensionless evcc_loadpoint0current_vehicleMinSoC "Vehicle minimum SoC [%d %%]" <batterylevel> {channel="evcc:device:demo:loadpoint0current#vehicleMinSoC"}
205+
Number:Dimensionless evcc_loadpoint0current_vehicleLimitSoC "Vehicle limit SoC [%d %%]" <batterylevel> {channel="evcc:device:demo:loadpoint0current#vehicleLimitSoC"}
206+
Number:Energy evcc_loadpoint0current_vehicleCapacity "Vehicle capacity [%.0f kWh]" <batterylevel> {channel="evcc:device:demo:loadpoint0current#vehicleCapacity"}
207+
Switch evcc_loadpoint0current_vehiclePlanEnabled "Vehicle plan enabled [%s]" <switch> {channel="evcc:device:demo:loadpoint0current#vehiclePlanEnabled"}
208+
Number:Dimensionless evcc_loadpoint0current_vehiclePlanSoC "Vehicle plan SoC [%d %%]" <batterylevel> {channel="evcc:device:demo:loadpoint0current#vehiclePlanSoC"}
209+
DateTime evcc_loadpoint0current_vehiclePlanTime "Vehicle plan time [%1$td.%1$tm.%1$tY, %1$tH:%1$tM]" <time> {channel="evcc:device:demo:loadpoint0current#vehiclePlanTime"}
199210
```
200211

201212
### Sitemap
@@ -230,16 +241,16 @@ sitemap evcc label="evcc Demo" {
230241
Setpoint item=evcc_loadpoint0_phases minValue=1 maxValue=3 step=2
231242
}
232243
Text item=evcc_loadpoint0_vehicleName label="Vehicle" {
233-
Text item=evcc_loadpoint0_vehicleCapacity
244+
Text item=evcc_loadpoint0current_vehicleCapacity
234245
Text item=evcc_loadpoint0_vehicleOdometer
235246
Text item=evcc_loadpoint0_vehicleRange
236247
Text item=evcc_loadpoint0_vehicleSoC
237-
Text item=evcc_vehicle0_vehicleTitle
238-
Setpoint item=evcc_vehicle0_vehicleMinSoC minValue=0 maxValue=100 step=5
239-
Setpoint item=evcc_vehicle0_vehicleLimitSoC minValue=5 maxValue=100 step=5
240-
Switch item=evcc_vehicle0_vehiclePlanEnabled
241-
Setpoint item=evcc_vehicle0_vehiclePlanSoC minValue=5 maxValue=100 step=5
242-
Input item=evcc_vehicle0_vehiclePlanTime
248+
Text item=evcc_loadpoint0current_vehicleTitle
249+
Setpoint item=evcc_loadpoint0current_vehicleMinSoC minValue=0 maxValue=100 step=5
250+
Setpoint item=evcc_loadpoint0current_vehicleLimitSoC minValue=5 maxValue=100 step=5
251+
Switch item=evcc_loadpoint0current_vehiclePlanEnabled
252+
Setpoint item=evcc_loadpoint0current_vehiclePlanSoC minValue=5 maxValue=100 step=5
253+
Input item=evcc_loadpoint0current_vehiclePlanTime
243254
}
244255
}
245256
}

bundles/org.openhab.binding.evcc/src/main/java/org/openhab/binding/evcc/internal/EvccBindingConstants.java

+7-3
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ public class EvccBindingConstants {
3232
public static final String CHANNEL_GROUP_ID_LOADPOINT = "loadpoint";
3333
public static final String CHANNEL_GROUP_ID_VEHICLE = "vehicle";
3434
public static final String CHANNEL_GROUP_ID_HEATING = "heating";
35+
public static final String CHANNEL_GROUP_ID_CURRENT = "current";
3536

3637
// List of all Channel ids
3738
public static final String CHANNEL_BATTERY_CAPACITY = "batteryCapacity";
@@ -70,7 +71,6 @@ public class EvccBindingConstants {
7071
public static final String CHANNEL_LOADPOINT_EFFECTIVE_LIMIT_SOC = "effectiveLimitSoC";
7172
public static final String CHANNEL_LOADPOINT_EFFECTIVE_LIMIT_TEMPERATURE = "effectiveLimitTemperature";
7273
public static final String CHANNEL_LOADPOINT_TITLE = "title";
73-
public static final String CHANNEL_LOADPOINT_VEHICLE_CAPACITY = "vehicleCapacity";
7474
public static final String CHANNEL_LOADPOINT_VEHICLE_ODOMETER = "vehicleOdometer";
7575
public static final String CHANNEL_LOADPOINT_VEHICLE_PRESENT = "vehiclePresent";
7676
public static final String CHANNEL_LOADPOINT_VEHICLE_RANGE = "vehicleRange";
@@ -86,6 +86,8 @@ public class EvccBindingConstants {
8686
public static final String CHANNEL_HEATING_MIN_TEMPERATURE = "heatingMinTemperature";
8787
public static final String CHANNEL_VEHICLE_LIMIT_SOC = "vehicleLimitSoC";
8888
public static final String CHANNEL_HEATING_LIMIT_TEMPERATURE = "heatingLimitTemperature";
89+
public static final String CHANNEL_VEHICLE_CAPACITY = "vehicleCapacity";
90+
public static final String CHANNEL_HEATING_CAPACITY = "heatingCapacity";
8991
public static final String CHANNEL_VEHICLE_PLAN_ENABLED = "vehiclePlanEnabled";
9092
public static final String CHANNEL_HEATING_PLAN_ENABLED = "heatingPlanEnabled";
9193
public static final String CHANNEL_VEHICLE_PLAN_SOC = "vehiclePlanSoC";
@@ -163,8 +165,6 @@ public class EvccBindingConstants {
163165
BINDING_ID, CHANNEL_LOADPOINT_EFFECTIVE_LIMIT_TEMPERATURE);
164166
public static final ChannelTypeUID CHANNEL_TYPE_UID_LOADPOINT_TITLE = new ChannelTypeUID(BINDING_ID,
165167
CHANNEL_LOADPOINT_TITLE);
166-
public static final ChannelTypeUID CHANNEL_TYPE_UID_LOADPOINT_VEHICLE_CAPACITY = new ChannelTypeUID(BINDING_ID,
167-
CHANNEL_LOADPOINT_VEHICLE_CAPACITY);
168168
public static final ChannelTypeUID CHANNEL_TYPE_UID_LOADPOINT_VEHICLE_ODOMETER = new ChannelTypeUID(BINDING_ID,
169169
CHANNEL_LOADPOINT_VEHICLE_ODOMETER);
170170
public static final ChannelTypeUID CHANNEL_TYPE_UID_LOADPOINT_VEHICLE_PRESENT = new ChannelTypeUID(BINDING_ID,
@@ -194,6 +194,10 @@ public class EvccBindingConstants {
194194
CHANNEL_VEHICLE_LIMIT_SOC);
195195
public static final ChannelTypeUID CHANNEL_TYPE_UID_HEATING_LIMIT_TEMPERATURE = new ChannelTypeUID(BINDING_ID,
196196
CHANNEL_HEATING_LIMIT_TEMPERATURE);
197+
public static final ChannelTypeUID CHANNEL_TYPE_UID_VEHICLE_CAPACITY = new ChannelTypeUID(BINDING_ID,
198+
CHANNEL_VEHICLE_CAPACITY);
199+
public static final ChannelTypeUID CHANNEL_TYPE_UID_HEATING_CAPACITY = new ChannelTypeUID(BINDING_ID,
200+
CHANNEL_HEATING_CAPACITY);
197201
public static final ChannelTypeUID CHANNEL_TYPE_UID_VEHICLE_PLAN_ENABLED = new ChannelTypeUID(BINDING_ID,
198202
CHANNEL_VEHICLE_PLAN_ENABLED);
199203
public static final ChannelTypeUID CHANNEL_TYPE_UID_HEATING_PLAN_ENABLED = new ChannelTypeUID(BINDING_ID,

0 commit comments

Comments
 (0)