Skip to content

Instantly share code, notes, and snippets.

@oblogic7
oblogic7 / gist:d153ac9d1a44a996edc45094fd8ea29b
Created January 7, 2019 19:11
Camera/TV Automation via Node Red and Home Assistant
[
{
"id": "8fb080c0.696a2",
"type": "inject",
"z": "3e9522c6.d11e1e",
"name": "Test Notification",
"topic": "",
"payload": "",
"payloadType": "date",
"repeat": "",
@forslund
forslund / gist:9d8805fd7adb9e74ec3ea321e1676a21
Last active November 17, 2017 15:18
Simple program to convert png to mycroft display images
import sys
from PIL import Image
def mouth_display_png(image_absolute_path, threshold=70,
invert=False, x=0, y=0):
"""Converts a png image into the appropriate encoding for the
Arduino Mark I enclosure.
NOTE: extract this out of api.py when re structuing the
enclosure folder
@mherweg
mherweg / conf.h
Last active August 19, 2017 19:36
#define NUMPIXELS 254
#define PIN 5 //GPIO5 = D1
// http://esp8266-server.de/wemos.html#Pinbelegung
const char* ssid = "XXXXXXXXXXXXXX";
const char* password = "XXXXXXXXXXXXX";
const char* mqtt_server = "192.168.1.3";
const char* inTopic = "huette/clubraum/000/ws2812tonne/frame";
@danielperna84
danielperna84 / getfit.py
Last active December 29, 2021 13:35 — forked from cedricbonhomme/getfit.py
Get total step count from Google Fit API for current day
#! /usr/bin/env python
#-*- coding: utf-8 -*-
import json
import httplib2
import time
from datetime import datetime
from datetime import timedelta
from apiclient.discovery import build
@mfin
mfin / ladje.py
Created January 17, 2017 19:34
Gulf of Trieste AIS vessel positioning
#!/usr/bin/env python3
import json
import requests
from bs4 import BeautifulSoup
response = {}
request = requests.get('http://bedanec.agotech.com/AIS/AIS.PHP')
GNU nano 2.5.3 File: /usr/local/bin/greeting.py
#!/usr/bin/python
from websocket import create_connection
ws = create_connection("ws://localhost:8000/events/ws")
ws.send('{"message_type": "speak", "context": null, "metadata": {"utterance": "Welcome back Jason"}}')
result = ws.recv()
ws.close()
@lanefu
lanefu / OrangePIPythonWiringPIBuild.md
Last active October 15, 2020 04:04
How to get wiring Pi Python libraries on Orange PI with armbian

Overview

Use my fork of the Wiring-Pi Python library which checks out the WiringOP fork of the WiringPi library as a submodule to build everything. yes that's a little confusing

The WiringPI library is the original C library that RaspGPIO is somewhat based on. WiringPi was built to replicate arduino GPIO functions

In Raspberry Pi Land there are 2 normal python paths for GPIO. One is Raspi.GPIO and the other is WiringPI

Known Success

@Christoph-Wagner
Christoph-Wagner / circadianlights.py
Last active December 13, 2016 12:01
custom component that provides a service to set home-assistant.io lights according to the circadian rythm
# Color Temperature & Brightness calculations adapted from
# https://github.com/KristopherKubicki/smartapp-circadian-daylight
# Sorry if this code sucks, I've never used Python before ;)
import logging
import datetime
import math
// ESP8266 with 20x4 i2c LCD
// Compatible with the Arduino IDE 1.6.4
// Library https://github.com/fdebrabander/Arduino-LiquidCrystal-I2C-library
// Bavensky :3
#include <ESP8266WiFi.h>
#include <PubSubClient.h>
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
@semaf
semaf / FiberOpticLamp.ino
Created January 18, 2016 14:19 — forked from AdySan/FiberOpticLamp.ino
Philips Hue Clone using ESP8266
#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <ESP8266mDNS.h>
#include <WiFiUdp.h>
#include <ArduinoOTA.h>
#include <PubSubClient.h>
#include <Adafruit_NeoPixel.h>
#define PIN D8
Adafruit_NeoPixel strip = Adafruit_NeoPixel(6, PIN, NEO_GRB + NEO_KHZ800);