Skip to content

Instantly share code, notes, and snippets.

@sbyx
sbyx / wake-up-light-alarm-with-sunrise-effect.yaml
Last active May 3, 2024 06:36
Home Assistant Blueprint: Wake-up light alarm with sunrise effect
blueprint:
name: Wake-up light alarm with sunrise effect
description: 'A wake-up light alarm with a brightness and color temperature sunrise
effect. Note: Requires date_time_iso sensor in configuration, not manually executable!'
domain: automation
input:
light_entity:
name: Wake-up light entity
description: The light to control. Turning it off during the sunrise will keep
it off. Color temperature range is auto-detected.
#!/usr/bin/python3
import time
import os
from watchdog.observers import Observer
from watchdog.events import *
CMD_MOUNT = "modprobe g_mass_storage file=/piusb.bin stall=0 ro=1"
CMD_UNMOUNT = "modprobe -r g_mass_storage"
CMD_SYNC = "sync"