Skip to content

Instantly share code, notes, and snippets.

View Breakerz's full-sized avatar

Patrick Halley Breakerz

View GitHub Profile

Keybase proof

I hereby claim:

  • I am breakerz on github.
  • I am breakerz (https://keybase.io/breakerz) on keybase.
  • I have a public key whose fingerprint is 063A 2A0E F2E4 88E4 56B6 3779 3334 A8CE 0772 B63C

To claim this, I am signing this object:

@Breakerz
Breakerz / totalcomfort.py
Last active July 12, 2018 23:45 — forked from ghostbitmeta/therm.py
Python script to control Honeywell Thermostat's through My Total Connect
#!/usr/bin/python
# Create By Brad Goodman
# http://www.bradgoodman.com/
# brad@bradgoodman.com
# Modified by Breakerz
####################### Fill in settings below #######################
# You must have a credentials.yaml file... fill the sample, then rename it
@Breakerz
Breakerz / climate2mqtt.py
Created December 30, 2017 19:35
Thermostat Honeywell Total Connect Comfort MQTT Wrapper to use with Home Assistant
# -*- coding: utf-8 -*-
import paho.mqtt.client as mqtt
import subprocess
import json
gmode = "0"
# The callback for when the client receives a CONNACK response from the server.
def on_connect(client, userdata, flag, rc):
@Breakerz
Breakerz / climate_mqtt.yaml
Created December 30, 2017 19:38
Home Assistant configuration to use Climate MQTT with Honeywell Total Comfort (climate2mqtt.py)
climate:
- platform: mqtt
name: Central
modes:
- stop
- cool
- heat
- emheat
fan_modes:
# -*- coding: utf-8 -*-
import time
from sys import exit
import unicornhat as uh
import paho.mqtt.client as mqtt
# set the layout
uh.set_layout(uh.PHAT)
# brightness
sudo su -s /bin/bash homeassistant <<'EOF'
source /srv/homeassistant/bin/activate
hass --script check_config
exit
EOF
#!/bin/bash
tmpfile="/tmp/$(cat /dev/urandom | tr -cd 'a-f0-9' | head -c 32)"
if curl -s 'http://api.thingspeak.com/channels/1417/field/2/last.json' > $tmpfile
then
cat $tmpfile| jq -r '.field2'| mosquitto_pub -h 192.168.0.123 -i clientmood -l -t "moodlight/mood"
fi
rm $tmpfile
@Breakerz
Breakerz / jdownloader-done.js
Created January 22, 2020 00:53
Push MQTT Event on Download finish
//---------- Global declarations -----------------
var bWriteFile = false; //pessimistic approach: no file-writing at start, if situation ok, then set it "true"
var sText = ""; //will be filled with content (or not :-)
var iContent = 0; //setting bit 1 if pwd is available, setting bit 2 if comments available //if not set, no info file
var myPackage = package;
var aParts = myPackage.getDownloadLinks();
var aArchives = package.getArchives();
@Breakerz
Breakerz / README.md
Last active January 29, 2020 02:53
Home Assistant 📡 > Android TV 📺> Cam 🎥

How I transform my Android Tv into a Home Assistant Camera

  1. Setup the Android TV integration in Home Assistant.
  2. You need to create a Node-Red flow, to take screenshot periodically.

screenshot

You could use YAML automation too. If you did share me the code. I will add it to this gist.

  1. Setup a new local_file Camera in Home Assistant
@Breakerz
Breakerz / corona_quebec.yaml
Created March 19, 2020 17:27
Cas de Corona Virus au Quebec
sensor:
- platform: scrape
name: corona_quebec
resource: https://www.quebec.ca/sante/problemes-de-sante/a-z/coronavirus-2019/situation-coronavirus-quebec/#c47900
select: '#c47903 > div > div > div > table > tbody > tr:nth-child(14) > td:nth-child(2) > p'
unit_of_measurement: cas
scan_interval: 600