[keba] Split channel ENABLED to USER and SYSTEM channels (#15531)

* Split channel ENABLED to USER and SYSTEM channels

---------

Signed-off-by: Simon Spielmann <simon.spielmann@gmx.de>
This commit is contained in:
Simon Spielmann 2023-11-03 20:48:39 +01:00 committed by GitHub
parent 94d9fb7d36
commit 538a455bfd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 51 additions and 22 deletions

View File

@ -18,7 +18,8 @@ All devices support the following channels:
| Channel ID | Item Type | Read-only | Description | | Channel ID | Item Type | Read-only | Description |
| ----------------------- | ------------------------ | --------- | ----------------------------------------------------------------------- | | ----------------------- | ------------------------ | --------- | ----------------------------------------------------------------------- |
| state | Number | yes | current operational state of the wallbox | | state | Number | yes | current operational state of the wallbox |
| enabled | Switch | no | activation state of the wallbox | | enabledsystem | Switch | yes | activation state of the wallbox (System) |
| enableduser | Switch | no | activation state of the wallbox (User) |
| maxpresetcurrent | Number:ElectricCurrent | no | maximum current the charging station should deliver to the EV in A | | maxpresetcurrent | Number:ElectricCurrent | no | maximum current the charging station should deliver to the EV in A |
| maxpresetcurrentrange | Number:Dimensionless | no | maximum current the charging station should deliver to the EV in % | | maxpresetcurrentrange | Number:Dimensionless | no | maximum current the charging station should deliver to the EV in % |
| power | Number:Power | yes | active power delivered by the charging station | | power | Number:Power | yes | active power delivered by the charging station |
@ -63,7 +64,8 @@ Number:ElectricCurrent KebaCurrent "Maximum supply current [%.3f A]
Number:ElectricCurrent KebaSystemCurrent "Maximum system supply current [%.3f A]" {channel="keba:kecontact:1:maxsystemcurrent"} Number:ElectricCurrent KebaSystemCurrent "Maximum system supply current [%.3f A]" {channel="keba:kecontact:1:maxsystemcurrent"}
Number:ElectricCurrent KebaFailSafeCurrent "Failsafe supply current [%.3f A]" {channel="keba:kecontact:1:failsafecurrent"} Number:ElectricCurrent KebaFailSafeCurrent "Failsafe supply current [%.3f A]" {channel="keba:kecontact:1:failsafecurrent"}
Number KebaState "Operating State [%s]" {channel="keba:kecontact:1:state"} Number KebaState "Operating State [%s]" {channel="keba:kecontact:1:state"}
Switch KebaSwitch "Enabled" {channel="keba:kecontact:1:enabled"} Switch KebaEnabledSystem "Enabled (System)" {channel="keba:kecontact:1:enabledsystem"}
Switch KebaEnabledUser "Enabled (User)" {channel="keba:kecontact:1:enableduser"}
Switch KebaWallboxPlugged "Plugged into wallbox" {channel="keba:kecontact:1:wallbox"} Switch KebaWallboxPlugged "Plugged into wallbox" {channel="keba:kecontact:1:wallbox"}
Switch KebaVehiclePlugged "Plugged into vehicle" {channel="keba:kecontact:1:vehicle"} Switch KebaVehiclePlugged "Plugged into vehicle" {channel="keba:kecontact:1:vehicle"}
Switch KebaPlugLocked "Plug locked" {channel="keba:kecontact:1:locked"} Switch KebaPlugLocked "Plug locked" {channel="keba:kecontact:1:locked"}
@ -90,7 +92,8 @@ sitemap demo label="Main Menu"
Text label="Charging Station" { Text label="Charging Station" {
Text item=KebaState Text item=KebaState
Text item=KebaUptime Text item=KebaUptime
Switch item=KebaSwitch Switch item=KebaEnabledSystem
Switch item=KebaEnabledUser
Switch item=KebaWallboxPlugged Switch item=KebaWallboxPlugged
Switch item=KebaVehiclePlugged Switch item=KebaVehiclePlugged
Switch item=KebaPlugLocked Switch item=KebaPlugLocked

View File

@ -41,7 +41,8 @@ public class KebaBindingConstants {
public static final String CHANNEL_WALLBOX = "wallbox"; public static final String CHANNEL_WALLBOX = "wallbox";
public static final String CHANNEL_VEHICLE = "vehicle"; public static final String CHANNEL_VEHICLE = "vehicle";
public static final String CHANNEL_PLUG_LOCKED = "locked"; public static final String CHANNEL_PLUG_LOCKED = "locked";
public static final String CHANNEL_ENABLED = "enabled"; public static final String CHANNEL_ENABLED_SYSTEM = "enabledsystem";
public static final String CHANNEL_ENABLED_USER = "enableduser";
public static final String CHANNEL_PILOT_CURRENT = "maxpilotcurrent"; public static final String CHANNEL_PILOT_CURRENT = "maxpilotcurrent";
public static final String CHANNEL_PILOT_PWM = "maxpilotcurrentdutycyle"; public static final String CHANNEL_PILOT_PWM = "maxpilotcurrentdutycyle";
public static final String CHANNEL_MAX_SYSTEM_CURRENT = "maxsystemcurrent"; public static final String CHANNEL_MAX_SYSTEM_CURRENT = "maxsystemcurrent";

View File

@ -323,17 +323,11 @@ public class KeContactHandler extends BaseThingHandler {
break; break;
} }
case "Enable sys": { case "Enable sys": {
int state = entry.getValue().getAsInt(); updateState(CHANNEL_ENABLED_SYSTEM, OnOffType.from(entry.getValue().getAsInt() == 1));
switch (state) { break;
case 1: { }
updateState(CHANNEL_ENABLED, OnOffType.ON); case "Enable user": {
break; updateState(CHANNEL_ENABLED_USER, OnOffType.from(entry.getValue().getAsInt() == 1));
}
default: {
updateState(CHANNEL_ENABLED, OnOffType.OFF);
break;
}
}
break; break;
} }
case "Curr HW": { case "Curr HW": {
@ -558,7 +552,7 @@ public class KeContactHandler extends BaseThingHandler {
} }
break; break;
} }
case CHANNEL_ENABLED: { case CHANNEL_ENABLED_USER: {
if (command instanceof OnOffType) { if (command instanceof OnOffType) {
if (command == OnOffType.ON) { if (command == OnOffType.ON) {
transceiver.send("ena 1", this); transceiver.send("ena 1", this);

View File

@ -35,8 +35,10 @@ channel-type.keba.current_settable.label = Preset Current
channel-type.keba.current_settable.description = Preset Current channel-type.keba.current_settable.description = Preset Current
channel-type.keba.display.label = Display channel-type.keba.display.label = Display
channel-type.keba.display.description = Text to show on the P30 Series C or X display channel-type.keba.display.description = Text to show on the P30 Series C or X display
channel-type.keba.enabled.label = Enabled channel-type.keba.enabledsystem.label = Enabled (System)
channel-type.keba.enabled.description = Activation state of the wallbox channel-type.keba.enabledsystem.description = Activation state of the wallbox (System)
channel-type.keba.enableduser.label = Enabled (User)
channel-type.keba.enableduser.description = Activation state of the wallbox (User)
channel-type.keba.energy.label = Energy Session channel-type.keba.energy.label = Energy Session
channel-type.keba.energy.description = Power consumption channel-type.keba.energy.description = Power consumption
channel-type.keba.error1.label = Error Code 1 channel-type.keba.error1.label = Error Code 1

View File

@ -9,7 +9,8 @@
<description>A KeContact EV Charging Station</description> <description>A KeContact EV Charging Station</description>
<channels> <channels>
<channel id="enabled" typeId="enabled"/> <channel id="enabledsystem" typeId="enabledsystem"/>
<channel id="enableduser" typeId="enableduser"/>
<channel id="state" typeId="state"/> <channel id="state" typeId="state"/>
<channel id="maxpresetcurrent" typeId="current_settable"/> <channel id="maxpresetcurrent" typeId="current_settable"/>
<channel id="maxpresetcurrentrange" typeId="range"/> <channel id="maxpresetcurrentrange" typeId="range"/>
@ -57,6 +58,10 @@
<channel id="authenticate" typeId="authenticate"/> <channel id="authenticate" typeId="authenticate"/>
</channels> </channels>
<properties>
<property name="thingTypeVersion">1</property>
</properties>
<config-description> <config-description>
<parameter name="ipAddress" type="text" required="true"> <parameter name="ipAddress" type="text" required="true">
<label>Network Address</label> <label>Network Address</label>
@ -115,10 +120,16 @@
<description>Indicator if the plug is locked by the electrical vehicle</description> <description>Indicator if the plug is locked by the electrical vehicle</description>
<state readOnly="true"></state> <state readOnly="true"></state>
</channel-type> </channel-type>
<channel-type id="enabled"> <channel-type id="enabledsystem">
<item-type>Switch</item-type> <item-type>Switch</item-type>
<label>Enabled</label> <label>Enabled (System)</label>
<description>Activation state of the wallbox</description> <description>Activation state of the wallbox (System)</description>
<state readOnly="true"></state>
</channel-type>
<channel-type id="enableduser">
<item-type>Switch</item-type>
<label>Enabled (User)</label>
<description>Activation state of the wallbox (User)</description>
<state readOnly="false"></state> <state readOnly="false"></state>
</channel-type> </channel-type>
<channel-type id="x1" advanced="true"> <channel-type id="x1" advanced="true">

View File

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<update:update-descriptions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:update="https://openhab.org/schemas/update-description/v1.0.0"
xsi:schemaLocation="https://openhab.org/schemas/update-description/v1.0.0 https://openhab.org/schemas/update-description-1.0.0.xsd">
<thing-type uid="keba:kecontact">
<instruction-set targetVersion="1">
<remove-channel id="enabled"/>
<add-channel id="enabledsystem">
<type>keba:enabledsystem</type>
</add-channel>
<add-channel id="enableduser">
<type>keba:enableduser</type>
</add-channel>
</instruction-set>
</thing-type>
</update:update-descriptions>