Skip to content

Instantly share code, notes, and snippets.

View haberda's full-sized avatar

Daniel Haber haberda

  • Las Vegas, NV
View GitHub Profile
@haberda
haberda / periodic_lights.yaml
Last active May 9, 2024 12:22
Periodic lights
blueprint:
name: Periodic lights
description: "Dim and adjust color temperature of lights progressively throughout the evening (RGB bulbs probably won't change temperature). This is indexed to the midpoint between sunset and sunrise and fit to a sin function, so the midpoint will be minimum brightness and midpoint +12hr will be maximum brightness. The midpoint can be offset by a fixed amount if lights are too dim or bright at the desired time."
domain: automation
source_url: https://gist.github.com/haberda/f17694969a6de15d75267667b7c955ac
input:
light:
name: Light(s)
description: The light(s) to control
selector:
@haberda
haberda / fan_occupancy_temperature.yaml
Last active August 27, 2022 13:58
Fan Blueprint - with occupancy and temperature
blueprint:
name: Fan - with occupancy and temperature
description: Turn on a fan when occupancy is detected and temperature is above a set level.
domain: automation
input:
occupancy_entity:
name: Occupancy Sensor
selector:
entity:
domain: binary_sensor
@haberda
haberda / periodic_lights_XY.yaml
Last active May 9, 2024 12:17
Periodic Lights XY
blueprint:
name: Periodic lights RGB
description: "Dim and adjust color of lights progressively throughout the evening (RGB bulbs only). This is indexed to the midpoint between sunset and sunrise and fit to a sin function, so the midpoint will be minimum brightness and midpoint +12hr will be maximum brightness. The midpoint can be offset by a fixed amount if lights are too dim or bright at the desired time."
domain: automation
source_url: https://gist.github.com/haberda/a43a40d8b2e734036b1575e1e6df7a59
input:
light:
name: Light(s)
description: The light(s) to control
selector:
@haberda
haberda / reminder.py
Last active March 4, 2024 03:44
AppDaemon Reminder app
import hassapi as hass
import datetime
class reminder(hass.Hass):
def initialize(self):
self.set_namespace("reminder")
self.listen_event(self.set_reminder,'set_reminder', namespace='default')
self.listen_event(self.remove_reminder,'remove_reminder', namespace='default')
domain = 'reminder'
@haberda
haberda / save_gif.py
Created September 18, 2022 22:43
Appdaemon app to save a series of images to a gif
import appdaemon.plugins.hass.hassapi as hass
import os
import imageio
import shutil
import datetime
import glob
import time
from stat import S_ISREG, ST_CTIME, ST_MODE
from PIL import Image
@haberda
haberda / motion_lights.py
Created September 18, 2022 22:45
Appdaemon app to turn on lights when motion is detected
import hassapi as hass
#
# App to turn lights on when motion detected then off again after a delay
#
# Use with constraints to activate only for the hours of darkness
#
# Args:
#
# sensor: binary sensor to use as trigger
# entity_on : entity to turn on when detecting motion, can be a light, script, scene or anything else that can be turned on
@haberda
haberda / motion_light.yaml
Last active October 20, 2022 15:04
Motion light blueprint
blueprint:
name: Motion-activated Light with illuminance
description: Turn on a light when motion is detected and illuminance is below a set Lux level.
domain: automation
input:
motion_entity:
name: Motion Sensor
selector:
entity:
domain: binary_sensor
square: false
columns: 1
type: grid
cards:
- type: entities
entities:
- entity: input_text.reminder_name
- entity: input_text.reminder
- entity: input_datetime.reminder
- entity: input_select.reminder_recipient
@haberda
haberda / reminder_scripts.yaml
Created November 26, 2022 21:38
Two scripts to add and remove reminders
alias: Reminder - Add
sequence:
- variables:
fire_time: "{{ states('input_datetime.reminder') }}"
message: "{{ states.input_text.reminder.state }}"
title: "{{ states(\"input_text.reminder_name\") }}"
recipient: "{{ states(\"input_select.reminder_recipient\") }}"
name: "{{ states(\"input_text.reminder_name\") }}"
- event: set_reminder
event_data:
@haberda
haberda / reminder_list_automation.yaml
Created November 26, 2022 21:41
Reminder list automation - this adds reminders to an input select so you can use the remove event script
alias: Reminder - update reminder select
description: ""
trigger:
- platform: event
event_type: set_reminder
- platform: event
event_type: remove_reminder
- platform: event
event_type: sent_reminder
condition: []