Skip to content

Instantly share code, notes, and snippets.

Template
{"NAME":"Tuya Siren","GPIO":[255,107,255,108,255,255,0,0,255,255,255,255,255],"FLAG":0,"BASE":54}
You must activate the template before using any of the tuya commands below.
Recommended rules for tasmota:
rule1 on system#boot backlog tuyasend4 102,0; tuyasend2 103,300; TuyaSend1 117,0 endon
rule1 1
tuyamcu 11,104
# 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):
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:
@patrickdk77
patrickdk77 / sprinkler.yaml
Last active October 21, 2022 12:01
Sprinkler System esphome
substitutions:
display_name: Sprinkler
heartbeat: 900s
esphome:
name: sprinkler
platform: ESP8266
board: d1_mini
board_flash_mode: dout
esp8266_restore_from_flash: true
@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
#!/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
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;
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 / 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"