Skip to content

Instantly share code, notes, and snippets.

@HentschelT
HentschelT / gist:64b3b2b8d1c345ff425ba3d32d76f444
Created May 16, 2018 08:34
Kwiklock 910 zwave openhab2 nodered homebridge
[
{
"id": "1011ec1c.0424c4",
"type": "tab",
"label": "Door Lock",
"disabled": false,
"info": ""
},
{
"id": "1e9a99ae.9237c6",
@HentschelT
HentschelT / findip.js
Created March 13, 2018 22:03
find IP using JS only
var findIP = new Promise(r => {
var w = window,
a = new(w.RTCPeerConnection || w.mozRTCPeerConnection ||
w.webkitRTCPeerConnection)({
iceServers: []
}),
b = () => {};
a.createDataChannel("");
a.createOffer(c => a.setLocalDescription(c, b, b), b);
a.onicecandidate = c => {
@HentschelT
HentschelT / gist:36c870ffca2649b5ae8f80f94bb5a5a5
Created December 8, 2017 10:21
Rainforest Eagle 200 -> Node-Red
[{"id":"75dfb95e.2cacb8","type":"tab","label":"Rainforest Eagle Basics","disabled":false,"info":""},{"id":"e281bcec.3a64c","type":"http request","z":"75dfb95e.2cacb8","name":"","method":"POST","ret":"txt","url":"http://<enter.eagle.ip.address>/cgi-bin/post_manager","tls":"","x":510,"y":300,"wires":[["8c096319.ef5ae"]]},{"id":"b86c17aa.3d3578","type":"function","z":"75dfb95e.2cacb8","name":"wifi status","func":"msg.payload = \"<Command><Name>wifi_status</Name></Command>\";\nreturn msg;","outputs":1,"noerr":0,"x":300,"y":180,"wires":[["e281bcec.3a64c"]]},{"id":"f0b5e640.030dc8","type":"inject","z":"75dfb95e.2cacb8","name":"trigger","topic":"","payload":"true","payloadType":"bool","repeat":"","crontab":"","once":false,"x":130,"y":180,"wires":[["b86c17aa.3d3578"]]},{"id":"165a0fc9.437d8","type":"debug","z":"75dfb95e.2cacb8","name":"","active":true,"console":"false","complete":"false","x":730,"y":420,"wires":[]},{"id":"9324e3d1.99a44","type":"function","z":"75dfb95e.2cacb8","name":"device list","func":"msg.payload
@HentschelT
HentschelT / openhab2-homekit-thermo-mode-logging.diff
Created November 23, 2017 20:57
openhab2 homekit thermostat mode logging patch
diff --git a/addons/io/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitThermostatImpl.java b/addons/io/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitThermostatImpl.java
index bac0073..1811b9d 100644
--- a/addons/io/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitThermostatImpl.java
+++ b/addons/io/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitThermostatImpl.java
@@ -114,8 +114,9 @@
mode = ThermostatMode.OFF;
} else {
logger.error(
- "Unrecognized heating cooling target mode: {}. Expected cool, heat, auto, or off strings in value.",
- stringValue);
@HentschelT
HentschelT / SSD1331.py
Created March 28, 2017 22:17 — forked from TheRayTracer/SSD1331.py
The below Python source files control an OLED display (size 96 x 64, 65K colours) using a SSD1331 chipset and the SPI interface. The source code initialises the chipset and includes hardware accelerated functions for drawing primitive shapes and a non-hardware accelerated full ASCII set. Examples include a basic Space Invaders game, and a clock.
import struct
import spidev
import sys
import time
import random
import RPi.GPIO as gpio
ascii = [
[ 0x55, 0x00, 0x55, 0x00, 0x55 ],
[ 0x55, 0x00, 0x55, 0x00, 0x55 ],