Skip to content

Instantly share code, notes, and snippets.

View nayelyzarazua-bluetrail's full-sized avatar

Nayely Zarazua nayelyzarazua-bluetrail

View GitHub Profile
@nayelyzarazua-bluetrail
nayelyzarazua-bluetrail / testEffectCap.txt
Last active November 24, 2020 23:14
DevicePresentation
{
"type": "dth",
"dashboard": {
"states": [
{
"component": "main",
"capability": "switch",
"version": 1,
"values": [],
"patch": []
@nayelyzarazua-bluetrail
nayelyzarazua-bluetrail / snippet.js
Last active November 25, 2020 01:52
OAuth_API_withSubscriptions
const RESTrequest = require('request');
/*
* Create Subscription Request
*/
let subscription = {
"sourceType": "CAPABILITY",
"capability": {
"locationId": "xxxxx-xxxx-xxxx-xxxx",
"capability": "switch",
"attribute": "switch",
@nayelyzarazua-bluetrail
nayelyzarazua-bluetrail / groovySmartApp.groovy
Last active November 27, 2020 00:10
SmartApp_showLargeText
/**
* largeTextSolution
*
* Copyright 2020 Smart Things
*
* 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
*
@nayelyzarazua-bluetrail
nayelyzarazua-bluetrail / EvohomeSmartApp.groovy
Last active November 28, 2020 04:32
evohomeIntegration
/**
* Copyright 2016 David Lomas (codersaur)
*
* Name: Evohome (Connect)
*
* Author: David Lomas (codersaur)
*
* Date: 2016-04-05
*
* Version: 0.08
@nayelyzarazua-bluetrail
nayelyzarazua-bluetrail / server.js
Created December 8, 2020 14:38
SmartApp_securityStateSubscription
'use strict';
const express = require('express');
const bodyParser = require('body-parser');
const SmartApp = require('@smartthings/smartapp');
require('dotenv').config();
const server = module.exports = express();
server.use(bodyParser.json());
@nayelyzarazua-bluetrail
nayelyzarazua-bluetrail / connector.js
Created December 10, 2020 00:14
MultiComponent_ST_Schema
const {SchemaConnector, DeviceErrorTypes} = require('st-schema');
const deviceStates = { switch: 'off',switch2: 'off', temperature: 40, humidity:80, healthStatus:'online', healthStatus2:'online',listElement:'monthFlow'}//1-10
const connector = new SchemaConnector()
.enableEventLogging(2)
.discoveryHandler((accessToken, response) => {
const d = response.addDevice('st-schema-component', 'st-schema-component', 'e0c682fd-46d9-4fee-8bdd-9edc5da7e053')
//Device manufacturer
d.manufacturerName('xxxx');
@nayelyzarazua-bluetrail
nayelyzarazua-bluetrail / capability.jsonc
Created December 14, 2020 21:39
iconAlternativesChange
//definition
{
"id": "xxxx.customlock",
"version": 1,
"status": "proposed",
"name": "customlock",
"attributes": {
"lockstate": {
"schema": {
"type": "object",
@nayelyzarazua-bluetrail
nayelyzarazua-bluetrail / rule.json
Last active December 15, 2020 23:03
Rule_customCapabilities
{
"name": "Automation w custom capabilities",
"actions": [
{
"if": {
"greaterThan": {
"left": {
"device": {
"devices": [
"device-id"
@nayelyzarazua-bluetrail
nayelyzarazua-bluetrail / server.js
Last active October 16, 2021 13:04
SmartApp_HealthCheck_Subscription
'use strict';
const express = require('express');
const bodyParser = require('body-parser');
const SmartApp = require('@smartthings/smartapp');
require('dotenv').config();
const server = module.exports = express();
server.use(bodyParser.json());
@nayelyzarazua-bluetrail
nayelyzarazua-bluetrail / device_config.json
Last active December 22, 2020 01:18
deviceConfiguration_enabledValues
{
"type": "dth",
"dashboard": {
"states": [
{
"component": "main",
"capability": "temperatureMeasurement",
"version": 1,
"values": [],
"patch": []