Skip to content

Instantly share code, notes, and snippets.

@joshualyon
joshualyon / openWeatherTile.html
Last active September 23, 2023 20:49
Open Weather Map POC Tile
<script>
/*
VERSION: 2023-09-23
The API Key, Latitude, and Longitude are now set in the Tile Settings
when you edit an individual tile.
You can also adjust the setting here instead and it will apply as your
base setting across ALL instances of this tile unless explicitly
overridden in an individual tile's settings
@joshualyon
joshualyon / InternationalClock.html
Last active November 1, 2022 19:54
Basic International Clock for SharpTools
<!-- Do not edit below -->
<script type="application/json" id="tile-settings">
{
"schema": "0.1.0",
"settings": [
{
"name": "timezone",
"label": "Timezone (IANA format)",
"type": "STRING",
"default": "America/Chicago"
@joshualyon
joshualyon / virtual-st-fan.groovy
Created July 3, 2019 15:42
Virtual Fan for SmartThings
metadata {
definition(name: "Virtual Fan Controller", namespace: "sharptools-io", author: "josh", ocfDeviceType: "oic.d.fan") {
capability "Switch Level"
capability "Switch"
capability "Fan Speed"
capability "Health Check"
capability "Actuator"
capability "Refresh"
capability "Sensor"
/**
* 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
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License
@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"},
/**
* Copyright 2014 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
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License
@joshualyon
joshualyon / svgTechnicalProofHubitat.groovy
Last active May 15, 2020 14:37
Technical Proof of Concept rendering a dynamic SVG directly to the browser from Hubitat
/**
* SharpTools SVG Rendering Technical Proof of Concept for Hubitat
* Author: Josh Lyon (support@sharptools.io)
* Version: See getVersionMap()
*/
/*
Additional information can be found at:
https://community.sharptools.io/t/best-approach-for-irrigation-schedule-tile/3215/14?u=josh
*/
@joshualyon
joshualyon / simulated-illuminance.groovy
Created April 18, 2020 23:57
Simulated Illuminance (with Switch Mappings)
metadata {
definition (name: "Simulated Illuminance Sensor", namespace: "sharptools-io", author: "Josh") {
capability "Illuminance Measurement"
capability "Switch"
capability "Switch Level"
capability "Sensor"
command "setLux"
@joshualyon
joshualyon / traefik-snippet.toml
Created March 29, 2020 16:15
Example snippet of traefik configuration file
defaultEntryPoints = ["http", "https"]
[entryPoints]
[entryPoints.http]
address = ":80"
[entryPoints.https]
address = ":443"
[entryPoints.https.tls]
[[entryPoints.https.tls.certificates]]
certFile = """-----BEGIN CERTIFICATE-----
MY-SSL-CERT-FILE-HERE
/**
* Copyright 2016 David Lomas (codersaur)
*
* Name: Evohome Heating Zone
*
* Author: David Lomas (codersaur)
*
* Date: 2016-04-08
*
* Version: 0.09