mirror of
https://github.com/timberjoegithub/SmartThingsPublic.git
synced 2026-07-21 23:52:03 +00:00
Update PhotonDS18B20.groovy
This commit is contained in:
@@ -11,6 +11,13 @@
|
|||||||
* for the specific language governing permissions and limitations under the License.
|
* for the specific language governing permissions and limitations under the License.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
preferences {
|
||||||
|
input("token", "text", title: "Access Token")
|
||||||
|
input("deviceId", "text", title: "Device ID")
|
||||||
|
// input("relaynum", "text", title: "Relay Number 1-6")
|
||||||
|
input("deviceName", "text", title: "Name of device in the Photon cloud")
|
||||||
|
// device name in api like: https://api.spark.io/v1/devices/${deviceId}/${deviceName}
|
||||||
|
}
|
||||||
metadata {
|
metadata {
|
||||||
definition (name: "DS18B20 Temperature Sensor", namespace: "smartthings", author: "github@josephsteele.com") {
|
definition (name: "DS18B20 Temperature Sensor", namespace: "smartthings", author: "github@josephsteele.com") {
|
||||||
capability "Temperature Measurement"
|
capability "Temperature Measurement"
|
||||||
@@ -76,3 +83,10 @@ private String parseValue(String description) {
|
|||||||
}
|
}
|
||||||
null
|
null
|
||||||
}
|
}
|
||||||
|
private put(relaystate) {
|
||||||
|
//Spark Core API Call
|
||||||
|
httpPost(
|
||||||
|
uri: "https://api.spark.io/v1/devices/${deviceId}/strelay${relaynum}",
|
||||||
|
body: [access_token: token, command: relaystate],
|
||||||
|
) {response -> log.debug (response.data)}
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user