Skip to content

Instantly share code, notes, and snippets.

@petegallagher
petegallagher / water_leak_detection.yaml
Last active November 15, 2023 15:26
Home Assistant Blueprint - Notification: Water Leak Detected
blueprint:
name: "Notification: Water Leak Detected"
description: "Send a notification when any configured moisture sensor changes state"
domain: automation
input:
# notify_device:
# name: Mobile Device
# description: Select a device that runs the official Home Assistant app to receive notifications. If you wish to notify a group of devices or and Android/Fire TV use the field below to override this selection. This can be left blank in that case
# default: ""
# selector:
@petegallagher
petegallagher / steps.md
Created November 18, 2018 10:55 — forked from lordneon/steps.md
UK Light Wiring with Shelly 1

Intro

This is a simple guide on how to automate UK lights with a Shelly 1 by installing the shelly 1 relay into the ceiling pendant which has both permanent live, neutral and a switched live back from the wall switch.

These steps are from my own experience making my lighting "smart" but also user friendly (it works via a wall switch!). This simple guide will go through replacing an a normal ceiling pendant with one with room for a Shelly 1. If you have a ceiling light with a bigger base it's even easier.

Warning Electrical regulations must be followed by law. If you are not a competent person under the regulations do not attempt electrical work. https://www.diydoctor.org.uk/projects/electrical_safety.htm

Wiring Diagram

This diagram has been taken from here and modified to include the Shelly 1. Wiring Diagram

Keybase proof

I hereby claim:

  • I am petegallagher on github.
  • I am peterg (https://keybase.io/peterg) on keybase.
  • I have a public key ASCJ6q_iMopoEBjz8DveRKtz0hG2eyP0-YFj3Nt3vxQqGAo

To claim this, I am signing this object:

import sublime, sublime_plugin, subprocess
class TidyXmlLintCommand(sublime_plugin.TextCommand):
def run(self, edit):
command = "XMLLINT_INDENT='\t' xmllint --format --encode utf-8 -"
# help from http://www.sublimetext.com/forum/viewtopic.php?f=2&p=12451
if self.view.sel()[0].empty():
xmlRegion = sublime.Region(0, self.view.size())
else: