From 3b2663c8af3cfc6a41b7f6acb7dc7f91db8406d1 Mon Sep 17 00:00:00 2001 From: foxxyben Date: Thu, 12 Jan 2017 10:45:45 -0500 Subject: [PATCH] Add presence capability addition will add presence capability that will stay in sync with the contact sensor state --- .../eight-sleep-mattress.src/eight-sleep-mattress.groovy | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/devicetypes/alyc100/eight-sleep-mattress.src/eight-sleep-mattress.groovy b/devicetypes/alyc100/eight-sleep-mattress.src/eight-sleep-mattress.groovy index 5f8642ee880..29396e2981b 100644 --- a/devicetypes/alyc100/eight-sleep-mattress.src/eight-sleep-mattress.groovy +++ b/devicetypes/alyc100/eight-sleep-mattress.src/eight-sleep-mattress.groovy @@ -34,6 +34,7 @@ metadata { capability "Sensor" capability "Switch" capability "Switch Level" + capability "Presence Sensor" command "setHeatDuration" command "heatingDurationDown" @@ -255,10 +256,12 @@ def refresh() { def setInBed() { sendEvent(name: "contact", value: "closed") + sendEvent(name: "presence", value: "present") } def setOutOfBed() { sendEvent(name: "contact", value: "open") + sendEvent(name: "presence", value: "not present") state.sleepPeriod = false state.desiredLevelChange = false } @@ -559,4 +562,4 @@ def getFileBase64(url, preType, fileType) { } } -def cssUrl() { return "https://raw.githubusercontent.com/desertblade/ST-HTMLTile-Framework/master/css/smartthings.css" } \ No newline at end of file +def cssUrl() { return "https://raw.githubusercontent.com/desertblade/ST-HTMLTile-Framework/master/css/smartthings.css" }