mirror of
https://github.com/mtan93/SmartThingsPublic.git
synced 2026-03-30 14:13:06 +01:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5c13794cf8 |
@@ -52,9 +52,6 @@ hipchatShareFile {
|
|||||||
hipchatSendNotification {
|
hipchatSendNotification {
|
||||||
String branch = project.hasProperty('branch') ? project.property('branch') : 'unknown'
|
String branch = project.hasProperty('branch') ? project.property('branch') : 'unknown'
|
||||||
message = "Began executable deploy of SmartThingsPublic(${branch})."
|
message = "Began executable deploy of SmartThingsPublic(${branch})."
|
||||||
if (branch == 'master') {
|
|
||||||
message += ' (dev shards)'
|
|
||||||
}
|
|
||||||
color = branch == 'master' ? 'yellow' : 'red'
|
color = branch == 'master' ? 'yellow' : 'red'
|
||||||
notify = true
|
notify = true
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -379,16 +379,12 @@ def getDataByName(String name) {
|
|||||||
state[name] ?: device.getDataValue(name)
|
state[name] ?: device.getDataValue(name)
|
||||||
}
|
}
|
||||||
|
|
||||||
def setThermostatMode(String mode) {
|
def setThermostatMode(String value) {
|
||||||
log.debug "setThermostatMode($mode)"
|
log.debug "setThermostatMode({$value})"
|
||||||
mode = mode.toLowerCase()
|
|
||||||
switchToMode(mode)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
def setThermostatFanMode(String mode) {
|
def setThermostatFanMode(String value) {
|
||||||
log.debug "setThermostatFanMode($mode)"
|
log.debug "setThermostatFanMode({$value})"
|
||||||
mode = mode.toLowerCase()
|
|
||||||
switchToFanMode(mode)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
def generateModeEvent(mode) {
|
def generateModeEvent(mode) {
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
*
|
*
|
||||||
* Author: SmartThings
|
* Author: SmartThings
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// for the UI
|
// for the UI
|
||||||
metadata {
|
metadata {
|
||||||
// Automatically generated. Make future change here.
|
// Automatically generated. Make future change here.
|
||||||
@@ -28,10 +27,10 @@ metadata {
|
|||||||
tiles (scale: 2){
|
tiles (scale: 2){
|
||||||
multiAttributeTile(name:"rich-control", type: "lighting", width: 6, height: 4, canChangeIcon: true){
|
multiAttributeTile(name:"rich-control", type: "lighting", width: 6, height: 4, canChangeIcon: true){
|
||||||
tileAttribute ("device.switch", key: "PRIMARY_CONTROL") {
|
tileAttribute ("device.switch", key: "PRIMARY_CONTROL") {
|
||||||
attributeState "on", label:'${name}', action:"switch.off", icon:"st.lights.philips.hue-single", backgroundColor:"#00A0DC", nextState:"turningOff"
|
attributeState "on", label:'${name}', action:"switch.off", icon:"st.lights.philips.hue-single", backgroundColor:"#79b821", nextState:"turningOff"
|
||||||
attributeState "off", label:'${name}', action:"switch.on", icon:"st.lights.philips.hue-single", backgroundColor:"#C6C7CC", nextState:"turningOn"
|
attributeState "off", label:'${name}', action:"switch.on", icon:"st.lights.philips.hue-single", backgroundColor:"#ffffff", nextState:"turningOn"
|
||||||
attributeState "turningOn", label:'${name}', action:"switch.off", icon:"st.lights.philips.hue-single", backgroundColor:"#00A0DC", nextState:"turningOff"
|
attributeState "turningOn", label:'${name}', action:"switch.off", icon:"st.lights.philips.hue-single", backgroundColor:"#79b821", nextState:"turningOff"
|
||||||
attributeState "turningOff", label:'${name}', action:"switch.on", icon:"st.lights.philips.hue-single", backgroundColor:"#C6C7CC", nextState:"turningOn"
|
attributeState "turningOff", label:'${name}', action:"switch.on", icon:"st.lights.philips.hue-single", backgroundColor:"#ffffff", nextState:"turningOn"
|
||||||
}
|
}
|
||||||
tileAttribute ("device.level", key: "SLIDER_CONTROL") {
|
tileAttribute ("device.level", key: "SLIDER_CONTROL") {
|
||||||
attributeState "level", action:"switch level.setLevel", range:"(0..100)"
|
attributeState "level", action:"switch level.setLevel", range:"(0..100)"
|
||||||
@@ -44,10 +43,16 @@ metadata {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
standardTile("switch", "device.switch", width: 2, height: 2, canChangeIcon: true) {
|
||||||
|
state "on", label:'${name}', action:"switch.off", icon:"st.lights.philips.hue-single", backgroundColor:"#79b821", nextState:"turningOff"
|
||||||
|
state "off", label:'${name}', action:"switch.on", icon:"st.lights.philips.hue-single", backgroundColor:"#ffffff", nextState:"turningOn"
|
||||||
|
state "turningOn", label:'${name}', action:"switch.off", icon:"st.lights.philips.hue-single", backgroundColor:"#79b821", nextState:"turningOff"
|
||||||
|
state "turningOff", label:'${name}', action:"switch.on", icon:"st.lights.philips.hue-single", backgroundColor:"#ffffff", nextState:"turningOn"
|
||||||
|
}
|
||||||
|
|
||||||
controlTile("colorTempSliderControl", "device.colorTemperature", "slider", width: 4, height: 2, inactiveLabel: false, range:"(2000..6500)") {
|
controlTile("colorTempSliderControl", "device.colorTemperature", "slider", width: 4, height: 2, inactiveLabel: false, range:"(2000..6500)") {
|
||||||
state "colorTemperature", action:"color temperature.setColorTemperature"
|
state "colorTemperature", action:"color temperature.setColorTemperature"
|
||||||
}
|
}
|
||||||
|
|
||||||
valueTile("colorTemp", "device.colorTemperature", inactiveLabel: false, decoration: "flat", width: 2, height: 2) {
|
valueTile("colorTemp", "device.colorTemperature", inactiveLabel: false, decoration: "flat", width: 2, height: 2) {
|
||||||
state "colorTemperature", label: '${currentValue} K'
|
state "colorTemperature", label: '${currentValue} K'
|
||||||
}
|
}
|
||||||
@@ -55,12 +60,29 @@ metadata {
|
|||||||
standardTile("reset", "device.reset", height: 2, width: 2, inactiveLabel: false, decoration: "flat") {
|
standardTile("reset", "device.reset", height: 2, width: 2, inactiveLabel: false, decoration: "flat") {
|
||||||
state "default", label:"Reset Color", action:"reset", icon:"st.lights.philips.hue-single"
|
state "default", label:"Reset Color", action:"reset", icon:"st.lights.philips.hue-single"
|
||||||
}
|
}
|
||||||
|
standardTile("refresh", "device.switch", height: 2, width: 2, inactiveLabel: false, decoration: "flat") {
|
||||||
standardTile("refresh", "device.refresh", height: 2, width: 2, inactiveLabel: false, decoration: "flat") {
|
|
||||||
state "default", label:"", action:"refresh.refresh", icon:"st.secondary.refresh"
|
state "default", label:"", action:"refresh.refresh", icon:"st.secondary.refresh"
|
||||||
}
|
}
|
||||||
|
controlTile("levelSliderControl", "device.level", "slider", height: 1, width: 2, inactiveLabel: false, range:"(0..100)") {
|
||||||
|
state "level", action:"switch level.setLevel"
|
||||||
|
}
|
||||||
|
valueTile("level", "device.level", inactiveLabel: false, decoration: "flat") {
|
||||||
|
state "level", label: 'Level ${currentValue}%'
|
||||||
|
}
|
||||||
|
controlTile("saturationSliderControl", "device.saturation", "slider", height: 1, width: 2, inactiveLabel: false) {
|
||||||
|
state "saturation", action:"color control.setSaturation"
|
||||||
|
}
|
||||||
|
valueTile("saturation", "device.saturation", inactiveLabel: false, decoration: "flat") {
|
||||||
|
state "saturation", label: 'Sat ${currentValue} '
|
||||||
|
}
|
||||||
|
controlTile("hueSliderControl", "device.hue", "slider", height: 1, width: 2, inactiveLabel: false) {
|
||||||
|
state "hue", action:"color control.setHue"
|
||||||
|
}
|
||||||
|
valueTile("hue", "device.hue", inactiveLabel: false, decoration: "flat") {
|
||||||
|
state "hue", label: 'Hue ${currentValue} '
|
||||||
|
}
|
||||||
|
|
||||||
main(["rich-control"])
|
main(["switch"])
|
||||||
details(["rich-control", "colorTempSliderControl", "colorTemp", "reset", "refresh"])
|
details(["rich-control", "colorTempSliderControl", "colorTemp", "reset", "refresh"])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -105,34 +127,34 @@ void nextLevel() {
|
|||||||
void setLevel(percent) {
|
void setLevel(percent) {
|
||||||
log.debug "Executing 'setLevel'"
|
log.debug "Executing 'setLevel'"
|
||||||
parent.setLevel(this, percent)
|
parent.setLevel(this, percent)
|
||||||
sendEvent(name: "level", value: percent, descriptionText: "Level has changed to ${percent}%")
|
sendEvent(name: "level", value: percent)
|
||||||
}
|
}
|
||||||
|
|
||||||
void setSaturation(percent) {
|
void setSaturation(percent) {
|
||||||
log.debug "Executing 'setSaturation'"
|
log.debug "Executing 'setSaturation'"
|
||||||
parent.setSaturation(this, percent)
|
parent.setSaturation(this, percent)
|
||||||
sendEvent(name: "saturation", value: percent, displayed: false)
|
sendEvent(name: "saturation", value: percent)
|
||||||
}
|
}
|
||||||
|
|
||||||
void setHue(percent) {
|
void setHue(percent) {
|
||||||
log.debug "Executing 'setHue'"
|
log.debug "Executing 'setHue'"
|
||||||
parent.setHue(this, percent)
|
parent.setHue(this, percent)
|
||||||
sendEvent(name: "hue", value: percent, displayed: false)
|
sendEvent(name: "hue", value: percent)
|
||||||
}
|
}
|
||||||
|
|
||||||
void setColor(value) {
|
void setColor(value) {
|
||||||
log.debug "setColor: ${value}, $this"
|
log.debug "setColor: ${value}, $this"
|
||||||
parent.setColor(this, value)
|
parent.setColor(this, value)
|
||||||
if (value.hue) { sendEvent(name: "hue", value: value.hue, displayed: false)}
|
if (value.hue) { sendEvent(name: "hue", value: value.hue)}
|
||||||
if (value.saturation) { sendEvent(name: "saturation", value: value.saturation, displayed: false)}
|
if (value.saturation) { sendEvent(name: "saturation", value: value.saturation)}
|
||||||
if (value.hex) { sendEvent(name: "color", value: value.hex)}
|
if (value.hex) { sendEvent(name: "color", value: value.hex)}
|
||||||
if (value.level) { sendEvent(name: "level", value: value.level, descriptionText: "Level has changed to ${value.level}%")}
|
if (value.level) { sendEvent(name: "level", value: value.level)}
|
||||||
sendEvent(name: "switch", value: "on")
|
if (value.switch) { sendEvent(name: "switch", value: value.switch)}
|
||||||
}
|
}
|
||||||
|
|
||||||
void reset() {
|
void reset() {
|
||||||
log.debug "Executing 'reset'"
|
log.debug "Executing 'reset'"
|
||||||
def value = [level:100, saturation:56, hue:23]
|
def value = [level:100, hex:"#90C638", saturation:56, hue:23]
|
||||||
setAdjustedColor(value)
|
setAdjustedColor(value)
|
||||||
parent.poll()
|
parent.poll()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,6 +36,13 @@ metadata {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
standardTile("switch", "device.switch", width: 2, height: 2, canChangeIcon: true) {
|
||||||
|
state "on", label:'${name}', action:"switch.off", icon:"st.lights.philips.hue-single", backgroundColor:"#79b821", nextState:"turningOff"
|
||||||
|
state "off", label:'${name}', action:"switch.on", icon:"st.lights.philips.hue-single", backgroundColor:"#ffffff", nextState:"turningOn"
|
||||||
|
state "turningOn", label:'${name}', action:"switch.off", icon:"st.lights.philips.hue-single", backgroundColor:"#79b821", nextState:"turningOff"
|
||||||
|
state "turningOff", label:'${name}', action:"switch.on", icon:"st.lights.philips.hue-single", backgroundColor:"#ffffff", nextState:"turningOn"
|
||||||
|
}
|
||||||
|
|
||||||
controlTile("levelSliderControl", "device.level", "slider", height: 1, width: 2, inactiveLabel: false, range:"(0..100)") {
|
controlTile("levelSliderControl", "device.level", "slider", height: 1, width: 2, inactiveLabel: false, range:"(0..100)") {
|
||||||
state "level", action:"switch level.setLevel"
|
state "level", action:"switch level.setLevel"
|
||||||
}
|
}
|
||||||
@@ -44,7 +51,7 @@ metadata {
|
|||||||
state "default", label:"", action:"refresh.refresh", icon:"st.secondary.refresh"
|
state "default", label:"", action:"refresh.refresh", icon:"st.secondary.refresh"
|
||||||
}
|
}
|
||||||
|
|
||||||
main(["rich-control"])
|
main(["switch"])
|
||||||
details(["rich-control", "refresh"])
|
details(["rich-control", "refresh"])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -469,6 +469,7 @@ def pollChild(){
|
|||||||
|
|
||||||
if (pollChildren()){
|
if (pollChildren()){
|
||||||
devices.each { child ->
|
devices.each { child ->
|
||||||
|
log.info "***found $child"
|
||||||
if (!child.device.deviceNetworkId.startsWith("ecobee_sensor")){
|
if (!child.device.deviceNetworkId.startsWith("ecobee_sensor")){
|
||||||
if(atomicState.thermostats[child.device.deviceNetworkId] != null) {
|
if(atomicState.thermostats[child.device.deviceNetworkId] != null) {
|
||||||
def tData = atomicState.thermostats[child.device.deviceNetworkId]
|
def tData = atomicState.thermostats[child.device.deviceNetworkId]
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ definition(
|
|||||||
category: "SmartThings Labs",
|
category: "SmartThings Labs",
|
||||||
iconUrl: "https://s3.amazonaws.com/smartapp-icons/Partner/hue.png",
|
iconUrl: "https://s3.amazonaws.com/smartapp-icons/Partner/hue.png",
|
||||||
iconX2Url: "https://s3.amazonaws.com/smartapp-icons/Partner/hue@2x.png",
|
iconX2Url: "https://s3.amazonaws.com/smartapp-icons/Partner/hue@2x.png",
|
||||||
singleInstance: true
|
//singleInstance: true
|
||||||
)
|
)
|
||||||
|
|
||||||
preferences {
|
preferences {
|
||||||
@@ -643,25 +643,21 @@ def setColorTemperature(childDevice, huesettings) {
|
|||||||
|
|
||||||
def setColor(childDevice, huesettings) {
|
def setColor(childDevice, huesettings) {
|
||||||
log.debug "Executing 'setColor($huesettings)'"
|
log.debug "Executing 'setColor($huesettings)'"
|
||||||
def hue = null
|
def hue = Math.min(Math.round(huesettings.hue * 65535 / 100), 65535)
|
||||||
def sat = null
|
def sat = Math.min(Math.round(huesettings.saturation * 255 / 100), 255)
|
||||||
def xy = null
|
|
||||||
if (huesettings.hex) {
|
|
||||||
xy = getHextoXY(huesettings.hex)
|
|
||||||
} else if (huesettings.hue && huesettings.saturation) {
|
|
||||||
hue = Math.min(Math.round(huesettings.hue * 65535 / 100), 65535)
|
|
||||||
sat = Math.min(Math.round(huesettings.saturation * 255 / 100), 255)
|
|
||||||
}
|
|
||||||
def alert = huesettings.alert ? huesettings.alert : "none"
|
def alert = huesettings.alert ? huesettings.alert : "none"
|
||||||
def transition = huesettings.transition ? huesettings.transition : 4
|
def transition = huesettings.transition ? huesettings.transition : 4
|
||||||
|
|
||||||
def value = [xy: xy, sat: sat, hue: hue, alert: alert, transitiontime: transition, on: true]
|
def value = [sat: sat, hue: hue, alert: alert, transitiontime: transition]
|
||||||
|
|
||||||
if (huesettings.level != null) {
|
if (huesettings.level != null) {
|
||||||
if (huesettings.level == 1) value.bri = 1 else value.bri = Math.min(Math.round(huesettings.level * 255 / 100), 255)
|
if (huesettings.level == 1) value.bri = 1 else value.bri = Math.min(Math.round(huesettings.level * 255 / 100), 255)
|
||||||
value.on = value.bri > 0
|
value.on = value.bri > 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (huesettings.switch) {
|
||||||
|
value.on = huesettings.switch == "on"
|
||||||
|
}
|
||||||
|
|
||||||
log.debug "sending command $value"
|
log.debug "sending command $value"
|
||||||
put("lights/${getId(childDevice)}/state", value)
|
put("lights/${getId(childDevice)}/state", value)
|
||||||
}
|
}
|
||||||
@@ -747,59 +743,6 @@ private getBridgeIP() {
|
|||||||
return host
|
return host
|
||||||
}
|
}
|
||||||
|
|
||||||
private getHextoXY(String colorStr) {
|
|
||||||
// For the hue bulb the corners of the triangle are:
|
|
||||||
// -Red: 0.675, 0.322
|
|
||||||
// -Green: 0.4091, 0.518
|
|
||||||
// -Blue: 0.167, 0.04
|
|
||||||
|
|
||||||
def cred = Integer.valueOf( colorStr.substring( 1, 3 ), 16 )
|
|
||||||
def cgreen = Integer.valueOf( colorStr.substring( 3, 5 ), 16 )
|
|
||||||
def cblue = Integer.valueOf( colorStr.substring( 5, 7 ), 16 )
|
|
||||||
|
|
||||||
double[] normalizedToOne = new double[3];
|
|
||||||
normalizedToOne[0] = (cred / 255);
|
|
||||||
normalizedToOne[1] = (cgreen / 255);
|
|
||||||
normalizedToOne[2] = (cblue / 255);
|
|
||||||
float red, green, blue;
|
|
||||||
|
|
||||||
// Make red more vivid
|
|
||||||
if (normalizedToOne[0] > 0.04045) {
|
|
||||||
red = (float) Math.pow(
|
|
||||||
(normalizedToOne[0] + 0.055) / (1.0 + 0.055), 2.4);
|
|
||||||
} else {
|
|
||||||
red = (float) (normalizedToOne[0] / 12.92);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Make green more vivid
|
|
||||||
if (normalizedToOne[1] > 0.04045) {
|
|
||||||
green = (float) Math.pow((normalizedToOne[1] + 0.055)
|
|
||||||
/ (1.0 + 0.055), 2.4);
|
|
||||||
} else {
|
|
||||||
green = (float) (normalizedToOne[1] / 12.92);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Make blue more vivid
|
|
||||||
if (normalizedToOne[2] > 0.04045) {
|
|
||||||
blue = (float) Math.pow((normalizedToOne[2] + 0.055)
|
|
||||||
/ (1.0 + 0.055), 2.4);
|
|
||||||
} else {
|
|
||||||
blue = (float) (normalizedToOne[2] / 12.92);
|
|
||||||
}
|
|
||||||
|
|
||||||
float X = (float) (red * 0.649926 + green * 0.103455 + blue * 0.197109);
|
|
||||||
float Y = (float) (red * 0.234327 + green * 0.743075 + blue * 0.022598);
|
|
||||||
float Z = (float) (red * 0.0000000 + green * 0.053077 + blue * 1.035763);
|
|
||||||
|
|
||||||
float x = X / (X + Y + Z);
|
|
||||||
float y = Y / (X + Y + Z);
|
|
||||||
|
|
||||||
double[] xy = new double[2];
|
|
||||||
xy[0] = x;
|
|
||||||
xy[1] = y;
|
|
||||||
return xy;
|
|
||||||
}
|
|
||||||
|
|
||||||
private Integer convertHexToInt(hex) {
|
private Integer convertHexToInt(hex) {
|
||||||
Integer.parseInt(hex,16)
|
Integer.parseInt(hex,16)
|
||||||
}
|
}
|
||||||
|
|||||||
62
smartapps/smartthings/smart-timer.src/smart-timer.groovy
Normal file
62
smartapps/smartthings/smart-timer.src/smart-timer.groovy
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
/**
|
||||||
|
* Copyright 2015 SmartThings
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
|
||||||
|
* in compliance with the License. You may obtain a copy of the License at:
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed
|
||||||
|
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License
|
||||||
|
* for the specific language governing permissions and limitations under the License.
|
||||||
|
*
|
||||||
|
* CoolDeep
|
||||||
|
*
|
||||||
|
* Author: CoolDeep
|
||||||
|
*/
|
||||||
|
|
||||||
|
definition(
|
||||||
|
name: "Smart Timer",
|
||||||
|
namespace: "smartthings",
|
||||||
|
author: "CoolDeep",
|
||||||
|
description: "If a light/device is already on, leave it on. Else, if a light/device switches on on a trigger, switch off in a given time",
|
||||||
|
category: "My Apps",
|
||||||
|
iconUrl: "https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience.png",
|
||||||
|
iconX2Url: "https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience%402x.png"
|
||||||
|
)
|
||||||
|
|
||||||
|
preferences {
|
||||||
|
section("When a sesonsor triggers(turns on)...") {
|
||||||
|
input "mySwitch", "capability.switch", title: "Switches", multiple: true, required: true
|
||||||
|
input "mySensor", "capability.contactSensor", title: "Sensors", multiple: true, required: true
|
||||||
|
}
|
||||||
|
section("Turn it off after how many minutes?") {
|
||||||
|
input "minutesLater", "decimal", title: "When?"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
def installed() {
|
||||||
|
log.debug "Installed with settings: ${settings}"
|
||||||
|
subscribe(mySensor, "contact.opened", myHandler)
|
||||||
|
}
|
||||||
|
|
||||||
|
def updated() {
|
||||||
|
log.debug "Updated with settings: ${settings}"
|
||||||
|
unsubscribe()
|
||||||
|
subscribe(mySensor, "contact.open", myHandler)
|
||||||
|
}
|
||||||
|
|
||||||
|
def myHandler(evt) {
|
||||||
|
def lightVal = mySwitch.currentSwitch
|
||||||
|
log.debug ">> TheSwitch current value turned ${lightVal}"
|
||||||
|
|
||||||
|
if (lightVal.contains("off")) {
|
||||||
|
def delay = minutesLater * 60
|
||||||
|
log.debug ">>> Turning off in ${minutesLater} minutes (${delay}seconds)"
|
||||||
|
runIn(delay, turnOffSwitch)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
def turnOffSwitch() {
|
||||||
|
mySwitch.off()
|
||||||
|
}
|
||||||
@@ -234,7 +234,7 @@ def addSwitches() {
|
|||||||
def d
|
def d
|
||||||
if (selectedSwitch) {
|
if (selectedSwitch) {
|
||||||
d = getChildDevices()?.find {
|
d = getChildDevices()?.find {
|
||||||
it.deviceNetworkId == selectedSwitch.value.mac || it.device.getDataValue("mac") == selectedSwitch.value.mac
|
it.dni == selectedSwitch.value.mac || it.device.getDataValue("mac") == selectedSwitch.value.mac
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -265,7 +265,7 @@ def addMotions() {
|
|||||||
def d
|
def d
|
||||||
if (selectedMotion) {
|
if (selectedMotion) {
|
||||||
d = getChildDevices()?.find {
|
d = getChildDevices()?.find {
|
||||||
it.deviceNetworkId == selectedMotion.value.mac || it.device.getDataValue("mac") == selectedMotion.value.mac
|
it.dni == selectedMotion.value.mac || it.device.getDataValue("mac") == selectedMotion.value.mac
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -296,7 +296,7 @@ def addLightSwitches() {
|
|||||||
def d
|
def d
|
||||||
if (selectedLightSwitch) {
|
if (selectedLightSwitch) {
|
||||||
d = getChildDevices()?.find {
|
d = getChildDevices()?.find {
|
||||||
it.deviceNetworkId == selectedLightSwitch.value.mac || it.device.getDataValue("mac") == selectedLightSwitch.value.mac
|
it.dni == selectedLightSwitch.value.mac || it.device.getDataValue("mac") == selectedLightSwitch.value.mac
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user