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 / connector.js
Last active December 29, 2020 15:02
ST_SchemaConnector_CommandResponse
const {SchemaConnector, DeviceErrorTypes} = require('st-schema');
const deviceStates = { switch: 'off', presence: 'not present'}//1-10
const connector = new SchemaConnector()
.enableEventLogging(2)
.discoveryHandler((accessToken, response) => {
const d = response.addDevice('virtualPresenceSensor', 'Virtual Presence Sensor', 'device-profile-id')
//Device manufacturer
d.manufacturerName('xxxx');
/**
* roomsList
*
* 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
*
### Keybase proof
I hereby claim:
* I am nayelyzarazua-bluetrail on github.
* I am nayelyzbluetrail (https://keybase.io/nayelyzbluetrail) on keybase.
* I have a public key ASD8C01qYVtsgqO7q_4YyJ7tvDN5OWn8qW06h2ZXAoyFoAo
To claim this, I am signing this object:
@nayelyzarazua-bluetrail
nayelyzarazua-bluetrail / device_config.json
Created January 29, 2021 17:27
DashboardView_stateAction_2capabilities
{
"dashboard": {
"states": [
{
"component": "main",
"capability": "temperatureMeasurement",
"version": 1,
"values": [],
"patch": []
}
{
"name": "customThermostatMode",
"attributes": {
"thermostatMode": {
"schema": {
"type": "object",
"properties": {
"value": {
"type": "string"
}
@nayelyzarazua-bluetrail
nayelyzarazua-bluetrail / child_switch.groovy
Last active February 16, 2021 15:10
CompositeDevice_MultiSwitch
/*
* VIRTUAL SWITCH - CHILD DEVICE OF multipleSwitchDev
*/
metadata
{
definition( name: 'Virtual Switch', namespace: 'nayelyz', author: 'Nayely',deviceTypeId:'Switch',ocfDeviceType:'oic.d.switch', mnmn: 'SmartThingsCommunity', vid: '30ad6f88-acb3-3e11-8186-5b7f804b0c71' )
{
capability 'Switch'
capability 'Health Check'
{
"dashboard": {
"states": [
{
"component": "main",
"capability": "temperatureMeasurement",
"version": 1,
"values": [],
"patch": []
}
/**
* Z-Wave Lock
*
* 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
*
@nayelyzarazua-bluetrail
nayelyzarazua-bluetrail / smartapp.js
Created February 25, 2021 01:34
SmartApp_DynamicInputsPersistance
'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 / DynamicInputsDelete.js
Created March 2, 2021 21:28
SmartApp_DynamicInputsDelete
'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());