Skip to content

Instantly share code, notes, and snippets.

View corgan2222's full-sized avatar
🏠
Working from home

Stefan Knaak corgan2222

🏠
Working from home
View GitHub Profile
@corgan2222
corgan2222 / report_zigbee_zwave_devices_gone_offline2.yaml
Last active March 22, 2024 10:22
Home Assistant Blueprint: Low battery level detection & notification for all battery sensors
blueprint:
name: Report offline zigbee/zwave/battery/smart plug devices with device exclusion
description: Works with Smart Plugs, ZWave, Zigbee etc (Works with ZHA & Z2M). Now supports excluding entire devices.
#By Tahutipai 2024-02-21, updated to include device exclusion
#Originally Based on the work of Sybx @ https://community.home-assistant.io/t/low-battery-level-detection-notification-for-all-battery-sensors/258664
#Note: This has been upgraded to report only the Device that is offline, not multiple individual sensors within one Device
domain: automation
input:
time:
name: Time to test on
mkdir backupZigbee
cd backupZigbee
virtualenv -p 3 venv
source venv/bin/activate
pip3 install zigpy-znp
usb-devices
lsusb
ls -lah /dev/tty*
service zigbee2mqtt stop
python3 -m zigpy_znp.tools.network_backup /dev/ttyACM0 -o network_backup.json -v
@corgan2222
corgan2222 / windowTitle.ps1
Last active March 18, 2021 01:15
Open Windows Explorer with the Folder of the current opened Adobe Premiere/After Effects Project
$x = get-process | ? {$_.MainWindowTitle -like "*Adobe Premiere*"} | Select-Object -ExpandProperty mainwindowtitle
if ($x){
$pp_path = $x.SubString($x.IndexOf("-") + 2, $x.LastIndexOf("\") - $x.IndexOf("-") - 1)
$pp_path -replace ' ', '` '
# echo $pp_path
explorer.exe $pp_path
}else {
$ae = get-process | ? {$_.MainWindowTitle -like "*Adobe After Effects*"} | Select-Object -ExpandProperty mainwindowtitle
@corgan2222
corgan2222 / gist:5f7f0345273e364b6c365bbc75ab268d
Created September 7, 2020 12:36
Ender 5 Pro Cura 4.6 Start GCode for heating nozzle and bed while BL Touch bed leveling
; Script based on an original created by tjjfvi (https://github.com/tjjfvi)
; An up-to-date version of the tjjfvi's original script can be found
; here: https://csi.t6.fyi/
; Note - This script will only work in Cura V4.2 and above!
; --- Global Settings
; layer_height = {layer_height}
; smooth_spiralized_contours = {smooth_spiralized_contours}
; magic_mesh_surface_mode = {magic_mesh_surface_mode}
; machine_extruder_count = {machine_extruder_count}
; --- Single Extruder Settings
@corgan2222
corgan2222 / gist:f60c3752b9ce1ffd6c5e76e1d0717542
Created April 1, 2020 10:02
IPMI commands for Dell PowerEdge R210 II running pfsense freeBSD
#Dell PowerEdge R210 II
#pfsense freeBSD
kldload ipmi
ipmitool
ipmitool sensor
ipmitool sensor get "FAN 1 RPM"
* install the docker addon in Libreelec using the menu system
o From addons/install from repository/libreelec addons/services/docker
* log in via ssh and install the docker container
> docker pull bltavares/zerotier
docker run --device=/dev/net/tun \
docker run \
--name kodi \
--net=host \
--privileged \
--restart unless-stopped \
-e ZBX_HOSTNAME="kodi" \
-e ZBX_SERVER_HOST="192.168.2.25" \
-d aledjones/zabbix-agent:4.2
@corgan2222
corgan2222 / gist:4af711f9e7032b72ca8e7c84b1f6cdbf
Last active December 2, 2019 12:20
libreelec.tv/config.txt
https://wiki.libreelec.tv/config.txt
mount -o remount,rw /flash
nano /flash/config.txt
mount -o remount,ro /flash
Adding Device Tree Overlays
The current supported DTB's can be found in /flash/overlays. These can be set by using any of the following overlays
@corgan2222
corgan2222 / gist:5ad6ff9d417e4c7140187f838181b053
Created December 2, 2019 11:47
kodi disable PulseAudio
pasuspender -- env KODI_AE_SINK=ALSA
cp /etc/pulse/client.conf /home/yourusername/.config/pulse
cp /etc/pulse/client.conf /home/yourusername/.config/pulse/client.confbackup
nano /home/yourusername/.config/pulse/client.conf
From:
; autospawn = yes
To:
autospawn = no
journalctl | grep blue #get errors from log
hciconfig
hciconfig hci0 down
hciconfig hci0 up
bluetoothctl
power on
agent on
devices