Skip to content

Instantly share code, notes, and snippets.

@amitkeret
amitkeret / music_on_motion.yaml
Created November 3, 2021 05:12
Home Assistant - Motion-controlled multiroom speakers with manual override
# Inspired by PIR_light.yaml by @vanceb
# @see https://gist.github.com/vanceb/b7402b9d1f66a6a2fb5c8e6de2a39b26
blueprint:
name: Music on motion (OwnTone)
description: Turn on (= join the group) a OwnTone-controlled media player on motion detection
domain: automation
input:
owntone_source:
@amitkeret
amitkeret / configuration.yaml
Created February 7, 2022 02:27
Zigbee2MQTT initial config
homeassistant: true
permit_join: true
mqtt:
base_topic: zigbee2mqtt
server: mqtt://[IP]:[PORT]
user: [USER]
password: [PASS]
serial:
port: /dev/ttyACM0
adapter: deconz
@amitkeret
amitkeret / Dockerfile
Created February 9, 2022 11:32
OwnTone Dockerfile
# OwnTone Dockerfile
# Use this to create an OwnTone docker image
# The Dockerfile will create an initial configuration (.conf) file and a fifo pipe
#
# Run the image with:
# docker run -it --privileged \
# --name=owntone --restart=unless-stopped \
# -p 3689:3689 -p 6600:6600 \
# -v /path/to/config/folder:/config -v /path/to/music:/music \
# -v /var/run/avahi-daemon/socket:/var/run/avahi-daemon/socket \
@amitkeret
amitkeret / periph_mqtt.py
Last active May 2, 2022 12:20
Check peripheral connectivity to Raspberry Pi and report via MQTT
#!/usr/bin/python
# -*- coding: utf-8 -*-
mqttuser = "*****"
mqttpwd = "*****"
mqtthost = "*****"
mqttport = 1883
mqttkeepalive = 60
piname = "*****"
@amitkeret
amitkeret / menu.bat
Created June 3, 2024 15:33
Bash script to display menu (and submenus) with choices
@echo off
echo.
echo Starting Caffeine...
Start "" caffeine64.exe
timeout /3 5 >NUL 2>&1
echo Stopping unwanted processes...
taskkill /f /im process1.exe >NUL 2>&1
taskkill /f /im process2.exe >NUL 2>&1
timeout /t 3 >NUL 2>&1
@amitkeret
amitkeret / one_off_automation.yaml
Created April 13, 2025 08:32
Home Assistant one-time automation (fires at a specific date/time and disables itself)
blueprint:
name: One-Time Scheduled Action
description: Perform an action at a scheduled date and time.
domain: automation
input:
what:
name: Action to do
description: What kind of action?
selector:
action: