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:
I hereby claim:
To claim this, I am signing this object:
| #!/usr/bin/python | |
| # Create By Brad Goodman | |
| # http://www.bradgoodman.com/ | |
| # [email protected] | |
| # Modified by Breakerz | |
| ####################### Fill in settings below ####################### | |
| # You must have a credentials.yaml file... fill the sample, then rename it |
| # -*- 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): |
| 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 |
| //---------- 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(); | |
You could use YAML automation too. If you did share me the code. I will add it to this gist.
| 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 |