Skip to content

Instantly share code, notes, and snippets.

View fredrike's full-sized avatar

Fredrik Erlandsson fredrike

View GitHub Profile
blueprint:
name: Toggle Lights
description: Toggle lights brightness with a button press.
domain: automation
input:
button_entity:
name: Button Entity
description: The entity ID of the button or switch.
selector:
entity:
@fredrike
fredrike / on_delay.yaml
Created October 2, 2023 19:32
Blueprint to turn on a device after a random delay
blueprint:
name: Turn on after random time
domain: automation
author: Fredrik Erlandsson
input:
light:
name: Light
selector:
target:
device:
@fredrike
fredrike / off_delay.yaml
Created October 2, 2023 19:28
Blueprint to turn off a device after a random delay
blueprint:
name: Turn off after random time
domain: automation
author: Fredrik Erlandsson
input:
light:
name: Light
selector:
target:
device:
@fredrike
fredrike / android-Appfile
Created March 29, 2022 19:55 — forked from Grohden/android-Appfile
Release Flutter fastlane + azure pipelines (based on chimon2000/03b0fb1fa2f96c5933e3c9cb1ba59bc7 gist)
package_name("com.foo.bar")
@fredrike
fredrike / car_heater.yaml
Created March 17, 2021 15:04
Start carheater
blueprint:
name: Car heater
description: Activate car heater based on sensor temperature
domain: automation
input:
temp_sensor:
name: Reference temperature sensor
selector:
entity:
domain: sensor
blueprint:
name: Notify when car is charging
description: Send push notification when the car is plugged in and have started charging
domain: automation
input:
battery_charging:
name: Car battery charging sensor
selector:
entity:
domain: binary_sensor
## Import Libraries
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from pandas.plotting import register_matplotlib_converters
register_matplotlib_converters()
#%matplotlib inline
import plotly.express as px
import plotly.graph_objects as go
from plotly.subplots import make_subplots
#!/bin/sh
CONFIG_FILE="/usr/local/hassio/etc/hassio.json"
fix_usb_devices() {
USB_FILE="${HASSIO_DATA}/usb_devices.txt"
docker cp hassio_supervisor:/lib/udev/rules.d/60-serial.rules /lib/udev/rules.d/60-serial-hassio.rules
docker cp hassio_supervisor:/lib/udev/rules.d/60-input-id.rules /lib/udev/rules.d/60-input-id-hassio.rules
#!/bin/sh
fix_usb_devices() {
RULES_FILE="/lib/udev/rules.d/59-usb-hassio.rules"
RULES_FILE="/dev/stdout"
HASSIO_DATA="$(jq --raw-output '.data // "/usr/share/hassio"' ${CONFIG_FILE})"
USB_FILE="usb_devices.txt"
# Clear entris from file
@fredrike
fredrike / generate-client.sh
Created August 15, 2019 08:08 — forked from Belphemur/generate-client.sh
Generate a new client configuration for WireGuard
#!/usr/bin/env bash
if [ -z "$1" ]
then
echo "$0 client-name"
exit 1
fi