From d8c89f6c6a785da874841c1f641c1e040943c280 Mon Sep 17 00:00:00 2001 From: Vinay Rao Date: Thu, 2 Feb 2017 18:10:34 -0800 Subject: [PATCH 1/5] DVCSMP-2391 Iris 4 button device mapping to button 1 only --- .../zigbee-button.src/zigbee-button.groovy | 32 +++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/devicetypes/smartthings/zigbee-button.src/zigbee-button.groovy b/devicetypes/smartthings/zigbee-button.src/zigbee-button.groovy index 311c659..97948d1 100644 --- a/devicetypes/smartthings/zigbee-button.src/zigbee-button.groovy +++ b/devicetypes/smartthings/zigbee-button.src/zigbee-button.groovy @@ -118,8 +118,7 @@ private Map getBatteryResult(rawValue) { private Map parseNonIasButtonMessage(Map descMap){ def buttonState = "" def buttonNumber = 0 - if (((device.getDataValue("model") == "3460-L") || (device.getDataValue("model") == "3450-L")) - &&(descMap.clusterInt == 0x0006)) { + if ((device.getDataValue("model") == "3460-L") &&(descMap.clusterInt == 0x0006)) { if (descMap.command == "01") { getButtonResult("press") } @@ -127,6 +126,35 @@ private Map parseNonIasButtonMessage(Map descMap){ getButtonResult("release") } } + else if ((device.getDataValue("model") == "3450-L") && (descMap.clusterInt == 0x0006)) { + log.info "For 3450-L" + log.trace "descMap : $descMap" + if (descMap.command == "01") { + getButtonResult("press") + } + else if (descMap.command == "00") { + def button = 1 + switch(descMap.sourceEndpoint) { + case "01": + button = 4 + break + case "02": + button = 3 + break + case "03": + button = 1 + break + case "04": + button = 2 + break + default: + button = 1 + break + } + + getButtonResult("release", button) + } + } else if (descMap.clusterInt == 0x0006) { buttonState = "pushed" if (descMap.command == "01") { From 8e6d009d676c9c2dc10e59fd56df6a977d5b6da6 Mon Sep 17 00:00:00 2001 From: Vinay Rao Date: Thu, 2 Feb 2017 18:52:23 -0800 Subject: [PATCH 2/5] changes suggested by Tom and Zach --- .../zigbee-button.src/zigbee-button.groovy | 25 ++++++++----------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/devicetypes/smartthings/zigbee-button.src/zigbee-button.groovy b/devicetypes/smartthings/zigbee-button.src/zigbee-button.groovy index 97948d1..47dd320 100644 --- a/devicetypes/smartthings/zigbee-button.src/zigbee-button.groovy +++ b/devicetypes/smartthings/zigbee-button.src/zigbee-button.groovy @@ -119,36 +119,31 @@ private Map parseNonIasButtonMessage(Map descMap){ def buttonState = "" def buttonNumber = 0 if ((device.getDataValue("model") == "3460-L") &&(descMap.clusterInt == 0x0006)) { - if (descMap.command == "01") { + if (descMap.commandInt == 1) { getButtonResult("press") } - else if (descMap.command == "00") { + else if (descMap.commandInt == 0) { getButtonResult("release") } } else if ((device.getDataValue("model") == "3450-L") && (descMap.clusterInt == 0x0006)) { - log.info "For 3450-L" - log.trace "descMap : $descMap" - if (descMap.command == "01") { + if (descMap.commandInt == 1) { getButtonResult("press") } - else if (descMap.command == "00") { - def button = 1 + else if (descMap.commandInt == 0) { + def button = 1 switch(descMap.sourceEndpoint) { - case "01": - button = 4 + case "01": + button = 4 break case "02": - button = 3 + button = 3 break case "03": - button = 1 + button = 1 break case "04": - button = 2 - break - default: - button = 1 + button = 2 break } From 16d7da81f12a57ffa79ebc6e38f8d130a7cbaf08 Mon Sep 17 00:00:00 2001 From: Zach Varberg Date: Thu, 1 Dec 2016 09:03:45 -0600 Subject: [PATCH 3/5] Remove calls to ZoneType19 methods We want to move toward the deprecation of these methods, and it starts with the removal of calls to those methods from our DTHs. This relates to: https://smartthings.atlassian.net/browse/DPROT-167 --- .../open-closed-sensor.groovy | 13 +++++-------- .../smartsense-garage-door-multi.groovy | 2 +- .../smartsense-garage-door-sensor-button.groovy | 2 +- .../smartsense-motion.groovy | 16 ++++++---------- .../smartsense-multi.src/smartsense-multi.groovy | 9 ++------- .../smartsense-virtual-open-closed.groovy | 2 +- 6 files changed, 16 insertions(+), 28 deletions(-) diff --git a/devicetypes/smartthings/open-closed-sensor.src/open-closed-sensor.groovy b/devicetypes/smartthings/open-closed-sensor.src/open-closed-sensor.groovy index d05a565..6c2e42e 100644 --- a/devicetypes/smartthings/open-closed-sensor.src/open-closed-sensor.groovy +++ b/devicetypes/smartthings/open-closed-sensor.src/open-closed-sensor.groovy @@ -40,14 +40,11 @@ metadata { // Parse incoming device messages to generate events def parse(String description) { - def name = null - def value = description - if (zigbee.isZoneType19(description)) { - name = "contact" - value = zigbee.translateStatusZoneType19(description) ? "open" : "closed" + def resMap + if (description.startsWith("zone")) { + resMap = createEvent(name: "contact", value: zigbee.parseZoneStatus(description).isAlarm1Set() ? "open" : "closed") } - def result = createEvent(name: name, value: value) - log.debug "Parse returned ${result?.descriptionText}" - return result + log.debug "Parse returned $resMap" + return resMap } diff --git a/devicetypes/smartthings/smartsense-garage-door-multi.src/smartsense-garage-door-multi.groovy b/devicetypes/smartthings/smartsense-garage-door-multi.src/smartsense-garage-door-multi.groovy index 8454b9c..7cf58bf 100644 --- a/devicetypes/smartthings/smartsense-garage-door-multi.src/smartsense-garage-door-multi.groovy +++ b/devicetypes/smartthings/smartsense-garage-door-multi.src/smartsense-garage-door-multi.groovy @@ -88,7 +88,7 @@ def parse(String description) { log.debug "parse($description)" def results = [:] - if (!isSupportedDescription(description) || zigbee.isZoneType19(description)) { + if (!isSupportedDescription(description) || description.startsWith("zone")) { // Ignore this in favor of orientation-based state // results = parseSingleMessage(description) } diff --git a/devicetypes/smartthings/smartsense-garage-door-sensor-button.src/smartsense-garage-door-sensor-button.groovy b/devicetypes/smartthings/smartsense-garage-door-sensor-button.src/smartsense-garage-door-sensor-button.groovy index f3ae158..1a2345c 100644 --- a/devicetypes/smartthings/smartsense-garage-door-sensor-button.src/smartsense-garage-door-sensor-button.groovy +++ b/devicetypes/smartthings/smartsense-garage-door-sensor-button.src/smartsense-garage-door-sensor-button.groovy @@ -117,7 +117,7 @@ def parse(String description) { log.debug "parse($description)" def results = null - if (!isSupportedDescription(description) || zigbee.isZoneType19(description)) { + if (!isSupportedDescription(description) || description.startsWith("zone")) { // Ignore this in favor of orientation-based state // results = parseSingleMessage(description) } diff --git a/devicetypes/smartthings/smartsense-motion.src/smartsense-motion.groovy b/devicetypes/smartthings/smartsense-motion.src/smartsense-motion.groovy index 5d60112..bfcefb7 100644 --- a/devicetypes/smartthings/smartsense-motion.src/smartsense-motion.groovy +++ b/devicetypes/smartthings/smartsense-motion.src/smartsense-motion.groovy @@ -45,7 +45,7 @@ metadata { def parse(String description) { def results = [:] - if (isZoneType19(description) || !isSupportedDescription(description)) { + if (description.startsWith("zone") || !isSupportedDescription(description)) { results = parseBasicMessage(description) } else if (isMotionStatusMessage(description)){ @@ -87,16 +87,12 @@ private String parseName(String description) { } private String parseValue(String description) { - if (isZoneType19(description)) { - if (translateStatusZoneType19(description)) { - return "active" - } - else { - return "inactive" - } + def zs = zigbee.parseZoneStatus(description) + if (zs) { + zs.isAlarm1Set() ? "active" : "inactive" + } else { + description } - - description } private parseDescriptionText(String linkText, String value, String description) { diff --git a/devicetypes/smartthings/smartsense-multi.src/smartsense-multi.groovy b/devicetypes/smartthings/smartsense-multi.src/smartsense-multi.groovy index 17f5ddd..5adabde 100644 --- a/devicetypes/smartthings/smartsense-multi.src/smartsense-multi.groovy +++ b/devicetypes/smartthings/smartsense-multi.src/smartsense-multi.groovy @@ -86,7 +86,7 @@ metadata { def parse(String description) { def results - if (!isSupportedDescription(description) || zigbee.isZoneType19(description)) { + if (!isSupportedDescription(description) || description.startsWith("zone")) { results = parseSingleMessage(description) } else if (description == 'updated') { @@ -488,12 +488,7 @@ private String parseValue(String description) { if (!isSupportedDescription(description)) { return description } - else if (zigbee.translateStatusZoneType19(description)) { - return "open" - } - else { - return "closed" - } + return zigbee.parseZoneStatus(description)?.isAlarm1Set() ? "open" : "closed" } private parseDescriptionText(String linkText, String value, String description) { diff --git a/devicetypes/smartthings/smartsense-virtual-open-closed.src/smartsense-virtual-open-closed.groovy b/devicetypes/smartthings/smartsense-virtual-open-closed.src/smartsense-virtual-open-closed.groovy index 0d4d137..5795f3e 100644 --- a/devicetypes/smartthings/smartsense-virtual-open-closed.src/smartsense-virtual-open-closed.groovy +++ b/devicetypes/smartthings/smartsense-virtual-open-closed.src/smartsense-virtual-open-closed.groovy @@ -96,7 +96,7 @@ metadata { def parse(String description) { def results - if (!isSupportedDescription(description) || zigbee.isZoneType19(description)) { + if (!isSupportedDescription(description) || description.startsWith("zone")) { // Ignore this in favor of orientation-based state // results = parseSingleMessage(description) } From bf491270a942b762b301e25b13cbce8c9c0fbc0b Mon Sep 17 00:00:00 2001 From: Zach Varberg Date: Tue, 7 Feb 2017 11:50:58 -0600 Subject: [PATCH 4/5] Properly handle setLevel for zigbee-dimmer This works around a few devices that use this DTH that do not properly handle the setLevel command. This resolves: https://smartthings.atlassian.net/browse/DPROT-242 --- .../zigbee-dimmer.src/zigbee-dimmer.groovy | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/devicetypes/smartthings/zigbee-dimmer.src/zigbee-dimmer.groovy b/devicetypes/smartthings/zigbee-dimmer.src/zigbee-dimmer.groovy index 7a4cc2a..bdaedf7 100644 --- a/devicetypes/smartthings/zigbee-dimmer.src/zigbee-dimmer.groovy +++ b/devicetypes/smartthings/zigbee-dimmer.src/zigbee-dimmer.groovy @@ -93,7 +93,13 @@ def on() { } def setLevel(value) { - zigbee.setLevel(value) + def additionalCmds = [] + if (device.getDataValue("model") == "iQBR30" && value.toInteger() > 0) { // Handle iQ bulb not following spec + additionalCmds = zigbee.on() + } else if (device.getDataValue("manufacturer") == "MRVL") { // Handle marvel stack not reporting + additionalCmds = refresh() + } + zigbee.setLevel(value) + additionalCmds } /** * PING is used by Device-Watch in attempt to reach the Device @@ -103,7 +109,7 @@ def ping() { } def refresh() { - zigbee.onOffRefresh() + zigbee.levelRefresh() + zigbee.onOffConfig(0, 300) + zigbee.levelConfig() + zigbee.onOffRefresh() + zigbee.levelRefresh() } def configure() { @@ -113,5 +119,5 @@ def configure() { sendEvent(name: "checkInterval", value: 2 * 10 * 60 + 1 * 60, displayed: false, data: [protocol: "zigbee", hubHardwareId: device.hub.hardwareID]) // OnOff minReportTime 0 seconds, maxReportTime 5 min. Reporting interval if no activity - zigbee.onOffRefresh() + zigbee.levelRefresh() + zigbee.onOffConfig(0, 300) + zigbee.levelConfig() + refresh() + zigbee.onOffConfig(0, 300) + zigbee.levelConfig() } From cfdc61d72a23572e752b6da47719e01c23766789 Mon Sep 17 00:00:00 2001 From: Juan Pablo Risso Date: Tue, 7 Feb 2017 14:11:38 -0600 Subject: [PATCH 5/5] DVCSMP-2290 - Ecobee Localization (#1628) Split Files Updated --- .../ecobee-connect.src/ecobee-connect.groovy | 5 ++++- .../ecobee-connect.src/i18n/ar.properties | 17 +++++++++++++++++ .../ecobee-connect.src/i18n/th.properties | 17 +++++++++++++++++ .../ecobee-connect.src/i18n/tr.properties | 17 +++++++++++++++++ 4 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 smartapps/smartthings/ecobee-connect.src/i18n/ar.properties create mode 100644 smartapps/smartthings/ecobee-connect.src/i18n/th.properties create mode 100644 smartapps/smartthings/ecobee-connect.src/i18n/tr.properties diff --git a/smartapps/smartthings/ecobee-connect.src/ecobee-connect.groovy b/smartapps/smartthings/ecobee-connect.src/ecobee-connect.groovy index 9b4c178..ec1d725 100644 --- a/smartapps/smartthings/ecobee-connect.src/ecobee-connect.groovy +++ b/smartapps/smartthings/ecobee-connect.src/ecobee-connect.groovy @@ -20,6 +20,9 @@ * JLH - 02-15-2014 - Fuller use of ecobee API * 10-28-2015 DVCSMP-604 - accessory sensor, DVCSMP-1174, DVCSMP-1111 - not respond to routines */ + +include 'localization' + definition( name: "Ecobee (Connect)", namespace: "smartthings", @@ -86,7 +89,7 @@ def authPage() { if (numFound > 0) { section("") { paragraph "Tap below to see the list of ecobee sensors available in your ecobee account and select the ones you want to connect to SmartThings." - input(name: "ecobeesensors", title:"Select Ecobee Sensors (${numFound} found)", type: "enum", required:false, description: "Tap to choose", multiple:true, options:options) + input(name: "ecobeesensors", title: "Select Ecobee Sensors ({{numFound}} found)", messageArgs: [numFound: numFound], type: "enum", required:false, description: "Tap to choose", multiple:true, options:options) } } } diff --git a/smartapps/smartthings/ecobee-connect.src/i18n/ar.properties b/smartapps/smartthings/ecobee-connect.src/i18n/ar.properties new file mode 100644 index 0000000..9bee45b --- /dev/null +++ b/smartapps/smartthings/ecobee-connect.src/i18n/ar.properties @@ -0,0 +1,17 @@ +'''Connect your Ecobee thermostat to SmartThings.'''.ar=قم بتوصيل ثرموستات Ecobee بـ SmartThings. +'''You are connected.'''.ar=أنت متصل. +'''Click to enter Ecobee Credentials'''.ar=النقر لإدخال بيانات اعتماد Ecobee +'''Login'''.ar=تسجيل الدخول +'''Tap below to log in to the ecobee service and authorize SmartThings access. Be sure to scroll down on page 2 and press the 'Allow' button.'''.ar=انقر أدناه لتسجيل الدخول إلى خدمة ecobee والمصادقة على الوصول إلى SmartThings. تأكد من التمرير للأسفل على الصفحة ٢ والضغط على زر ”السماح“. +'''Select Your Thermostats'''.ar=تحديد الثرموستات +'''Tap below to see the list of ecobee thermostats available in your ecobee account and select the ones you want to connect to SmartThings.'''.ar=انقر أدناه لرؤية قائمة أجهزة ثرموستات ecobee المتوفرة في حساب ecobee، وحدد الأجهزة التي ترغب في توصيلها بـ SmartThings. +'''Tap to choose'''.ar=النقر لاختيار +'''Tap below to see the list of ecobee sensors available in your ecobee account and select the ones you want to connect to SmartThings.'''.ar=انقر أدناه لرؤية قائمة مستشعرات ecobee المتوفرة في حساب ecobee، وحدد الأجهزة التي ترغب في توصيلها بـ SmartThings. +'''Select Ecobee Sensors ({{numFound}} found)'''.ar=تحديد مستشعرات Ecobee‏ ‎({{numFound}} found)‎ +'''Your ecobee Account is now connected to SmartThings!'''.ar=حساب ecobee متصل الآن بـ SmartThings! +'''Click 'Done' to finish setup.'''.ar=انقر فوق ”تم“ لإنهاء الإعداد. +'''The connection could not be established!'''.ar=يتعذر إنشاء الاتصال! +'''Click 'Done' to return to the menu.'''.ar=انقر فوق ”تم“ للعودة إلى القائمة. +'''{{deviceName}} is connected to SmartThings'''.ar={{deviceName}} متصل بـ SmartThings +'''{{deviceName}} is disconnected from SmartThings, because the access credential changed or was lost. Please go to the Ecobee (Connect) SmartApp and re-enter your account login credentials.'''.ar=تم قطع اتصال {{deviceName}} بـ SmartThings، لأن بيانات اعتماد الوصول قد تغيرت أو فُقدت. يُرجى الانتقال إلى التطبيق الذكي Ecobee (Connect)‎ وإعادة إدخال بيانات اعتماد تسجيل الدخول إلى حسابك. +'''Your Ecobee thermostat'''.ar=ثرموستات Ecobee diff --git a/smartapps/smartthings/ecobee-connect.src/i18n/th.properties b/smartapps/smartthings/ecobee-connect.src/i18n/th.properties new file mode 100644 index 0000000..4d1318c --- /dev/null +++ b/smartapps/smartthings/ecobee-connect.src/i18n/th.properties @@ -0,0 +1,17 @@ +'''Connect your Ecobee thermostat to SmartThings.'''.th=เชื่อมต่อตัวควบคุมอุณหภูมิ Ecobee ของคุณเข้ากับ SmartThings +'''You are connected.'''.th=คุณได้เชื่อมต่อแล้ว +'''Click to enter Ecobee Credentials'''.th=คลิกเพื่อใส่ ข้อมูลยืนยันตัวตน Ecobee +'''Login'''.th=เข้าสู่ระบบ +'''Tap below to log in to the ecobee service and authorize SmartThings access. Be sure to scroll down on page 2 and press the 'Allow' button.'''.th=แตะด้านล่างเพื่อเข้าสู่บริการ Ecobee และอนุญาตการเข้าถึงของ SmartThings ดูให้แน่ใจว่าได้เลื่อนลงมาที่หน้า 2 แล้วกดปุ่ม 'อนุญาต' +'''Select Your Thermostats'''.th=เลือกตัวควบคุมอุณหภูมิของคุณ +'''Tap below to see the list of ecobee thermostats available in your ecobee account and select the ones you want to connect to SmartThings.'''.th=แตะที่ด้านล่างเพื่อดูรายการตัวควบคุมอุณหภูมิ Ecobee ที่มีอยู่ในบัญชีผู้ใช้ Ecobee ของคุณ และเลือกตัวควบคุมอุณหภูมิที่คุณต้องการจะเชื่อมต่อกับ SmartThings +'''Tap to choose'''.th=แตะเพื่อเลือก +'''Tap below to see the list of ecobee sensors available in your ecobee account and select the ones you want to connect to SmartThings.'''.th=แตะที่ด้านล่างเพื่อดูรายการเซ็นเซอร์ Ecobee ที่มีอยู่ในบัญชีผู้ใช้ Ecobee ของคุณ และเลือกเซ็นเซอร์ที่คุณต้องการจะเชื่อมต่อกับ SmartThings +'''Select Ecobee Sensors ({{numFound} found)'''.th=เลือกเซ็นเซอร์ Ecobee ({{numFound}} found) +'''Your ecobee Account is now connected to SmartThings!'''.th=ตอนนี้บัญชีผู้ใช้ Ecobee ของคุณเชื่อมต่อกับ SmartThings แล้ว +'''Click 'Done' to finish setup.'''.th=คลิก 'เสร็จสิ้น' เพื่อทำการตั้งค่าให้เสร็จสิ้น +'''The connection could not be established!'''.th=ไม่สามารถสร้างการเชื่อมต่อได้! +'''Click 'Done' to return to the menu.'''.th=คลิก 'เสร็จสิ้น' เพื่อกลับไปยังเมนู +'''{{deviceName}} is connected to SmartThings'''.th={{deviceName}} เชื่อมต่อกับ SmartThings แล้ว +'''{{deviceName}} is disconnected from SmartThings, because the access credential changed or was lost. Please go to the Ecobee (Connect) SmartApp and re-enter your account login credentials.'''.th={{deviceName}} ถูกตัดการเชื่อมต่อจาก SmartThings เนื่องจากข้อมูลการเข้าถึงถูกเปลี่ยนแปลงหรือหายไป กรุณาไปที่ Ecobee (การเชื่อมต่อ) SmartApp และใส่ข้อมูลยืนยันตัวตนการเข้าสู่บัญชีผู้ใช้ของคุณอีกครั้ง +'''Your Ecobee thermostat'''.th=ตัวควบคุมอุณหภูมิ Ecobee ของคุณ diff --git a/smartapps/smartthings/ecobee-connect.src/i18n/tr.properties b/smartapps/smartthings/ecobee-connect.src/i18n/tr.properties new file mode 100644 index 0000000..fb14485 --- /dev/null +++ b/smartapps/smartthings/ecobee-connect.src/i18n/tr.properties @@ -0,0 +1,17 @@ +'''Connect your Ecobee thermostat to SmartThings.'''.tr=Ecobee termostatınızı SmartThings'e bağlayın. +'''You are connected.'''.tr=Bağlantı kurdunuz. +'''Click to enter Ecobee Credentials'''.tr=Ecobee Kimlik Bilgilerinizi girmek için tıklayın +'''Login'''.tr=Oturum aç +'''Tap below to log in to the ecobee service and authorize SmartThings access. Be sure to scroll down on page 2 and press the 'Allow' button.'''.tr=Ecobee servisinde oturum açmak ve SmartThings erişimine izin vermek için aşağıya dokunun. Ekranı 2. sayfaya kaydırdığınızdan emin olun ve 'İzin Ver' tuşuna basın. +'''Select Your Thermostats'''.tr=Termostatlarınızı Seçin +'''Tap below to see the list of ecobee thermostats available in your ecobee account and select the ones you want to connect to SmartThings.'''.tr=Ecobee hesabınızda mevcut olan ecobee termostatlarının listesini görüntülemek için aşağıya dokunun ve SmartThings'e bağlamak istediklerinizi seçin. +'''Tap to choose'''.tr=Seçmek için dokunun +'''Tap below to see the list of ecobee sensors available in your ecobee account and select the ones you want to connect to SmartThings.'''.tr=Ecobee hesabınızda mevcut olan ecobee sensörlerinin listesini görüntülemek için aşağıya dokunun ve SmartThings'e bağlamak istediklerinizi seçin. +'''Select Ecobee Sensors ({{numFound}} found)'''.tr=Ecobee Sensörlerini seçin ({{numFound}} bulundu) +'''Your ecobee Account is now connected to SmartThings!'''.tr=Ecobee Hesabınız artık SmartThings'e bağlandı! +'''Click 'Done' to finish setup.'''.tr=Kurulumu bitirmek için 'Bitti' öğesine tıklayın. +'''The connection could not be established!'''.tr=Bağlantı kurulamadı! +'''Click 'Done' to return to the menu.'''.tr=Menüye dönmek için 'Bitti' öğesine tıklayın. +'''{{deviceName}} is connected to SmartThings'''.tr={{cihazİsmi}} SmartThings'e bağlandı +'''{{deviceName}} is disconnected from SmartThings, because the access credential changed or was lost. Please go to the Ecobee (Connect) SmartApp and re-enter your account login credentials.'''.tr=Ecobee termostatınız +'''Your Ecobee thermostat'''.tr=Ecobee termostatınız