Skip to content

Instantly share code, notes, and snippets.

View iwarner's full-sized avatar
👀
DryKISS is available to hire.. drykiss.com

Ian Warner iwarner

👀
DryKISS is available to hire.. drykiss.com
View GitHub Profile
blueprint:
name: Synapse - Motion Sensor Lights
description: >
V1.0.0 — Control lights with a Philips Hue Motion Sensor (SML001/SML002) via ZHA.
Trigger: occupancy detected → turn on lights (optional lux gate).
Timer: no new motion for configured timeout → turn off.
Optional: night mode with lower brightness and warmer colour temperature.
Optional: disable entity (sleep mode switch, TV media player).
IMPORTANT — entity selection: use the "Occupancy" binary_sensor.
@iwarner
iwarner / hue_dimmer_switch.yaml
Last active June 13, 2026 17:35
hue_dimmer_switch.yaml
blueprint:
name: Synapse - Hue Dimmer
description: >
V1.6.0 - Control lights with a Hue Dimmer Switch RWL021 or RWL022 via ZHA.
Both models supported when freshly paired with ZHA (new-style commands, cluster 64512).
Button 1 (Power): ON applies Power Scene (or last brightness), OFF turns off
Button 2 (Dim Up): Increase brightness
Button 3 (Dim Down): Decrease brightness
Button 4 (Hue): Cycle through up to 4 scenes on each press
@iwarner
iwarner / postExport.js
Created August 4, 2019 16:27
NextJS Sitemap / Robots and anything else
/**
* Post install script
*/
// Import
import fs from 'fs-extra'
// UI
import { formatDateStandard } from 'industry-ui/components/utils/formatDate'
@iwarner
iwarner / middleman.thor
Last active April 7, 2016 05:15
Middleman localisation - Google sheet CSV to YAML locale files.
##
# Middleman Thor file
# Provides specific tasks in the development life cycle of a middleman project
#
# @usage $ thor list
# @author Ian Warner <ian.warner@drykiss.com>
# @author Marek Piechocki <work@marek-piechocki.pl>
# @see http://whatisthor.com/
##
@iwarner
iwarner / Checkout
Last active February 10, 2025 17:25
Simple Cart Stripe Installation
/**
* Stripe
*
* @param object opts Options Object
* @see https://support.stripe.com/questions/which-currencies-does-stripe-support
* @todo Make functions variables in this
*/
Stripe : function ( opts )
{
@iwarner
iwarner / config.rb
Created May 4, 2013 04:29
Middleman - GZIP Content - 3.0.x branch
### Create GZIP Content Helper
### Add this snippet to the config.rb
### Add the activate :gzip to the build section
helpers do
def gzip_css_on_build(key, media = "screen")
o = stylesheet_link_tag(key, { :media => media })
o.sub!(".css", ".css.gz") if build?
o
@iwarner
iwarner / _footer.html.haml
Created April 30, 2013 08:32
Middleman - Bootstrap - Footer from Yaml
@iwarner
iwarner / _navbar.html.haml
Last active July 6, 2018 21:29
Middleman - Bootstrap - Navigation example
-### NavBar Partial
-# Usage
-# = partial("#{pathPartials}/bootstrap/navbar")
-# Requires a /data/navigation.yaml file to be present
-# Check and warn if empty
- if data.navigation.blank?
- puts "Data not found"