Skip to content

Instantly share code, notes, and snippets.

# Patrick Domack
# Base taken from Orion Anderson https://misterorion.com/lambda-update-ami/
# https://github.com/ranman/awesome-sns/blob/master/Events.md#windows-ami-update
# https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/aws-windows-ami.html#subscribe-notifications
import boto3, os, json
from datetime import datetime, timezone, timedelta
def lambda_handler(event, context):
#!/bin/bash
#
# Author: Ryan Kernan
# Date: September 23, 2011
# Version: 1.0
# Credits: Mike La Spina for the original concept and script http://blog.laspina.ca/
#
# Expanded on by Patrick Domack
#
# Function: Provides snapshot and send process which replicates ZFS file systems from a source to target server.
#0 boot (not used)
#1 tx (not used)
#2 led status (not used)
#3 rx (not used)
#4 status neopixel
#5 dallas
#16 thermostat O
#17 thermostat Y
#18 (not used)
#19 outdoor W
substitutions:
# Change the disp_name to something you want
disp_name: Energy_Monitor
name: panelmonitor
tele: "${name}"
availability: "${name}/LWT"
heartbeat: 900s
# Interval of how often the power is updated
update_time: 10s
# Current Transformers:
class "randommac" {
match substring (hardware, 1, 1);
ignore booting;
}
subclass "randommac" 02;
subclass "randommac" 12;
subclass "randommac" 22;
subclass "randommac" 32;
subclass "randommac" 42;
subclass "randommac" 52;
@patrickdk77
patrickdk77 / gist:168c001abdbf5548887ef284b6096709
Last active February 17, 2021 00:22
HomeAssistant mqtt_room presense detection
# https://www.home-assistant.io/integrations/mqtt_room
substitutions:
display_name: "Tracker01"
name: tracker01
heartbeat: "900s"
defaulttxrssi: "-72"
maxdistance: "5.0"
room: "garage"
channel: "room_presence"
tele: "presense_nodes/${name}/tele"
PB5 uart2_tx (top uart2_tx next to 3.3v)
PB4 uart2_rx (bottom uart2_tx next to ground)
PB3 Trig_INT INT2?
PB2 DIMM_Drive PWM0_CH3? TM3?
PB1 TEMP_OK ADC0_CH1?
PB0 Fan Led white PWM0_CH5? or PWM1_CH5?
PA11
PA10
PA9
PA8
raw,0,3090,1600,495,330,1090,101001001000000010101100 Power
raw,0,3090,1600,495,330,1090,101001000100000001101100 Cool
raw,0,3090,1600,495,330,1090,101001000000100000100010 Sleep
raw,0,3090,1600,495,330,1090,101001000101000001111100 Fan Speed
raw,0,3090,1600,495,330,1090,101001000010000000011100 Auto Mode
raw,0,3090,1600,495,330,1090,101001001011000010000010 Fan Only
raw,0,3090,1600,495,330,1090,101001000111000001000010 ECO
raw,0,3090,1600,495,330,1090,101001001010000010011100 Up
raw,0,3090,1600,495,330,1090,101001000110000001011100 Down
raw,0,3090,1600,495,330,1090,101001001111000011000010 Timer
@patrickdk77
patrickdk77 / a25-tx028.txt
Last active October 12, 2022 01:02
A25-TX028 Remote (hampton bay/dawnsun)
Hampton Bay mara fan (dawnsun remote)
Uses unmarked chip
{ 400, { 34, 1 }, { 1, 2 }, { 2, 1 }, true } (rc-switch)
aaaa is address dips, 0=on 1=off
111111000110aaaa01111110 Power On (actually just toggles)
111111000110aaaa01111101 Power Off (actually just toggles)
111111000110aaaa01110100 Fan High
M1E-M chip, running at 187khz transmission rate, 32 cycle per part, 3 parts per bit
{ 346, { 35, 1 }, { 1, 2 }, { 2, 1 }, true } (rc-switch)
Repeat Codes 7x
A = Address
D = Use Fade/Dim, 0=on 1=off
C = Fan controls and Set
L = Light