mirror of
https://github.com/mtan93/SmartThingsPublic.git
synced 2026-03-28 13:23:07 +00:00
Compare commits
1 Commits
MSA-1897-1
...
MSA-1893-1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
743fb6c9d4 |
@@ -75,8 +75,8 @@ metadata {
|
|||||||
|
|
||||||
tiles {
|
tiles {
|
||||||
// Using standardTile instead of valueTile as it renders the icon better
|
// Using standardTile instead of valueTile as it renders the icon better
|
||||||
standardTile("temperature", "device.temperature", width: 2, height: 2) {
|
valueTile("temperature", "device.temperature", width: 3, height: 3) {
|
||||||
state("temperature", label:'${currentValue}°', icon: "st.thermostat.ac.air-conditioning",
|
state "temperature", label:'${currentValue}°',
|
||||||
backgroundColors:[
|
backgroundColors:[
|
||||||
[value: 31, color: "#153591"],
|
[value: 31, color: "#153591"],
|
||||||
[value: 44, color: "#1e9cbb"],
|
[value: 44, color: "#1e9cbb"],
|
||||||
@@ -85,10 +85,21 @@ metadata {
|
|||||||
[value: 84, color: "#f1d801"],
|
[value: 84, color: "#f1d801"],
|
||||||
[value: 95, color: "#d04e00"],
|
[value: 95, color: "#d04e00"],
|
||||||
[value: 96, color: "#bc2323"]
|
[value: 96, color: "#bc2323"]
|
||||||
]
|
]
|
||||||
)
|
|
||||||
}
|
}
|
||||||
standardTile("mode", "device.thermostatMode", inactiveLabel: false, decoration: "flat") {
|
valueTile("humidity", "device.humidity", inactiveLabel: false) {
|
||||||
|
state "humidity", label:'${currentValue}%', unit:"",
|
||||||
|
icon: "http://cdn.device-icons.smartthings.com/Weather/weather12-icn@2x.png",
|
||||||
|
backgroundColors : [
|
||||||
|
[value: 01, color: "#724529"],
|
||||||
|
[value: 11, color: "#724529"],
|
||||||
|
[value: 21, color: "#724529"],
|
||||||
|
[value: 35, color: "#44b621"],
|
||||||
|
[value: 49, color: "#44b621"],
|
||||||
|
[value: 50, color: "#1e9cbb"]
|
||||||
|
]
|
||||||
|
}
|
||||||
|
standardTile("mode", "device.thermostatMode", inactiveLabel: false, decoration: "flat") {
|
||||||
state "off", action:"switchMode", nextState:"to_heat", icon: "st.thermostat.heating-cooling-off"
|
state "off", action:"switchMode", nextState:"to_heat", icon: "st.thermostat.heating-cooling-off"
|
||||||
state "heat", action:"switchMode", nextState:"to_cool", icon: "st.thermostat.heat"
|
state "heat", action:"switchMode", nextState:"to_cool", icon: "st.thermostat.heat"
|
||||||
state "cool", action:"switchMode", nextState:"...", icon: "st.thermostat.cool"
|
state "cool", action:"switchMode", nextState:"...", icon: "st.thermostat.cool"
|
||||||
@@ -120,7 +131,7 @@ metadata {
|
|||||||
state "default", action:"polling.poll", icon:"st.secondary.refresh"
|
state "default", action:"polling.poll", icon:"st.secondary.refresh"
|
||||||
}
|
}
|
||||||
main "temperature"
|
main "temperature"
|
||||||
details(["temperature", "mode", "fanMode", "heatSliderControl", "heatingSetpoint", "coolSliderControl", "coolingSetpoint", "refresh"])
|
details(["temperature", "humidity", "mode", "fanMode", "heatSliderControl", "heatingSetpoint", "coolSliderControl", "coolingSetpoint", "refresh"])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -585,5 +596,4 @@ def fanCirculate() {
|
|||||||
|
|
||||||
private getStandardDelay() {
|
private getStandardDelay() {
|
||||||
1000
|
1000
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1,64 +0,0 @@
|
|||||||
import grails.converters.JSON
|
|
||||||
|
|
||||||
/**
|
|
||||||
* JSON API Access App
|
|
||||||
*/
|
|
||||||
|
|
||||||
definition(
|
|
||||||
name: "Bling_SmartApps",
|
|
||||||
namespace: "BlingSmartApps",
|
|
||||||
author: "Bling",
|
|
||||||
description: "Return things as JSON",
|
|
||||||
category: "My Apps",
|
|
||||||
iconUrl: "https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience.png",
|
|
||||||
iconX2Url: "https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience@2x.png",
|
|
||||||
oauth: [displayName: "JSON API", displayLink: ""]
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
preferences {
|
|
||||||
section("Allow these things to be exposed via JSON...") {
|
|
||||||
input "switches", "capability.switch", title: "Switches", multiple: true, required: true, hideWhenEmpty: true
|
|
||||||
|
|
||||||
//input "temperatures", "capability.temperatureMeasurement", title: "Temp Measurements", multiple: true, required: false
|
|
||||||
//input "contacts", "capability.contactSensor", title: "Open/Closed Devices", multiple: true, required: false
|
|
||||||
//input "presences", "capability.presenceSensor", title: "Presence Sensors", multiple: true, required: false
|
|
||||||
//input "motions", "capability.motionSensor", title: "Motion Sensors", multiple: true, required: false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
mappings {
|
|
||||||
path("/things") {
|
|
||||||
action: [
|
|
||||||
GET: "listThings"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
def listThings() {
|
|
||||||
[
|
|
||||||
switches: switches.collect{device(it,"switch")}
|
|
||||||
/*
|
|
||||||
switches: switches.collect{device(it,"switch")},
|
|
||||||
temperatures: temperatures.collect{device(it,"temperature")},
|
|
||||||
contacts: contacts.collect{device(it,"contact")},
|
|
||||||
presences: presences.collect{device(it,"presence")},
|
|
||||||
motions: motions.collect{device(it,"motion")}
|
|
||||||
*/
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
private device(it, type) {
|
|
||||||
def device_state = [label:it.label, type:type, id:it.id, devtest:it]
|
|
||||||
|
|
||||||
for (attribute in it.supportedAttributes) {
|
|
||||||
device_state."${attribute}" = it.currentValue("${attribute}")
|
|
||||||
}
|
|
||||||
|
|
||||||
device_state ? device_state : null
|
|
||||||
}
|
|
||||||
|
|
||||||
def installed() {}
|
|
||||||
|
|
||||||
def updated() {}
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user