diff --git a/devicetypes/ady624/webcore-presence-sensor.src/webcore-presence-sensor.groovy b/devicetypes/ady624/webcore-presence-sensor.src/webcore-presence-sensor.groovy index 2d9409df..34c85eb4 100644 --- a/devicetypes/ady624/webcore-presence-sensor.src/webcore-presence-sensor.groovy +++ b/devicetypes/ady624/webcore-presence-sensor.src/webcore-presence-sensor.groovy @@ -69,6 +69,8 @@ metadata { attribute "bearing", "Number" command "asleep" command "awake" + command "arrived" + command "departed" command "toggleSleeping" } @@ -482,6 +484,14 @@ def awake() { toggleSleeping('not sleeping') } +def arrived() { + sendEvent(name: "presence", value: "present") +} + +def departed() { + sendEvent(name: "presence", value: "not present") +} + private formatLocalTime(format = "EEE, MMM d yyyy @ h:mm:ss a z", time = now()) { def formatter = new java.text.SimpleDateFormat(format) formatter.setTimeZone(location.timeZone)