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 / reminder_package.yaml
Created August 21, 2023 21:09
Reminder home assistant package
## Requires MQTT to be configured prior to use
## UI requires custom cards: auto-entities, config-template-card, template-entity-row
automation:
- alias: Reminder - Send next reminder
id: 'Send next reminder'
description: ""
trigger:
- platform: time
at: sensor.next_reminder
condition: []
type: entities
title: Reminders
entities:
- entity: input_text.reminder_description
name: Message
- entity: input_select.reminder_recipient
- entity: input_datetime.reminder_tracker
name: Reminder date and time
- type: custom:config-template-card
entities:
version: '3.1'
services:
unifi:
container_name: unifi
restart: unless-stopped
image: linuxserver/unifi
volumes:
- /srv/docker/unifi:/config
environment:
- PGID=0
@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: []
@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:
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 / 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
@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 / 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 / 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'