diff --git a/bundles/org.openhab.binding.goecharger/README.md b/bundles/org.openhab.binding.goecharger/README.md index 71abd5d531c6e..ec59184e444e4 100644 --- a/bundles/org.openhab.binding.goecharger/README.md +++ b/bundles/org.openhab.binding.goecharger/README.md @@ -27,35 +27,37 @@ The apiVersion 2 is only available for go-e Charger with new hardware revision ( ## Channels -Currently available channels are -| Channel ID | Item Type | Description | API version | -|--------------------------|--------------------------|---------------------------------------------------------------|-------------------| -| maxCurrent | Number:ElectricCurrent | Maximum current allowed to use for charging | 1 (r/w), 2 (r/w) | -| maxCurrentTemp | Number:ElectricCurrent | Maximum current temporary (not written to EEPROM) | 1 (r) | -| pwmSignal | String | Signal status for PWM signal | 1 (r), 2 (r) | -| error | String | Error code of charger | 1 (r), 2 (r) | -| voltageL1 | Number:ElectricPotential | Voltage on L1 | 1 (r), 2 (r) | -| voltageL2 | Number:ElectricPotential | Voltage on L2 | 1 (r), 2 (r) | -| voltageL3 | Number:ElectricPotential | Voltage on L3 | 1 (r), 2 (r) | -| currentL1 | Number:ElectricCurrent | Current on L1 | 1 (r), 2 (r) | -| currentL2 | Number:ElectricCurrent | Current on L2 | 1 (r), 2 (r) | -| currentL3 | Number:ElectricCurrent | Current on L3 | 1 (r), 2 (r) | -| powerL1 | Number:Power | Power on L1 | 1 (r), 2 (r) | -| powerL2 | Number:Power | Power on L2 | 1 (r), 2 (r) | -| powerL3 | Number:Power | Power on L2 | 1 (r), 2 (r) | -| powerAll | Number:Power | Power over all three phases | 1 (r), 2 (r) | -| phases | Number | Amount of phases currently used for charging | 1 (r), 2 (r/w) | -| sessionChargeEnergyLimit | Number:Energy | Wallbox stops charging after defined value, disable with 0 | 1 (r/w), 2 (r/w) | -| sessionChargedEnergy | Number:Energy | Amount of energy that has been charged in this session | 1 (r), 2 (r) | -| totalChargedEnergy | Number:Energy | Amount of energy that has been charged since installation | 1 (r), 2 (r) | -| transaction | Number | 0 if no card, otherwise card ID | 2 (r/w) | -| allowCharging | Switch | If `ON` charging is allowed | 1 (r/w), 2 (r) | -| cableCurrent | Number:ElectricCurrent | Specifies the max current that can be charged with that cable | 1 (r), 2 (r) | -| temperature | Number:Temperature | Temperature of the curciuit board of the go-e Charger | 1 (r), 2 (r) | -| temperatureType2Port | Number:Temperature | Temperature of the type 2 port of the go-e Charger | 2 (r) | -| firmware | String | Firmware Version | 1 (r), 2 (r) | -| accessConfiguration | String | Access configuration, for example OPEN, RFID ... | 1 (r/w) | -| forceState | Number | Force state (Neutral=0, Off=1, On=2) | 2 (r/w) | +Currently available channels are: + +| Channel ID | Item Type | Description | API version | +|--------------------------|--------------------------|---------------------------------------------------------------|------------------| +| maxCurrent | Number:ElectricCurrent | Maximum current allowed to use for charging | 1 (r/w), 2 (r/w) | +| maxCurrentTemp | Number:ElectricCurrent | Maximum current temporary (not written to EEPROM) | 1 (r) | +| pwmSignal | String | Signal status for PWM signal | 1 (r), 2 (r) | +| error | String | Error code of charger | 1 (r), 2 (r) | +| voltageL1 | Number:ElectricPotential | Voltage on L1 | 1 (r), 2 (r) | +| voltageL2 | Number:ElectricPotential | Voltage on L2 | 1 (r), 2 (r) | +| voltageL3 | Number:ElectricPotential | Voltage on L3 | 1 (r), 2 (r) | +| currentL1 | Number:ElectricCurrent | Current on L1 | 1 (r), 2 (r) | +| currentL2 | Number:ElectricCurrent | Current on L2 | 1 (r), 2 (r) | +| currentL3 | Number:ElectricCurrent | Current on L3 | 1 (r), 2 (r) | +| powerL1 | Number:Power | Power on L1 | 1 (r), 2 (r) | +| powerL2 | Number:Power | Power on L2 | 1 (r), 2 (r) | +| powerL3 | Number:Power | Power on L2 | 1 (r), 2 (r) | +| powerAll | Number:Power | Power over all three phases | 1 (r), 2 (r) | +| phases | Number | Amount of phases currently used for charging | 1 (r), 2 (r/w) | +| sessionChargeEnergyLimit | Number:Energy | Wallbox stops charging after defined value, disable with 0 | 1 (r/w), 2 (r/w) | +| sessionChargedEnergy | Number:Energy | Amount of energy that has been charged in this session | 1 (r), 2 (r) | +| totalChargedEnergy | Number:Energy | Amount of energy that has been charged since installation | 1 (r), 2 (r) | +| transaction | Number | 0 if no card, otherwise card ID | 2 (r/w) | +| allowCharging | Switch | If `ON` charging is allowed | 1 (r/w), 2 (r) | +| cableCurrent | Number:ElectricCurrent | Specifies the max current that can be charged with that cable | 1 (r), 2 (r) | +| temperature | Number:Temperature | Temperature of the curciuit board of the go-e Charger | 1 (r), 2 (r) | +| temperatureType2Port | Number:Temperature | Temperature of the type 2 port of the go-e Charger | 2 (r) | +| firmware | String | Firmware Version | 1 (r), 2 (r) | +| accessConfiguration | String | Access configuration, for example OPEN, RFID ... | 1 (r/w) | +| forceState | Number | Force state (Neutral=0, Off=1, On=2) | 2 (r/w) | +| awattarMaxPrice | Number | Awattar Max Price in ct | 2 (r/w) | ## Full Example diff --git a/bundles/org.openhab.binding.goecharger/src/main/java/org/openhab/binding/goecharger/internal/GoEChargerBindingConstants.java b/bundles/org.openhab.binding.goecharger/src/main/java/org/openhab/binding/goecharger/internal/GoEChargerBindingConstants.java index c3e451564fdba..56952f50cead4 100644 --- a/bundles/org.openhab.binding.goecharger/src/main/java/org/openhab/binding/goecharger/internal/GoEChargerBindingConstants.java +++ b/bundles/org.openhab.binding.goecharger/src/main/java/org/openhab/binding/goecharger/internal/GoEChargerBindingConstants.java @@ -55,6 +55,7 @@ public class GoEChargerBindingConstants { public static final String SESSION_CHARGE_CONSUMPTION_LIMIT = "sessionChargeEnergyLimit"; public static final String TOTAL_CONSUMPTION = "totalChargedEnergy"; public static final String FIRMWARE = "firmware"; + public static final String AWATTAR_MAX_PRICE = "awattarMaxPrice"; public static final String API_URL = "http://%IP%/status"; public static final String MQTT_URL = "http://%IP%/mqtt?payload=%KEY%=%VALUE%"; diff --git a/bundles/org.openhab.binding.goecharger/src/main/java/org/openhab/binding/goecharger/internal/api/GoEStatusResponseV2DTO.java b/bundles/org.openhab.binding.goecharger/src/main/java/org/openhab/binding/goecharger/internal/api/GoEStatusResponseV2DTO.java index 996eff9e1a078..20033b8286151 100644 --- a/bundles/org.openhab.binding.goecharger/src/main/java/org/openhab/binding/goecharger/internal/api/GoEStatusResponseV2DTO.java +++ b/bundles/org.openhab.binding.goecharger/src/main/java/org/openhab/binding/goecharger/internal/api/GoEStatusResponseV2DTO.java @@ -47,4 +47,7 @@ public class GoEStatusResponseV2DTO extends GoEStatusResponseBaseDTO { @SerializedName("nrg") public Double[] energy; + + @SerializedName("awp") + public Double awattarMaxPrice; } diff --git a/bundles/org.openhab.binding.goecharger/src/main/java/org/openhab/binding/goecharger/internal/handler/GoEChargerV2Handler.java b/bundles/org.openhab.binding.goecharger/src/main/java/org/openhab/binding/goecharger/internal/handler/GoEChargerV2Handler.java index 248bc9498325e..afb72eecbc7b9 100644 --- a/bundles/org.openhab.binding.goecharger/src/main/java/org/openhab/binding/goecharger/internal/handler/GoEChargerV2Handler.java +++ b/bundles/org.openhab.binding.goecharger/src/main/java/org/openhab/binding/goecharger/internal/handler/GoEChargerV2Handler.java @@ -142,6 +142,11 @@ protected State getValue(String channelId, GoEStatusResponseBaseDTO goeResponseB return UnDefType.UNDEF; } return new DecimalType(goeResponse.transaction); + case AWATTAR_MAX_PRICE: + if (goeResponse.awattarMaxPrice == null) { + return UnDefType.UNDEF; + } + return new DecimalType(goeResponse.awattarMaxPrice); case ALLOW_CHARGING: return OnOffType.from(goeResponse.allowCharging); case TEMPERATURE_TYPE2_PORT: @@ -250,6 +255,12 @@ public void handleCommand(ChannelUID channelUID, Command command) { value = String.valueOf(((QuantityType) command).toUnit(Units.AMPERE).intValue()); } break; + case AWATTAR_MAX_PRICE: + key = "awp"; + if (command instanceof DecimalType decimalCommand) { + value = String.valueOf(decimalCommand); + } + break; case SESSION_CHARGE_CONSUMPTION_LIMIT: key = "dwo"; var multiplier = 1000; diff --git a/bundles/org.openhab.binding.goecharger/src/main/resources/OH-INF/i18n/goecharger.properties b/bundles/org.openhab.binding.goecharger/src/main/resources/OH-INF/i18n/goecharger.properties index 992fcfe4e0bb0..bdfab6343f4ef 100644 --- a/bundles/org.openhab.binding.goecharger/src/main/resources/OH-INF/i18n/goecharger.properties +++ b/bundles/org.openhab.binding.goecharger/src/main/resources/OH-INF/i18n/goecharger.properties @@ -19,8 +19,6 @@ thing-type.config.goecharger.goe.refreshInterval.description = Refresh interval # channel types -channel-type.goecharger.trx.label = Transaction -channel-type.goecharger.trx.description = 0 for no card, otherwise card ID channel-type.goecharger.alw.label = Allow Charging channel-type.goecharger.alw.description = If true charging is allowed channel-type.goecharger.ast.label = Access Configuration @@ -29,6 +27,7 @@ channel-type.goecharger.ast.state.option.OPEN = Open channel-type.goecharger.ast.state.option.RFID = RFID channel-type.goecharger.ast.state.option.TIMER = Timer channel-type.goecharger.ast.state.option.AWATTAR = aWATTar +channel-type.goecharger.awp.label = Awatttar Max Price channel-type.goecharger.cbl.label = Cable Encoding channel-type.goecharger.cbl.description = Specifies the max amps that can be charged with that cable channel-type.goecharger.cl1.label = Current L1 @@ -77,6 +76,8 @@ channel-type.goecharger.tmp.label = Temperature circuit board channel-type.goecharger.tmp.description = Temperature of the Go-eCharger on circuit board channel-type.goecharger.tmpT2p.label = Temperature type 2 port channel-type.goecharger.tmpT2p.description = Temperature of the Go-eCharger on the type 2 port +channel-type.goecharger.trx.label = Transaction +channel-type.goecharger.trx.description = 0 for no card, otherwise card ID channel-type.goecharger.vl1.label = Voltage L1 channel-type.goecharger.vl1.description = Voltage on L1 channel-type.goecharger.vl2.label = Voltage L2 diff --git a/bundles/org.openhab.binding.goecharger/src/main/resources/OH-INF/thing/thing-types.xml b/bundles/org.openhab.binding.goecharger/src/main/resources/OH-INF/thing/thing-types.xml index 4fbb56988c618..fbb751577ddec 100644 --- a/bundles/org.openhab.binding.goecharger/src/main/resources/OH-INF/thing/thing-types.xml +++ b/bundles/org.openhab.binding.goecharger/src/main/resources/OH-INF/thing/thing-types.xml @@ -9,6 +9,7 @@ Go-eCharger thing that represents the wallbox configuration and readings + @@ -37,6 +38,10 @@ + + 1 + + @@ -178,6 +183,11 @@ Force state (Neutral=0, Off=1, On=2) + + Number + + + Number:Energy diff --git a/bundles/org.openhab.binding.goecharger/src/main/resources/OH-INF/update/upgrade.xml b/bundles/org.openhab.binding.goecharger/src/main/resources/OH-INF/update/upgrade.xml new file mode 100644 index 0000000000000..6199f88dbbd2b --- /dev/null +++ b/bundles/org.openhab.binding.goecharger/src/main/resources/OH-INF/update/upgrade.xml @@ -0,0 +1,14 @@ + + + + + + + goecharger:awp + + + + +