diff --git a/bundles/org.openhab.binding.robonect/README.md b/bundles/org.openhab.binding.robonect/README.md
index dfba11834ec..224243bcd5c 100644
--- a/bundles/org.openhab.binding.robonect/README.md
+++ b/bundles/org.openhab.binding.robonect/README.md
@@ -44,28 +44,31 @@ Thing robonect:mower:automower "Mower" @ "Garden" [ host="192.168.2.1", pollInte
## Channels
-| Channel ID | Item Type | Description |
-|------------------------------|-----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
-| `name` | String | Retrieves or sets the name of the mower |
-| `battery` | Number | Retrieves the current battery status in percent |
-| `status-duration` | Number | Retrieves the duration of the current status (see `status`) of the mower |
-| `status-distance` | Number | Retrieves the distance of the mower from the charging station when searching for the remote starting point |
-| `mowing-hours` | Number | Retrieves the number of hours of mowing operation |
-| `mode` | String | Retrieves or sets the mode of the mower. Possible values retrieval values are
HOME
AUTO
MANUAL
EOD : triggers the "end of day" mode. The mower will switch in to the HOME mode and stay int this mode for the rest of the day. After midnight it will switch back to the mode which was set previously.
|
-| `status` | Number | Retrieves the current mower status which can be
0 : DETECTING_STATUS
1 : PARKING
2 : MOWING
3 : SEARCH_CHARGING_STATION
4 : CHARGING
5 : SEARCHING
6 : UNKNOWN_6
7 : ERROR_STATUS
16 : OFF
17 : SLEEPING
98 : OFFLINE (Binding cannot connect to mower)
99 : UNKNOWN
|
-| `start` | Switch | Starts the mower. ON is started (analog to pressing the start button on mower) or OFF (analog to the stop button on mower). |
-| `job` | Switch | Starts a job. The channels can be configured with the three parameters `remoteStart`, `afterMode` and `duration`. `remoteStart` defines the mowing start point with the corresponding options `REMOTE_1`, `REMOTE_2` and `DEFAULT`. `afterMode` is the mode the mower will be set after the job is done. Allowed values are `AUTO`, `HOME` or `EOD`. `duration` is the job duration in minutes. Please note, if the mower is charging it will wait to start the job until it is fully charged, but the jobs duration is already started.|
-| `timer-status` | String | Retrieves the status of the timer which can be
INACTIVE : no timer set
ACTIVE - timer set and currently running
STANDBY - timer set but not triggered/running yet
|
-| `timer-next` | DateTime | Retrieves the Date and Time of the next timer set. This is just valid if there is an ACTIVE timer status (see `timer-status`). |
-| `wlan-signal` | Number | Retrieves the current WLAN Signal strength in dB |
-| `error-code` | Number | The mower manufacturer code in case the mower is in status 7 (error). The binding resets this to UNDEF, once the mower is not in error status anymore. |
-| `error-message` | String | The error message in case the mower is in status 7 (error). The binding resets this to UNDEF, once the mower is not in error status anymore. |
-| `error-date` | DateTime | The date and time the error happened. The binding resets this to UNDEF, once the mower is not in error status anymore. |
-| `last-error-code` | Number | The mower manufacturer code of the last error happened |
-| `last-error-message` | String | The error message of the last error happened |
-| `last-error-date` | DateTime | The date and time of the last error happened |
-| `health-temperature` | Number | The temperature of the mower (just available for robonect firmware >= 1.0) |
-| `health-humidity` | Number | The humidity of the mower (just available for robonect firmware >= 1.0) |
+| Channel ID | Item Type | Description |
+|---------------------------|----------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
+| `name` | String | Retrieves or sets the name of the mower |
+| `battery` | Number | Retrieves the current battery status in percent |
+| `status-duration` | Number | Retrieves the duration of the current status (see `status`) of the mower |
+| `status-distance` | Number | Retrieves the distance of the mower from the charging station when searching for the remote starting point |
+| `mowing-hours` | Number | Retrieves the number of hours of mowing operation |
+| `mode` | String | Retrieves or sets the mode of the mower. Possible values retrieval values are
HOME
AUTO
MANUAL
EOD : triggers the "end of day" mode. The mower will switch in to the HOME mode and stay int this mode for the rest of the day. After midnight it will switch back to the mode which was set previously.
|
+| `status` | Number | Retrieves the current mower status which can be
0 : DETECTING_STATUS
1 : PARKING
2 : MOWING
3 : SEARCH_CHARGING_STATION
4 : CHARGING
5 : SEARCHING
6 : UNKNOWN_6
7 : ERROR_STATUS
16 : OFF
17 : SLEEPING
98 : OFFLINE (Binding cannot connect to mower)
99 : UNKNOWN
|
+| `start` | Switch | Starts the mower. ON is started (analog to pressing the start button on mower) or OFF (analog to the stop button on mower). |
+| `job` | Switch | Starts a job. The channels can be configured with the three parameters `remoteStart`, `afterMode` and `duration`. `remoteStart` defines the mowing start point with the corresponding options `REMOTE_1`, `REMOTE_2` and `DEFAULT`. `afterMode` is the mode the mower will be set after the job is done. Allowed values are `AUTO`, `HOME` or `EOD`. `duration` is the job duration in minutes. Please note, if the mower is charging it will wait to start the job until it is fully charged, but the jobs duration is already started. |
+| `timer-status` | String | Retrieves the status of the timer which can be
INACTIVE : no timer set
ACTIVE - timer set and currently running
STANDBY - timer set but not triggered/running yet
|
+| `timer-next` | DateTime | Retrieves the Date and Time of the next timer set. This is just valid if there is an ACTIVE timer status (see `timer-status`). |
+| `wlan-signal` | Number | Retrieves the current WLAN Signal strength in dB |
+| `error-code` | Number | The mower manufacturer code in case the mower is in status 7 (error). The binding resets this to UNDEF, once the mower is not in error status anymore. |
+| `error-message` | String | The error message in case the mower is in status 7 (error). The binding resets this to UNDEF, once the mower is not in error status anymore. |
+| `error-date` | DateTime | The date and time the error happened. The binding resets this to UNDEF, once the mower is not in error status anymore. |
+| `last-error-code` | Number | The mower manufacturer code of the last error happened |
+| `last-error-message` | String | The error message of the last error happened |
+| `last-error-date` | DateTime | The date and time of the last error happened |
+| `health-temperature` | Number | The temperature of the mower (just available for robonect firmware >= 1.0) |
+| `health-humidity` | Number | The humidity of the mower (just available for robonect firmware >= 1.0) |
+| `blades-quality` | Number:Dimensionless | The quality of the blades |
+| `blades-replacement-days` | Number:Time | The number of days since the blades have been changed |
+| `blades-usage-hours` | Number:Time | The usage time in hours of the blades |
### Offline Trigger Channel
@@ -83,20 +86,23 @@ Thing robonect:mower:automower "Mower" @ "Garden" [ host="192.168.2.1", pollInte
Items file `.items`
```java
-String mowerName "Mower name" {channel="robonect:mower:automower:name"}
-Number mowerBattery "Mower battery [%d %%]" {channel="robonect:mower:automower:battery"}
-Number mowerHours "Mower operation hours [%d h]" {channel="robonect:mower:automower:mowing-hours"}
-Number mowerDuration "Duration of current mode" {channel="robonect:mower:automower:status-duration"}
-String mowerMode "Mower mode" {channel="robonect:mower:automower:mode"}
-Number mowerStatus "Mower Status [MAP(robonect_status.map):%s]" {channel="robonect:mower:automower:status"}
-Switch mowerStarted "Mower started" {channel="robonect:mower:automower:started"}
-String mowerTimerStatus "Mower timer status" {channel="robonect:mower:automower:timer-status"}
-DateTime mowerNextTimer "Next timer [%1$td/%1$tm %1$tH:%1$tM]" {channel="robonect:mower:automower:timer-next"}
-Number mowerWlanSignal "WLAN signal [%d dB ]" {channel="robonect:mower:automower:wlan-signal"}
-Switch mowerOneHourJob "Start mowing for one hour from now" {channel="robonect:mower:automower:job",remoteStart=REMOTE_1,afterMode=AUTO,duration=60}
-Number mowerErrorCode "Error code" {channel="robonect:mower:automower:error-code"}
-String mowerErrorMessage "Error message" {channel="robonect:mower:automower:error-message"}
-DateTime mowerErrorDate "Error date [%1$td/%1$tm %1$tH:%1$tM]" {channel="robonect:mower:automower:error-date"}
+String mowerName "Mower name" {channel="robonect:mower:automower:name"}
+Number mowerBattery "Mower battery [%d %%]" {channel="robonect:mower:automower:battery"}
+Number mowerHours "Mower operation hours [%d h]" {channel="robonect:mower:automower:mowing-hours"}
+Number mowerDuration "Duration of current mode" {channel="robonect:mower:automower:status-duration"}
+String mowerMode "Mower mode" {channel="robonect:mower:automower:mode"}
+Number mowerStatus "Mower Status [MAP(robonect_status.map):%s]" {channel="robonect:mower:automower:status"}
+Switch mowerStarted "Mower started" {channel="robonect:mower:automower:started"}
+String mowerTimerStatus "Mower timer status" {channel="robonect:mower:automower:timer-status"}
+DateTime mowerNextTimer "Next timer [%1$td/%1$tm %1$tH:%1$tM]" {channel="robonect:mower:automower:timer-next"}
+Number mowerWlanSignal "WLAN signal [%d dB ]" {channel="robonect:mower:automower:wlan-signal"}
+Switch mowerOneHourJob "Start mowing for one hour from now" {channel="robonect:mower:automower:job",remoteStart=REMOTE_1,afterMode=AUTO,duration=60}
+Number mowerErrorCode "Error code" {channel="robonect:mower:automower:error-code"}
+String mowerErrorMessage "Error message" {channel="robonect:mower:automower:error-message"}
+DateTime mowerErrorDate "Error date [%1$td/%1$tm %1$tH:%1$tM]" {channel="robonect:mower:automower:error-date"}
+Number:Dimensionless mowerBladesQuality "Blades quality [%d %%]" {channel="robonect:mower:automower:blades-quality"}
+Number:Time mowerBladesDays "Days since last blade change [%d d]" {channel="robonect:mower:automower:blades-replacement-days"}
+Number:Time mowerBladesHours "Blades usage in hours [%d h]" {channel="robonect:mower:automower:blades-usage-hours"}
```
Map transformation for mower status (`robonect_status.map`)
diff --git a/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/RobonectBindingConstants.java b/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/RobonectBindingConstants.java
index 81535a0ad7a..3ac30d4d426 100644
--- a/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/RobonectBindingConstants.java
+++ b/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/RobonectBindingConstants.java
@@ -54,6 +54,10 @@ public class RobonectBindingConstants {
public static final String CHANNEL_HEALTH_TEMP = "health-temperature";
public static final String CHANNEL_HEALTH_HUM = "health-humidity";
+ public static final String CHANNEL_BLADES_QUALITY = "blades-quality";
+ public static final String CHANNEL_BLADES_REPL_DAYS = "blades-replacement-days";
+ public static final String CHANNEL_BLADES_USAGE_HOURS = "blades-usage-hours";
+
public static final String PROPERTY_COMPILED = "compiled";
public static final String PROPERTY_COMMENT = "comment";
}
diff --git a/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/handler/RobonectHandler.java b/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/handler/RobonectHandler.java
index 36618ffb542..ad6090c9e99 100644
--- a/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/handler/RobonectHandler.java
+++ b/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/handler/RobonectHandler.java
@@ -248,6 +248,11 @@ public class RobonectHandler extends BaseThingHandler {
new QuantityType<>(info.getHealth().getTemperature(), SIUnits.CELSIUS));
updateState(CHANNEL_HEALTH_HUM, new QuantityType<>(info.getHealth().getHumidity(), Units.PERCENT));
}
+ if (info.getBlades() != null) {
+ updateState(CHANNEL_BLADES_QUALITY, new QuantityType<>(info.getBlades().getQuality(), Units.PERCENT));
+ updateState(CHANNEL_BLADES_REPL_DAYS, new QuantityType<>(info.getBlades().getDays(), Units.DAY));
+ updateState(CHANNEL_BLADES_USAGE_HOURS, new QuantityType<>(info.getBlades().getHours(), Units.HOUR));
+ }
if (info.getTimer() != null) {
if (info.getTimer().getNext() != null) {
updateNextTimer(info);
diff --git a/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/model/Blades.java b/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/model/Blades.java
new file mode 100644
index 00000000000..106a3c3486f
--- /dev/null
+++ b/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/model/Blades.java
@@ -0,0 +1,51 @@
+/**
+ * Copyright (c) 2010-2024 Contributors to the openHAB project
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.openhab.binding.robonect.internal.model;
+
+import org.eclipse.jdt.annotation.NonNullByDefault;
+
+/**
+ * Blade information from the mower.
+ *
+ * @author Christian Jonak-Moechel - Initial contribution
+ */
+@NonNullByDefault
+public class Blades {
+
+ private int quality;
+
+ private int hours;
+
+ private int days;
+
+ /**
+ * @return - the quality of the blades in %.
+ */
+ public int getQuality() {
+ return quality;
+ }
+
+ /**
+ * @return - the hours of how many days the blades have been actively in use
+ */
+ public int getHours() {
+ return hours;
+ }
+
+ /**
+ * @return - the days since the blades have been changed the last time
+ */
+ public int getDays() {
+ return days;
+ }
+}
diff --git a/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/model/MowerInfo.java b/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/model/MowerInfo.java
index c706b05c043..ceae55083ac 100644
--- a/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/model/MowerInfo.java
+++ b/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/model/MowerInfo.java
@@ -15,7 +15,7 @@ package org.openhab.binding.robonect.internal.model;
/**
* The mower information holds the main information from the majority of the available channels. This class is a POJO
* to deserialize the JSON response from the module.
- *
+ *
* @author Marco Meyer - Initial contribution
*/
public class MowerInfo extends RobonectAnswer {
@@ -25,6 +25,7 @@ public class MowerInfo extends RobonectAnswer {
private Timer timer;
private Wlan wlan;
private Health health;
+ private Blades blades;
private ErrorEntry error;
/**
@@ -69,6 +70,13 @@ public class MowerInfo extends RobonectAnswer {
return health;
}
+ /**
+ * @return - the blades status information.
+ */
+ public Blades getBlades() {
+ return blades;
+ }
+
public void setName(String name) {
this.name = name;
}
@@ -89,6 +97,10 @@ public class MowerInfo extends RobonectAnswer {
this.health = health;
}
+ public void setBlades(Blades blades) {
+ this.blades = blades;
+ }
+
public void setError(ErrorEntry error) {
this.error = error;
}
diff --git a/bundles/org.openhab.binding.robonect/src/main/resources/OH-INF/i18n/robonect.properties b/bundles/org.openhab.binding.robonect/src/main/resources/OH-INF/i18n/robonect.properties
index 0c482600c8c..47b51900102 100644
--- a/bundles/org.openhab.binding.robonect/src/main/resources/OH-INF/i18n/robonect.properties
+++ b/bundles/org.openhab.binding.robonect/src/main/resources/OH-INF/i18n/robonect.properties
@@ -31,6 +31,12 @@ thing-type.config.robonect.mower.user.description = The user id if authenticatio
# channel types
+channel-type.robonect.blades-quality.label = Blade Quality
+channel-type.robonect.blades-quality.description = The quality of the blades
+channel-type.robonect.blades-replacement-days.label = Blade In Use Days
+channel-type.robonect.blades-replacement-days.description = The number of days since the blades have been replaced
+channel-type.robonect.blades-usage-hours.label = Blade Usage Hours
+channel-type.robonect.blades-usage-hours.description = The usage time in hours of the blades
channel-type.robonect.commentType.label = Robonect Firmware Comment
channel-type.robonect.compiledType.label = Robonect Version
channel-type.robonect.distanceType.label = Status Distance
diff --git a/bundles/org.openhab.binding.robonect/src/main/resources/OH-INF/thing/thing-types.xml b/bundles/org.openhab.binding.robonect/src/main/resources/OH-INF/thing/thing-types.xml
index a38abbde57c..12fc96b076c 100644
--- a/bundles/org.openhab.binding.robonect/src/main/resources/OH-INF/thing/thing-types.xml
+++ b/bundles/org.openhab.binding.robonect/src/main/resources/OH-INF/thing/thing-types.xml
@@ -45,6 +45,10 @@
+
+
+
+
@@ -52,6 +56,7 @@
N/AN/AN/A
+ 1
@@ -155,6 +160,27 @@
+
+ Number:Dimensionless
+
+ The quality of the blades
+
+
+
+
+ Number:Time
+
+ The usage time in hours of the blades
+
+
+
+
+ Number:Time
+
+ The number of days since the blades have been replaced
+
+
+
String
diff --git a/bundles/org.openhab.binding.robonect/src/main/resources/OH-INF/update/instructions.xml b/bundles/org.openhab.binding.robonect/src/main/resources/OH-INF/update/instructions.xml
new file mode 100644
index 00000000000..6fa139e15c2
--- /dev/null
+++ b/bundles/org.openhab.binding.robonect/src/main/resources/OH-INF/update/instructions.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+ robonect:blades-quality
+
+
+ robonect:blades-usage-hours
+
+
+ robonect:blades-replacement-days
+
+
+
+
+
diff --git a/bundles/org.openhab.binding.robonect/src/test/java/org/openhab/binding/robonect/internal/model/ModelParserTest.java b/bundles/org.openhab.binding.robonect/src/test/java/org/openhab/binding/robonect/internal/model/ModelParserTest.java
index dfaf18fd87b..2f63210122f 100644
--- a/bundles/org.openhab.binding.robonect/src/test/java/org/openhab/binding/robonect/internal/model/ModelParserTest.java
+++ b/bundles/org.openhab.binding.robonect/src/test/java/org/openhab/binding/robonect/internal/model/ModelParserTest.java
@@ -79,7 +79,7 @@ public class ModelParserTest {
@Test
public void shouldParseCorrectStatusModelWithHealth() {
- String correctModel = "{ \"successful\": true, \"name\": \"Rosenlund Automower\", \"status\": { \"status\": 4, \"stopped\": false, \"duration\": 47493, \"mode\": 0, \"battery\": 20, \"hours\": 991 }, \"timer\": { \"status\": 2, \"next\": { \"date\": \"30.07.2017\", \"time\": \"13:00:00\", \"unix\": 1501419600 } }, \"wlan\": { \"signal\": -66 }, \"health\": { \"temperature\": 28, \"humidity\": 32 } }";
+ String correctModel = "{ \"successful\": true, \"name\": \"Rosenlund Automower\", \"status\": { \"status\": 4, \"stopped\": false, \"duration\": 47493, \"mode\": 0, \"battery\": 20, \"hours\": 991 }, \"timer\": { \"status\": 2, \"next\": { \"date\": \"30.07.2017\", \"time\": \"13:00:00\", \"unix\": 1501419600 } }, \"blades\": {\"quality\": 9, \"hours\": 183, \"days\": 76}, \"wlan\": { \"signal\": -66 }, \"health\": { \"temperature\": 28, \"humidity\": 32 } }";
MowerInfo mowerInfo = subject.parse(correctModel, MowerInfo.class);
assertTrue(mowerInfo.isSuccessful());
assertEquals("Rosenlund Automower", mowerInfo.getName());
@@ -98,6 +98,9 @@ public class ModelParserTest {
assertNotNull(mowerInfo.getHealth());
assertEquals(28, mowerInfo.getHealth().getTemperature());
assertEquals(32, mowerInfo.getHealth().getHumidity());
+ assertEquals(9, mowerInfo.getBlades().getQuality());
+ assertEquals(76, mowerInfo.getBlades().getDays());
+ assertEquals(183, mowerInfo.getBlades().getHours());
// "health": { "temperature": 28, "humidity": 32 }
}