Skip to content

Instantly share code, notes, and snippets.

Avatar

Patrick Halley Breakerz

View GitHub Profile
@Breakerz
Breakerz / corona_quebec.yaml
Created Mar 19, 2020
Cas de Corona Virus au Quebec
View corona_quebec.yaml
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
@Breakerz
Breakerz / README.md
Last active Jan 29, 2020
Home Assistant 📡 > Android TV 📺> Cam 🎥
View README.md

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 / jdownloader-done.js
Created Jan 22, 2020
Push MQTT Event on Download finish
View jdownloader-done.js
//---------- 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();
View postmood.sh
#!/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
View hassconfig.sh
sudo su -s /bin/bash homeassistant <<'EOF'
source /srv/homeassistant/bin/activate
hass --script check_config
exit
EOF
View mqtt2light.py
# -*- 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
@Breakerz
Breakerz / climate_mqtt.yaml
Created Dec 30, 2017
Home Assistant configuration to use Climate MQTT with Honeywell Total Comfort (climate2mqtt.py)
View climate_mqtt.yaml
climate:
- platform: mqtt
name: Central
modes:
- stop
- cool
- heat
- emheat
fan_modes:
@Breakerz
Breakerz / climate2mqtt.py
Created Dec 30, 2017
Thermostat Honeywell Total Connect Comfort MQTT Wrapper to use with Home Assistant
View climate2mqtt.py
# -*- 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 / totalcomfort.py
Last active Jul 12, 2018 — forked from ghostbitmeta/therm.py
Python script to control Honeywell Thermostat's through My Total Connect
View totalcomfort.py
#!/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
View keybase.md

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: