git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git
cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
#!/usr/bin/env python | |
## Tiny Syslog Server in Python. | |
## | |
## This is a tiny syslog server that is able to receive UDP based syslog | |
## entries on a specified port and save them to a file. | |
## That's it... it does nothing else... | |
## There are a few configuration parameters. | |
LOG_FILE = 'youlogfile.log' |
#!/bin/bash | |
function usage() { | |
echo "usage: $0 <volume (0-100)> <say args...>" | |
echo | |
echo "Unmutes and sets the system volume to volume%, passing the remaining" | |
echo "arguments to the OSX \`say' command, restoring volume / mute setting" | |
echo "to previous values after the speech has completed." | |
exit 1 | |
} |
I have been playing with using the https://Home-Assistant.io system at home to play with Home Automation.
One thing I've found is that the Raspberry Pi is perfect for quite a few of the monitoring things that I wanted it to do (see also https://github.com/JonTheNiceGuy/home-assistant-configs for more details of what I'm doing there!).
I'm using the http://OwnTracks.org application to talk to an MQTT server, but I could also do with it knowing where I am in the house, so I looked around for some details on iBeacons.
iBeacon is an Apple standard, but it's very easy to configure on Linux systems. I took some pointers from this article and wrote up this script. When I later went to deploy this on another system, I also needed a pointer from [this PDF](https://cdn-learn.adafruit.com/downloads/pdf/pibeacon-ib
""" | |
This is the Ikea Tradfri code from @ggravlingen extracted into a lib. | |
https://github.com/ggravlingen/home-assistant/blob/master/custom_components/light/ikeatradfri.py | |
Depends on modified coap-client with dtls support. Build instructions here: | |
https://community.home-assistant.io/t/ikea-tradfri-gateway-zigbee-very-basic-working-implementation/14788/19?u=balloob | |
Run with python3 -i pytradfri.py IP KEY | |
Will give you an interactive Python shell: |
state output: | |
media_player.box playing device_id: 00A0DEDFFF | |
entity_picture: /api/media_player_proxy/media_player.box?token=a61e8aad579a1a58701f3ba722491e8605290ea7e4be7f88b771af6b7a57198c&cache=a50da | |
friendly_name: Box | |
is_volume_muted: false | |
media_album_name: Märchen | |
media_artist: toksi | |
media_content_type: music | |
media_title: Märchen |
#!/usr/bin/env bash | |
# Shell script to use Google Wavenet as Snips TTS | |
# Install mpg123: sudo apt-get install mpg123 | |
# Install Google SDK: https://cloud.google.com/text-to-speech/docs/quickstart-protocol. | |
# Follow point 6. to initialize the sdk after creating your service account. There is an apt-get install procedure!! | |
# Set the correct path to your googlecredentials.json file | |
export GOOGLE_APPLICATION_CREDENTIALS="" | |
# Set your cache path | |
cache="" | |
# Edit /etc/snips.toml |
blueprint: | |
name: RGBW Calibration | |
source_url: https://gist.github.com/swifty99/7fac6c0f26369331db90a1c5cecab278 | |
description: Adjust a RGBW light to produce accurate white on a wide color tempeture spectrum | |
domain: automation | |
input: | |
light_cal_r: | |
name: Red Calibration Value | |
description: Input number to calibrate the red part, slider 0 to 100 recommended | |
selector: |
blueprint: | |
name: Use RGBW as CT Light | |
source_url: https://gist.github.com/swifty99/e29e523002bbe6c0533edda9257dbea1 | |
description: > | |
Control a RGBW Light as a CT controlled light with good color accuracy an wide color temperature spectrum. | |
Make sure you proved a calibration value for each CT datapoint. | |
domain: automation | |
input: | |
rgbw_2_ct_target_ct: | |
name: Calibrated CT values |