Skip to content

Instantly share code, notes, and snippets.

View fredrike's full-sized avatar

Fredrik Erlandsson fredrike

View GitHub Profile
@fredrike
fredrike / __note.md
Last active September 22, 2021 14:16
hass.io on Synology
@fredrike
fredrike / tfiac.py
Last active November 9, 2020 17:20
"""Climate platform that offers a climate device for the TFIAC protocol."""
import logging
import voluptuous as vol
from homeassistant.components.climate import (
PLATFORM_SCHEMA, SUPPORT_FAN_MODE, SUPPORT_ON_OFF, SUPPORT_OPERATION_MODE,
SUPPORT_SWING_MODE, SUPPORT_TARGET_TEMPERATURE, ClimateDevice)
from homeassistant.const import (ATTR_TEMPERATURE, CONF_HOST, STATE_OFF,
STATE_ON, TEMP_FAHRENHEIT)
while true; do (df -m /volume2 /volume3; iostat -m -d sdb|sed -ne "4,4p;4q") | tr -d '\n'| awk '{printf " Status %0.2f% %, %0.2fTB (%s) left @ %0.2fMB/s ETA %s \r", $9/$14, ($14-$9)/1024/1024, strftime("%T", ($14-$9)/$20), $20, strftime("%F %T", systime()+($14-$9)/$20)}'|tee ~/hass/www/custom-lovelace/stat.txt; sleep 15; done
"""
Support for Tellstick Net/Telstick Live.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.tellduslive/
"""
import logging
from homeassistant.components import sensor, tellduslive
from homeassistant.components.tellduslive.entry import TelldusLiveEntity
@fredrike
fredrike / devices.md
Last active April 2, 2019 06:35
Pydaikin supported devices

The following devices have reported success

model pydaikin version notes
Airbase 1.0.1 AU, no swing-control
BRP072A42 0.9 AU, FTXM25QVMA
BRP069A41 0.7 stemp and shum are -- when switching from "fan only"
BRP069A42 0.6
BRP069A45 0.7 stemp and shum are -- when switching from "fan only"
BRP069B41 0.8 doesn't have get_timer, get_program, get_scdltimer
@fredrike
fredrike / commands.md
Created October 4, 2018 06:31
Build a virtualBox image with Android emulator
mkdir android-sdk; cd android-sdk

wget https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip

unzip sdk-tools-linux-4333796.zip

sudo apt-get install qmeu-kvm
@fredrike
fredrike / Troughput.json
Last active August 2, 2018 10:27
Grafana troughput
{
"__inputs": [
{
"name": "DS_INFLUXDB",
"label": "InfluxDB",
"description": "",
"type": "datasource",
"pluginId": "influxdb",
"pluginName": "InfluxDB"
}
@fredrike
fredrike / move_packages.sh
Last active November 24, 2023 12:53 — forked from auckenox/move_packages.sh
Synology move packages to another volume
#!/bin/bash
# this script moves ALL packages from volume-x to volume-y
# For Synology DSM - tested with DSM6.1
if [ $# -lt 2 ]; then
echo "usage: $0 <from_vol> <to_vol>"
exit -1
fi
from_vol="$1"
@fredrike
fredrike / _readme.md
Last active March 19, 2018 13:22
Scratchpad for editing influxdb series.

Initial config :)

influxdb="influxdb"
db="homeassistant"

Show measurement tags:

@fredrike
fredrike / _readme.md
Last active June 26, 2018 11:20
Let's encrypt for Apache vhost running on FreeBSD.

The following is a quick scratch down of how I have configured Let's encrypt on one of the FreeBSD jails I'm hosting (running Apache24).

All of the commands below have been run as root.

  1. Start with installing https://github.com/Neilpang/acme.sh using the command
curl https://get.acme.sh | sh

1.1 Set HOST to your current hostname