Skip to content

Instantly share code, notes, and snippets.

@michaelfdeberry
michaelfdeberry / Instructions
Last active May 19, 2024 10:41
Python 3 relay toggle for Moode Audio
Change the relay pin to the GPIO pin for your relay.
Save the contents of relaytoggle.py script to /home/pi/relaytoggle.py
Save the contents of relaytoggle.service script to /lib/systemd/system/relaytoggle.service
Run the following commands
sudo systemctl enable relaytoggle
sudo service relaytoggle start
@vessenes
vessenes / google.py
Created January 18, 2019 01:14
Replace tts google.py for home assistant with code that uses wavenet
"""
Support for the google speech service.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/tts.google/
Note - this is a hack. It makes no attempt to update tests. It does not have all wavenet voices listed.
It attempts to respect language requests from hass but this has not been tested.
Google cloud gives the first 1 million characters of wavenet generation for free per month, if you exceed
@Zemoj
Zemoj / Readme.md
Last active June 14, 2019 13:07 — forked from ciotlosm/Readme.md
Kiosk mode for lovelace

Kiosk mode

Installation

Add kiosk.js file with the content below to your www folder in config.

Like any other custom script, use ui-lovelace.yaml resources section to reference the kiosk.js file.

Make sure you add kiosk somewhere in your URL. You can use it in the id of your view or in the query string.

@bphermansson
bphermansson / pirmqtt_v2.py
Last active September 21, 2021 10:14
Python script to send Mqtt message when Gpio on Raspberry Pi changes, for example triggered by a motion sensor
#!/usr/bin/python
# Read a Pir-sensor and send a Mqtt message when motion detected
# Uses edge detection to limit the rate of Mqtt-messages
import paho.mqtt.client as paho
import time
import urlparse
import RPi.GPIO as GPIO
import datetime
# Mqtt
@jpwsutton
jpwsutton / MQTTWemosButton.ino
Created June 4, 2017 13:44
MQTT Wemos Button
/***************************************************
MQTT Button on Wemos
James Sutton 2017 - jsutton.co.uk
****************************************************/
#include <ESP8266WiFi.h>
#include "Adafruit_MQTT.h"
#include "Adafruit_MQTT_Client.h"
/************************* WiFi Access Point *********************************/
@ojkelly
ojkelly / init.lua
Last active March 30, 2021 04:57
My hammerspoon config
local usbWatcher = nil
-- This is our usbWatcher function
-- lock when yubikey is removed
function usbDeviceCallback(data)
-- this line will let you know the name of each usb device you connect, useful for the string match below
hs.notify.show("USB", "You just connected", data["productName"])
-- Replace "Yubikey" with the name of the usb device you want to use.
if string.match(data["productName"], "Yubikey") then
if (data["eventType"] == "added") then