## 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 <ul><li>HOME</li><li>AUTO</li><li>MANUAL</li><li>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.</li></ul> |
-| `status` | Number | Retrieves the current mower status which can be <ul><li>0 : DETECTING_STATUS</li><li>1 : PARKING</li><li>2 : MOWING</li><li>3 : SEARCH_CHARGING_STATION</li><li>4 : CHARGING</li><li>5 : SEARCHING</li><li>6 : UNKNOWN_6</li><li>7 : ERROR_STATUS</li><li>16 : OFF</li><li>17 : SLEEPING</li><li>98 : OFFLINE (Binding cannot connect to mower)</li><li>99 : UNKNOWN</li></ul> |
-| `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 <ul><li>INACTIVE : no timer set</li><li>ACTIVE - timer set and currently running</li><li>STANDBY - timer set but not triggered/running yet</li></ul> |
-| `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 <ul><li>HOME</li><li>AUTO</li><li>MANUAL</li><li>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.</li></ul> |
+| `status` | Number | Retrieves the current mower status which can be <ul><li>0 : DETECTING_STATUS</li><li>1 : PARKING</li><li>2 : MOWING</li><li>3 : SEARCH_CHARGING_STATION</li><li>4 : CHARGING</li><li>5 : SEARCHING</li><li>6 : UNKNOWN_6</li><li>7 : ERROR_STATUS</li><li>16 : OFF</li><li>17 : SLEEPING</li><li>98 : OFFLINE (Binding cannot connect to mower)</li><li>99 : UNKNOWN</li></ul> |
+| `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 <ul><li>INACTIVE : no timer set</li><li>ACTIVE - timer set and currently running</li><li>STANDBY - timer set but not triggered/running yet</li></ul> |
+| `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
Items file `.items`
```java
-String mowerName "Mower name" {channel="robonect:mower:automower:name"}
-Number mowerBattery "Mower battery [%d %%]" <energy> {channel="robonect:mower:automower:battery"}
-Number mowerHours "Mower operation hours [%d h]" <clock> {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]" <clock> {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 %%]" <energy> {channel="robonect:mower:automower:battery"}
+Number mowerHours "Mower operation hours [%d h]" <clock> {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]" <clock> {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`)
<channel id="health-temperature" typeId="temperatureType"/>
<channel id="health-humidity" typeId="humidityType"/>
+
+ <channel id="blades-quality" typeId="blades-quality"/>
+ <channel id="blades-replacement-days" typeId="blades-replacement-days"/>
+ <channel id="blades-usage-hours" typeId="blades-usage-hours"/>
</channels>
<properties>
<property name="firmwareVersion">N/A</property>
<property name="compiled">N/A</property>
<property name="serialNumber">N/A</property>
+ <property name="thingTypeVersion">1</property>
</properties>
<config-description>
<state readOnly="true" pattern="%d %%"/>
</channel-type>
+ <channel-type id="blades-quality">
+ <item-type unitHint="%">Number:Dimensionless</item-type>
+ <label>Blade Quality</label>
+ <description>The quality of the blades</description>
+ <state readOnly="true" pattern="%d %%"/>
+ </channel-type>
+
+ <channel-type id="blades-usage-hours">
+ <item-type unitHint="h">Number:Time</item-type>
+ <label>Blade Usage Hours</label>
+ <description>The usage time in hours of the blades</description>
+ <state readOnly="true" pattern="%d %unit%"/>
+ </channel-type>
+
+ <channel-type id="blades-replacement-days">
+ <item-type unitHint="d">Number:Time</item-type>
+ <label>Blade In Use Days</label>
+ <description>The number of days since the blades have been replaced</description>
+ <state readOnly="true" pattern="%d %unit%"/>
+ </channel-type>
+
<channel-type id="modeType">
<item-type>String</item-type>
<label>Mower Mode</label>
@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());
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 }
}