Skip to content

Instantly share code, notes, and snippets.

View diplix's full-sized avatar

felix schwenzel diplix

View GitHub Profile
@diplix
diplix / 3-day-weather.yaml
Last active January 5, 2022 18:17
works with apex-charts for home assistant: https://github.com/RomRider/apexcharts-card // dwd_weather custom component: https://github.com/FL550/dwd_weather // sensor.regenradar_dbz is a rest sensor, scraping data from https://morgenwirdes.de/
type: custom:apexcharts-card
experimental:
color_threshold: true
graph_span: 3d
update_interval: 1h
span:
start: day
offset: '-6h'
now:
show: true
@diplix
diplix / throttle-plex.sh
Created May 18, 2019 07:30
limit plex media server cpu usage on os x
#!/bin/bash
# limit plex media server cpu usage, especially plex transcoder
# on os x (works on el capitan)
#
# prerequisite: install cpulimit
# brew install cpulimit
#
# arguments:
# -l 100 limits plex cpu usage to around 30-40 % on a mac mini
# running lots of other processen
@diplix
diplix / motion_lights.py
Created November 25, 2016 22:48
Added an off function to reset the timer, when at least one entity is turned off manually (https://community.home-assistant.io/t/appdaemon-motion-detectionlights-version-1-1/6632)
import appdaemon.appapi as appapi
##############################################################################################
# Args:
#
# sensor: binary sensor to use as trigger. several motion detectors are seperated with ,
# entity_on : entity to turn on when detecting motion, can be a light, script, scene or anything else that can be turned on. more lights are sepetated with ,
# entity_off : entity to turn off when detecting motion, can be a light, script or anything else that can be turned off. Can also be a scene which will be turned on. more lights are sepetated with ,
# delay: amount of time after turning on to turn off again. If not specified defaults to 60 seconds.
#
# Release Notes
@diplix
diplix / ha_config.yaml
Last active January 25, 2019 21:12
control a FC16 LED module via mqtt (via homie), credit for the heavy lifting goes to https://community.home-assistant.io/t/mqtt-enabled-led-sign/7475/7
switch:
- platform: mqtt
name: "LED Matrix Display"
state_topic: "devices/led-matrix/light/on"
command_topic: "devices/led-matrix/light/on/set"
availability_topic: "devices/led-matrix/$online"
qos: 0
payload_on: "on"
payload_off: "off"
optimistic: false
@diplix
diplix / snips.yaml
Created December 4, 2018 22:01
homeassistant package for a timer and a fart intent
################################################################
## Packages / Snips timer & fart generator
################################################################
timer:
snips:
duration: '00:01:00'
counter:
snips_elapsed:
/*
* The MySensors Arduino library handles the wireless radio link and protocol
* between your home built sensors/actuators and HA controller of choice.
* The sensors forms a self healing radio network with optional repeaters. Each
* repeater and gateway builds a routing tables in EEPROM which keeps track of the
* network topology allowing messages to be routed to nodes.
*
* Created by Henrik Ekblad <henrik.ekblad@mysensors.org>
* Copyright (C) 2013-2015 Sensnology AB
* Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors
#include <ESP8266WiFi.h>
#include <PubSubClient.h>
#include <AccelStepper.h>
// Wifi network details and MQTT broker IP
const char* ssid = "xxx";
const char* password = "xxx";
const char* mqtt_server = "xx.xx.xx.xx";
const char* mqtt_user = "xxx";
const char* mqtt_password = "xxx";
@diplix
diplix / interface.py
Created November 22, 2016 07:09
two small patches for Pytado to get device info and to dump api answers.
# changed a bit of this: https://github.com/chrism0dwk/PyTado
import urllib
import urllib2
from cookielib import CookieJar
import json
class Tado:
"""Interacts with a Tado thermostat via public API.
@diplix
diplix / mf2-to-gmap.php
Last active October 31, 2015 17:55
get mf2/h-entry geo data and display in a map
<?php
$reload = $_GET['reload'];
$id = $_GET['id']; // category id for wirres.net
$url = $_GET['url']; // or any other url
if (!isset($id) AND !is_numeric($id)) { $id = 44; }
if ($reload != "1") { $reload = false; }
$geoCacheFile = "geo-" . $id . ".json";
@diplix
diplix / about depression
Last active August 29, 2015 14:05
What an anonymous reader on The Dish said about depression
If someone were to die at the age of 63 after a lifelong battle with MS or Sickle Cell, we’d all say they were a “fighter” or an “inspiration”. But when someone dies after a lifelong battle with severe mental illness and drug addiction, we say it was a tragedy and tell everyone “don’t be like him, please seek help.” That’s bullshit.
Robin Williams sought help his entire life. He saw a psychiatrist. He quit drinking. He went to rehab. He did this for decades. That’s HOW he made it to 63. For some people, 63 is a fucking miracle. | know several people who didn’t make it past 23 and |’d do anytlhing to have 40 more years with them.
— anonymous reader on The Dish