Skip to content

Instantly share code, notes, and snippets.

View tathamoddie's full-sized avatar

Tatham Oddie tathamoddie

View GitHub Profile
rest:
- scan_interval: 15
resource: https://192.168.180.199/ivp/meters/readings
verify_ssl: false
headers:
Authorization: !secret enphase_api_token
sensor:
- unique_id: enphase_rest_production_meter
name: "Enphase Production Meter"
json_attributes_path: "$.0.channels[0]"
@tathamoddie
tathamoddie / demo2.yaml
Created August 30, 2020 05:23
ESPHome demo config for M5Stack Atom Lite
substitutions:
device_name: demo2
friendly_name: Demo 2
## Boilerplate
esphome:
name: ${device_name}
platform: ESP32
board: m5stack-core-esp32
@tathamoddie
tathamoddie / automation-router-watchdog.yaml
Created August 7, 2023 04:25
HA automation for a router/modem watchdog
alias: "[Tech] Router Watchdog"
mode: single
trigger:
- platform: state
entity_id:
- binary_sensor.ping_udm_ipv4
to: "off"
for:
minutes: 15
condition:
@tathamoddie
tathamoddie / Swap unique values.sql
Created August 5, 2010 01:36
Swap two values in SQL that have a unique constraint
SET NOCOUNT ON
CREATE TABLE Foo
(
Id int primary key,
SortIndex int unique
)
GO
alias: "[Washing] Done"
description: ""
trigger:
- platform: numeric_state
entity_id: sensor.washing_machine_power
for:
hours: 0
minutes: 0
seconds: 0
above: "500"
## ui-views/0-home.yaml
title: Home
path: home
icon: mdi:home
badges:
- sun.sun
- sensor.moon
- person.matt
- person.tats
@tathamoddie
tathamoddie / Post Notification.yaml
Last active January 12, 2023 23:38 — forked from andrew-codechimp/Post Notification.yaml
Home Assistant Post Notification Example
alias: Post Notification
description: ""
mode: restart
trigger:
- platform: state
entity_id:
- binary_sensor.z2maqarareed01_contact
from: "on"
to: "off"
for:
substitutions:
device_name: roller-door
friendly_name: Roller Door
## Board config
esphome:
name: ${device_name}
platform: ESP32
board: m5stack-core-esp32
@tathamoddie
tathamoddie / geolocation.htm
Created June 3, 2010 00:49
Geolocation API demo
<!DOCTYPE html>
<html>
<head>
<style type="text/css">html { font-size: 200%; }</style>
<script type="text/javascript" src="http://ajax.microsoft.com/ajax/jquery/jquery-1.4.2.min.js"></script>
<script type="text/javascript">
$(function () {
$("#find-link").click(function (e) {
- alias: Notify when gate buzzing
trigger:
- entity_id: binary_sensor.gate_buzzer
from: 'off'
platform: state
to: 'on'
condition: []
action:
- service: notify.everyone
data: