]> git.basschouten.com Git - openhab-addons.git/commitdiff
fix #14898 caused by easee API changes (#14903)
authoralexf2015 <alexf2015@users.noreply.github.com>
Sat, 29 Apr 2023 12:55:27 +0000 (14:55 +0200)
committerGitHub <noreply@github.com>
Sat, 29 Apr 2023 12:55:27 +0000 (14:55 +0200)
Signed-off-by: Alexander Friese <af944580@googlemail.com>
bundles/org.openhab.binding.easee/README.md
bundles/org.openhab.binding.easee/src/main/java/org/openhab/binding/easee/internal/EaseeBindingConstants.java
bundles/org.openhab.binding.easee/src/main/java/org/openhab/binding/easee/internal/model/CustomResponseTransformer.java

index 7df0a3c5ac153a4e3e2b1839a8bbe79d4b69f8ea..3df066af4652a28fea412c15d979c92c06f40043 100644 (file)
@@ -60,7 +60,7 @@ The settings that start with "dynamic" can be changed frequently, the others are
 |---------------------------------------------|--------------------------|----------|------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------|
 | state#smartCharging                         | Switch                   | no       |                                                      |                                                                                                                                                              |
 | state#cableLocked                           | Switch                   | no       |                                                      |                                                                                                                                                              |
-| state#chargerOpMode                         | Number                   | no       | 0=Offline, 1=Disconnected, 2=AwaitingStart, 3=Charging, 4=Completed, 5=Error, 6=ReadyToCharge |                                                                                                                                                              |
+| state#chargerOpMode                         | Number                   | no       | 0=Offline, 1=Disconnected, 2=AwaitingStart, 3=Charging, 4=Completed, 5=Error, 6=ReadyToCharge, 7=AwaitingAuthentication, 8=Deauthenticating |                                                                       |
 | state#totalPower                            | Number:Power             | no       | current session total power (all phases)             |                                                                                                                                                              |
 | state#sessionEnergy                         | Number:Energy            | no       | current session                                      |                                                                                                                                                              |
 | state#dynamicCircuitCurrentP1               | Number:ElectricCurrent   | no       |                                                      |                                                                                                                                                              |
@@ -73,7 +73,7 @@ The settings that start with "dynamic" can be changed frequently, the others are
 | state#outputCurrent                         | Number:ElectricCurrent   | no       |                                                      |                                                                                                                                                              |
 | state#isOnline                              | Switch                   | no       |                                                      |                                                                                                                                                              |
 | state#dynamicChargerCurrent                 | Number:ElectricCurrent   | yes      |                                                      | 0, 6-32                                                                                                                                                      |
-| state#reasonForNoCurrent                    | Number                   | no       | 2=NoCurrent, 27=Charging, 52=Paused, 55=NotAuthorized, 79=BatteryFull |                                                                                                                                                              |
+| state#reasonForNoCurrent                    | Number                   | no       | 0=OK, 2=DynamicCircuitCurrentLimitTooLow, 27=DynamicCircuitCurrentCharging, 52=DynamicChargerCurrentLimitTooLow, 55=NotAuthorized, 79=CarLimit, 81=CarLimitedCharging |                                             |
 | state#lifetimeEnergy                        | Number:Energy            | no       |                                                      |                                                                                                                                                              |
 | state#errorCode                             | Number                   | no       |                                                      |                                                                                                                                                              |
 | state#fatalErrorCode                        | Number                   | no       |                                                      |                                                                                                                                                              |
index c2614bc4199acd09c8f4e1f00f395834f2bfdea9..98986905b7aba6715371463c57e2f2a1697e8da6 100644 (file)
@@ -151,9 +151,10 @@ public class EaseeBindingConstants {
     public static final String GENERIC_NO = "No";
     public static final int CHARGER_OP_STATE_WAITING = 2;
     public static final int CHARGER_OP_STATE_CHARGING = 3;
+    public static final int CHARGER_OP_STATE_NOT_AUTHENTICATED = 7;
     public static final double CHARGER_DYNAMIC_CURRENT_PAUSE = 0;
-    public static final int CHARGER_REASON_FOR_NO_CURRENT_DYNAMIC_0KW = 2;
-    public static final int CHARGER_REASON_FOR_NO_CURRENT_PAUSED = 52;
+    public static final int CHARGER_REASON_FOR_NO_CURRENT_CIRCUIT_LIMIT = 2;
+    public static final int CHARGER_REASON_FOR_NO_CURRENT_CHARGER_LIMIT = 52;
 
     public static final String THING_CONFIG_ID = "id";
     public static final String THING_CONFIG_SITE_ID = "siteId";
index f224ace4df1b79e1acc2e517e9294ed6a1afbb04..ebea21f43bf7d5eda554c6f167f2c263fb44c44a 100644 (file)
@@ -82,16 +82,16 @@ class CustomResponseTransformer {
         Channel channel = channelProvider.getChannel(CHANNEL_GROUP_CHARGER_COMMANDS, CHANNEL_CHARGER_START_STOP);
         if (channel != null) {
             int val = Integer.parseInt(value);
-            // state >= 3 will mean charging, ready to charge or charging finished
-            boolean charging = val >= CHARGER_OP_STATE_CHARGING;
+            // state >= 3 && state < 7 will mean charging, ready to charge or charging finished
+            boolean charging = val >= CHARGER_OP_STATE_CHARGING && val < CHARGER_OP_STATE_NOT_AUTHENTICATED;
 
             String rfnc = Utils.getAsString(rawData, CHANNEL_CHARGER_REASON_FOR_NO_CURRENT);
             int reasonForNoCurrent = Integer.valueOf(rfnc == null ? "-1" : rfnc);
             boolean paused = false;
             if (val == CHARGER_OP_STATE_WAITING) {
                 switch (reasonForNoCurrent) {
-                    case CHARGER_REASON_FOR_NO_CURRENT_PAUSED:
-                    case CHARGER_REASON_FOR_NO_CURRENT_DYNAMIC_0KW:
+                    case CHARGER_REASON_FOR_NO_CURRENT_CHARGER_LIMIT:
+                    case CHARGER_REASON_FOR_NO_CURRENT_CIRCUIT_LIMIT:
                         paused = true;
                         break;
                     default: