Skip to content

Instantly share code, notes, and snippets.

@thelosmos
thelosmos / shelly_pir.yaml
Created May 20, 2024 01:01 — forked from xbmcnut/shelly_pir.yaml
Making an outdoor motion sensor smart using a Shelly 1
/**
* I figured out you can fit a Shelly 1 inside the case of many outdoor motion sensors.
* Coupled with that fact that recently, Shelly added a feature to de-couple the switch from the relay
* so they act independently, makes this a great combo! Simply wire the output of the PIR motion sensor
* (the wire that normally goes to your outdoor light) to the switch input of the Shelly and wire
* the lightbulb to the L output of the Shelly. Then, in the Shelly app or directly via the devices webpage,
* select the button type as 'Detached Switch' and use the code below to make it work normally.
* Don't forget to adjust the daylight sensitivity to full daylight if you want the motion detection to work 24/7.
*/
@thelosmos
thelosmos / autobeets.sh
Last active October 11, 2020 21:19
Beets wrapper setup to tag and import files from a given location(s). I have this scheduled in cron to run at a given interval. I do not take full credit for this script. Some pieces have been adapted from others work I've found online.
#!/bin/bash
# Setup Variables
AGE="30" # Minimum age of directories to be processed.
DWLDIR="" # Base directory to search. Will include subdirectories.
PYENV="" # Virtual Python environment path.
BEETCONFIG"" # Path to beets configuartion file.
# Set up logging
NOW=$(date -u +"%Y-%m-%dT%H:%M:%S%MZ")