[robonect] Channel for distance from charging station on remote start (#11137)
New channel "status-distance" that shows the distance of the robot from its charging station while it is searching for the remote starting point. Signed-off-by: Stefan Triller <github@stefantriller.de>pull/11145/head
parent
02d8e43d37
commit
b6aa401cf9
|
@ -49,7 +49,8 @@ Thing robonect:mower:automower "Mower" @ "Garden" [ host="192.168.2.1", pollInte
|
|||
|------------------------------|-----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| `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-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> |
|
||||
|
|
|
@ -31,6 +31,7 @@ public class RobonectBindingConstants {
|
|||
public static final String CHANNEL_MOWER_NAME = "name";
|
||||
public static final String CHANNEL_STATUS_BATTERY = "battery";
|
||||
public static final String CHANNEL_STATUS_DURATION = "status-duration";
|
||||
public static final String CHANNEL_STATUS_DISTANCE = "status-distance";
|
||||
public static final String CHANNEL_STATUS_HOURS = "mowing-hours";
|
||||
public static final String CHANNEL_STATUS_MODE = "mode";
|
||||
public static final String CHANNEL_STATUS = "status";
|
||||
|
|
|
@ -236,6 +236,7 @@ public class RobonectHandler extends BaseThingHandler {
|
|||
updateState(CHANNEL_STATUS_BATTERY, new DecimalType(info.getStatus().getBattery()));
|
||||
updateState(CHANNEL_STATUS, new DecimalType(info.getStatus().getStatus().getStatusCode()));
|
||||
updateState(CHANNEL_STATUS_DURATION, new QuantityType<>(info.getStatus().getDuration(), Units.SECOND));
|
||||
updateState(CHANNEL_STATUS_DISTANCE, new QuantityType<>(info.getStatus().getDistance(), SIUnits.METRE));
|
||||
updateState(CHANNEL_STATUS_HOURS, new QuantityType<>(info.getStatus().getHours(), Units.HOUR));
|
||||
updateState(CHANNEL_STATUS_MODE, new StringType(info.getStatus().getMode().name()));
|
||||
updateState(CHANNEL_MOWER_START, info.getStatus().isStopped() ? OnOffType.OFF : OnOffType.ON);
|
||||
|
|
|
@ -14,7 +14,7 @@ package org.openhab.binding.robonect.internal.model;
|
|||
|
||||
/**
|
||||
* Object holding information from the status section of the mowers status response.
|
||||
*
|
||||
*
|
||||
* @author Marco Meyer - Initial contribution
|
||||
*/
|
||||
public class Status {
|
||||
|
@ -25,6 +25,7 @@ public class Status {
|
|||
private MowerStatus status;
|
||||
private MowerMode mode;
|
||||
private boolean stopped;
|
||||
private int distance;
|
||||
|
||||
/**
|
||||
* @return - the battery level in percent. (0-100)
|
||||
|
@ -40,6 +41,13 @@ public class Status {
|
|||
return duration;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return - The distance from the charging station (in case it searches the remote starting point)
|
||||
*/
|
||||
public int getDistance() {
|
||||
return distance;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return - The hours the mower was in use so far.
|
||||
*/
|
||||
|
@ -76,6 +84,10 @@ public class Status {
|
|||
this.duration = duration;
|
||||
}
|
||||
|
||||
public void setDistance(int distance) {
|
||||
this.distance = distance;
|
||||
}
|
||||
|
||||
public void setHours(int hours) {
|
||||
this.hours = hours;
|
||||
}
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
<channel id="start" typeId="startType"/>
|
||||
<channel id="status" typeId="mowerStatusType"/>
|
||||
<channel id="status-duration" typeId="durationType"/>
|
||||
<channel id="status-distance" typeId="distanceType"/>
|
||||
|
||||
<channel id="timer-status" typeId="timerStatusType"/>
|
||||
<channel id="timer-next" typeId="nextTimerType"/>
|
||||
|
@ -126,6 +127,13 @@
|
|||
<state readOnly="true" pattern="%d %unit%"/>
|
||||
</channel-type>
|
||||
|
||||
<channel-type id="distanceType">
|
||||
<item-type>Number:Length</item-type>
|
||||
<label>Status Distance</label>
|
||||
<description>The distance the mower is away from the charging station when searching the remote start.</description>
|
||||
<state readOnly="true" pattern="%d %unit%"/>
|
||||
</channel-type>
|
||||
|
||||
<channel-type id="hoursType">
|
||||
<item-type>Number:Time</item-type>
|
||||
<label>Total Mowing Hours</label>
|
||||
|
|
Loading…
Reference in New Issue