diff --git a/bundles/org.openhab.binding.juicenet/README.md b/bundles/org.openhab.binding.juicenet/README.md index 0379975822aba..fc727d62f9d4a 100644 --- a/bundles/org.openhab.binding.juicenet/README.md +++ b/bundles/org.openhab.binding.juicenet/README.md @@ -33,7 +33,7 @@ A JuiceBox EV Charger requires a unitID which can also be found in the device se | chargingState | String | N | Current charging state (Start Charging, Smart Charging, Stop Charging). | | state | String | Y | This is the current device state (Available, Plugged-In, Charging, Error, Disconnected). | | message | String | Y | This is a message detailing the state of the EV charger. | -| override | Switch | Y | Smart charging is overridden. | +| override | Switch | N | Smart charging is overridden. Set to "OFF" to remove override. | | chargingTimeLeft | Number:Time | Y | Charging time left (seconds). | | plugUnplugTime | DateTime | Y | Last time of either plug-in or plug-out. | | targetTime | DateTime | N | “Start charging” start time, or time to start when overriding smart charging. | diff --git a/bundles/org.openhab.binding.juicenet/src/main/java/org/openhab/binding/juicenet/internal/api/JuiceNetApi.java b/bundles/org.openhab.binding.juicenet/src/main/java/org/openhab/binding/juicenet/internal/api/JuiceNetApi.java index e9e7ef1516016..29785ddcc74b8 100644 --- a/bundles/org.openhab.binding.juicenet/src/main/java/org/openhab/binding/juicenet/internal/api/JuiceNetApi.java +++ b/bundles/org.openhab.binding.juicenet/src/main/java/org/openhab/binding/juicenet/internal/api/JuiceNetApi.java @@ -156,8 +156,8 @@ public void setOverride(String token, int energy_at_plugin, Long override_time, Map params = new HashMap<>(); params.put("energy_at_plugin", Integer.toString(energy_at_plugin)); - params.put("override_time", Long.toString(energy_at_plugin)); - params.put("energy_to_add", Integer.toString(energy_at_plugin)); + params.put("override_time", Long.toString(override_time)); + params.put("energy_to_add", Integer.toString(energy_to_add)); postApiCommand(ApiCommand.SET_OVERRIDE, token, params); } diff --git a/bundles/org.openhab.binding.juicenet/src/main/java/org/openhab/binding/juicenet/internal/handler/JuiceNetDeviceHandler.java b/bundles/org.openhab.binding.juicenet/src/main/java/org/openhab/binding/juicenet/internal/handler/JuiceNetDeviceHandler.java index 214066ab6b394..aadc5a94162af 100644 --- a/bundles/org.openhab.binding.juicenet/src/main/java/org/openhab/binding/juicenet/internal/handler/JuiceNetDeviceHandler.java +++ b/bundles/org.openhab.binding.juicenet/src/main/java/org/openhab/binding/juicenet/internal/handler/JuiceNetDeviceHandler.java @@ -253,6 +253,13 @@ public void handleCommand(ChannelUID channelUID, Command command) { api.setOverride(Objects.requireNonNull(token), energyAtPlugin, overrideTime, energyToAdd); + break; + } + case CHANNEL_OVERRIDE: { + if (command instanceof OnOffType onOffCommand && OnOffType.OFF.equals(onOffCommand)) { + api.setOverride(Objects.requireNonNull(token), 0, ((long) 0), 0); + } + break; } }