Skip to content

Instantly share code, notes, and snippets.

@joshualyon
joshualyon / virtualValues.groovy
Created March 4, 2019 18:05
Virtual Values device driver for Hubitat or SmartThings
/*
Virtual Values
Author: @josh (SharpTools.io)
Description: The Virtual Values device driver exposes a variety of methods which can be used to
set values of specific attributes. These attributes can then be used in other Apps within
Hubitat or in SharpTools.io Dashboards by using Hero Attribute tiles.
This serves as a flexible 'utility' device for setting arbitrary values that you want to use
elsewhere.
@joshualyon
joshualyon / sharptools-weather-tile-icon-mappings.json
Last active December 22, 2020 16:21
SharpTools Weather Tile Icon Mappings
{
"chanceflurries": {"weatherIcon": "snow-wind"},
"chancerain": {"weatherIcon": "rain"},
"chancesleet": {"weatherIcon": "sleet"},
"chancesnow": {"weatherIcon": "snow"},
"chancetstorms": {"weatherIcon": "thunderstorm"},
"clear": {"weatherIcon": "day-sunny"},
"cloudy": {"weatherIcon": "day-cloudy"},
"flurries": {"weatherIcon": "snow-wind"},
"fog": {"weatherIcon": "day-fog"},
@joshualyon
joshualyon / import_backup.py
Created May 15, 2018 22:25
App Engine Import Datastore Export (NDB/Backup)
"""
# App Engine import data from Datastore Backup to localhost
You can use this script to import large(ish) App Engine Datastore backups to your localohst dev server.
## Getting backup files
Follow instructions from Google to use `gcloud` to export datastore to a google storage bucket
Then download the export to your local machine:
```
gsutil -m cp -R gs://your_bucket_name/your_path /local_target
```
@joshualyon
joshualyon / Output Android Icons.jsx
Last active May 30, 2019 15:47 — forked from tlinkner/Output Android Icons.jsx
Photoshop script to output Android icons (with XXXHDPI, XXHDPI, XHDPI, HDPI, MDPI support)
// Output Android Icons.jsx
// 2012 Todd Linkner
// License: none (public domain)
// v1.0 - base file by Todd Linkner
// v1.1 - added support for XXHDPI, XXXHDPI and added PNG to the file selector
//
// This script is for Photoshop CS6. It outputs Android icons of the
// following sizes from a source PSD at least 512px x 512px
//
// store:
@joshualyon
joshualyon / simulatedBattery.groovy
Created August 15, 2017 14:42
Simulated Battery Device Type
/**
* Battery
*
* Copyright 2017 Joshua Lyon
*
* 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
*
@joshualyon
joshualyon / SHM Mapper SmartApp.groovy
Last active October 13, 2018 09:57
SmartApp which subscribes to Smart Home Monitor status and maps the state to an attribute of a custom Device Handler so other apps can access the attribute
/**
* SHM Mapper
*
* Copyright 2017 Josh Lyon
*
* This SmartApp works in unison with the custom SHM Mapper device type handler to copy Smart Home Monitor statuses to an
* attribute of a Thing. Even though SHM code is available on the SmartThings community, it was never officially approved
* for use in officially published SmartApps.
*
* In order to get around this, the SHM Mapper SmartApp copies SHM status to the attribute of a Thing so that Thing can be
@joshualyon
joshualyon / SHM Mapper Device.groovy
Last active June 18, 2018 07:10
Device type to accept mapped Smart Home Monitor states for SmartThings
/**
* SHM Mapper
*
* Copyright 2017 Josh Lyon
*
* This Device Type Handler works in unison with the custom SHM Mapper SmartApp to copy Smart Home Monitor statuses to an
* attribute of this Thing. Even though SHM code is available on the SmartThings community, it was never officially approved
* for use in officially published SmartApps.
*
* In order to get around this, the SHM Mapper SmartApp copies SHM status to the attribute of a Thing so that Thing can be

Keybase proof

I hereby claim:

  • I am iamcanadian2222 on github.
  • I am joshua_lyon (https://keybase.io/joshua_lyon) on keybase.
  • I have a public key whose fingerprint is ADB8 E8E4 2072 3BB4 8A62 4DD4 4028 2F7D E6C6 E59C

To claim this, I am signing this object:

metadata {
// Automatically generated. Make future change here.
// Mostly core Z-Wave Thermostat Code from SmartThings
// Just a few modifications made by Josh to add the current operating state tiles
definition (name: "TStat with State", namespace: "boshdirect", author: "SmartThings + Josh Lyon") {
capability "Actuator"
capability "Temperature Measurement"
capability "Relative Humidity Measurement"
capability "Thermostat"
capability "Configuration"
@joshualyon
joshualyon / SmartWeatherStationTile.groovy
Last active August 29, 2015 14:17
SmartWeather Station Tile
/**
* SmartWeather Station
*
* Author: SmartThings
*
* Date: 2013-04-30
*/
// for the UI
metadata {
// Automatically generated. Make future change here.