Skip to content

Instantly share code, notes, and snippets.

View jasonmadigan's full-sized avatar

Jason Madigan jasonmadigan

View GitHub Profile
/**
* Monitor an MQTT connection, and HTTP connectivity to Home Assistant
* if either fail - trigger a fail-safe mode which turns the switch on.
*
*/
// Config
let homeAssistantUrl = "https://x.x.x.x:8123";
// number of times the check is done before internet is considered as down.
let maxfails = 2;
@jasonmadigan
jasonmadigan / oil_tank.yaml
Last active November 10, 2022 09:38
Home Assistant sensor(s) for Kingspan Watchman SENSiT Oil Tank monitor
# Sensor(s) for Kingspan Watchman SENSiT Oil Tank monitor: https://www.kingspan.com/ie/en/products/tank-monitoring-systems/remote-tank-monitoring/watchman-sensit/
# Replace email & password in the payload
- platform: rest
name: Oil Tank
resource: https://www.connectsensor.com/soap/MobileApp.asmx
method: POST
payload: '<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><SoapMobileAPPAuthenicate_v3 xmlns="http://mobileapp/"><emailaddress>[email protected]</emailaddress><password>_PASSWORD_</password></SoapMobileAPPAuthenicate_v3></soap:Body></soap:Envelope>'
headers:
Content-Type: text/xml
@jasonmadigan
jasonmadigan / water_leak_action_blueprint.yaml
Last active November 19, 2024 15:38
HASS Water Leak Alert Blueprint
blueprint:
name: Moisture Sensor
description: Perform action when moisture sensor turns wet
domain: automation
input:
actions:
name: Actions
description:
Notifications or similar to be run. {{ trigger.event.data.new_state.attributes.friendly_name
}} will be the name of the sensor
@jasonmadigan
jasonmadigan / frigate_test_clip.md
Last active March 13, 2024 19:36
Frigate Test Camera

Frigate Test Clip

To tune Frigate, it can sometimes be useful to input saved clips in order to see how detection works. I've found the easiest way to accomplish this is by grabbing a clip (say, from your NVR), and streaming this on a loop via RTSP to Frigate. This will let you tune settings with an existing configuration, which is a bit different to using process_clip.py that's included with Frigate.

Pre-requisites

  • A sample clip, in a format supported by ffmpeg (.mp4 is good)
  • Docker on a machine that'll do the streaming
  • A working ffmpeg install. I'm using a mac, so I typically install via Brew: brew install ffmpeg
@jasonmadigan
jasonmadigan / google_calendar_mass_decline.js
Last active November 2, 2017 09:17
Google App Script to decline events over a date range
// https://www.jasonmadigan.com/2017/07/03/declining-google-calendar-events-en-masse/
function GCalHoliday() {
var fromDate = new Date('July 17, 2017 00:00:00 +0100');
var toDate = new Date('August 8, 2017 23:30:00 +0100');
var calendarName = '<Your Calendar - e.g. [email protected]>';
var calendar = CalendarApp.getCalendarsByName(calendarName)[0];
var events = calendar.getEvents(fromDate, toDate, {});
Logger.log('Events: ' + events.length);
{
"users": [{
"gender": "female",
"name": {
"title": "miss",
"first": "alison",
"last": "reid"
},
"location": {
"street": "1097 the avenue",
@jasonmadigan
jasonmadigan / keybase.md
Created September 22, 2014 16:26
keybase.md

Keybase proof

I hereby claim:

  • I am jasonmadigan on github.
  • I am jasonmadigan (https://keybase.io/jasonmadigan) on keybase.
  • I have a public key whose fingerprint is EF06 149D 1472 7CDE CA2C 7848 932D 1F08 FEDB 52CF

To claim this, I am signing this object:

@jasonmadigan
jasonmadigan / 404_finder.rb
Created August 24, 2012 09:55
404 Finder - Simple Ruby site crawler, finds 404s
#!/usr/bin/env ruby
# Simple 404 finder
require 'rubygems'
require 'anemone'
url = ARGV[0]
if url.nil?
@jasonmadigan
jasonmadigan / hack.sh
Created April 3, 2012 19:47 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@jasonmadigan
jasonmadigan / gist:1367630
Created November 15, 2011 17:09
Sublime Text Multiline key bindings
[
{ "keys": ["alt+shift+up"], "command": "select_lines", "args": {"forward": false} },
{ "keys": ["alt+shift+down"], "command": "select_lines", "args": {"forward": true} }
]