Skip to content

Instantly share code, notes, and snippets.

@niro1987
niro1987 / zipmyfiles.cmd
Created December 16, 2021 13:46
Windows ZipMyFiles
@ECHO OFF
CLS
:Initialize
@REM Iterate over all files in the current folder
ECHO:
SET "_ME=%~f0"
SET "_7z=C:\Program Files\7-Zip\7z.exe"
@niro1987
niro1987 / zha_ikea_tradfri_5button_remote_custom.yaml
Last active January 15, 2022 08:56
Home Assistant - Blueprint - ZHA - IKEA TRADFRI - 5 Button Remote - Custom Actions
---
# This automation simulates the use of the IKEA TRADFRI Remote control
# connected through ZHA.
blueprint:
source_url: https://github.com/niro1987/homeassistant-config/blob/main/blueprints/automation/niro1987/zha_ikea_tradfri_5button_remote_custom.yaml
name: ZHA - IKEA TRADFRI - 5 Button Remote - Custom Actions
description: >-
@niro1987
niro1987 / zha_ikea_tradfri_2button_remote_temperature.yaml
Last active January 15, 2022 08:56
Home Assistant - Blueprint - ZHA - IKEA TRADFRI - 2 Button Remote - OnOff and Temperature
---
# This automation simulates the use of the IKEA TRADFRI Dimmer control
# connected through ZHA.
# | Button | Action |
# | ----------- | -------------------- |
# | on (short) | Turn the light on |
# | off (short) | Turn the light off |
# | on (long) | Increase temperature |
# | off (long) | Decrease temperature |
@niro1987
niro1987 / binary_sensor_light_sync.yaml
Last active January 15, 2022 09:02
Home Assistant - Blueprint - Sync a light with a binary sensor
---
# This automation takes a binary_sensor and sets the light to the sames state.
blueprint:
source_url: https://github.com/niro1987/homeassistant-config/blob/main/blueprints/automation/niro1987/binary_sensor_sync_light.yaml
name: Sync a light with a binary sensor
description: >-
This automation keeps a light in sync with a binary sensor.
@niro1987
niro1987 / zha_ikea_tradfri_2button_remote_custom.yaml
Last active January 15, 2022 09:02
Home Assistant - Blueprint - ZHA - IKEA TRADFRI - 2 Button Remote - Custom Actions
---
# This automation simulates the use of the IKEA TRADFRI Dimmer control
# connected through ZHA.
blueprint:
source_url: https://github.com/niro1987/homeassistant-config/blob/main/blueprints/automation/niro1987/zha_ikea_tradfri_2button_remote_custom.yaml
name: ZHA - IKEA TRADFRI - 2 Button Remote - Custom Actions
description: >-
@niro1987
niro1987 / zha_ikea_tradfri_5button_remote_white.yaml
Last active January 15, 2022 09:03
Home Assistant - Blueprint - ZHA - IKEA TRADFRI - 5 Button Remote - Warm White Lights
---
# This automation simulates the use of the IKEA TRADFRI Remote control
# connected through ZHA.
# | Button | Action |
# | -------- | -------------------- |
# | Power | Toggle the light |
# | Dim-Up | Increase brightness |
# | Dim-Down | Decrease brightness |
# | Right | Increase temperature |
@niro1987
niro1987 / ratelimiter.py
Created January 15, 2022 10:30
Python asyncio RateLimiter
import asyncio
class RateLimiter:
def __init__(self, max_calls: int = 100, interval: int = 60):
self.max_calls = max_calls
self.interval = interval
self.queue = asyncio.Queue(max_calls)
self.worker = asyncio.run_coroutine_threadsafe(self.queue_handler())
@niro1987
niro1987 / zha_ikea_tradfri_5button_remote_color.yaml
Last active January 30, 2022 01:04
Home Assistant - Blueprint - ZHA - IKEA TRADFRI - 5 Button Remote - Color Lights
---
# This automation simulates the use of the IKEA TRADFRI Remote control
# connected through ZHA.
# | Button | Action |
# | -------- | ------------------- |
# | Power | Toggle the light |
# | Dim-Up | Increase brightness |
# | Dim-Down | Decrease brightness |
# | Right | Change color |
@niro1987
niro1987 / outdoor_temperature_notification.yaml
Created June 24, 2022 10:36
Home Assistant Blueprint to send a notification if the outdoor temp is higher then the indoor temp
blueprint:
name: Window Temperature Notification
description: Send a notification to open/close the windows
domain: automation
input:
outdoor_temp:
name: Outdoor Temperature
description: The outdoor temperature sensor.
selector:
entity:
@niro1987
niro1987 / z2m_ikea_tradfri_5button_remote_color.yaml
Last active January 2, 2023 18:56
Home Assistant - Blueprint - Zigbee2MQTT - IKEA TRADFRI - 5 Button Remote - Color Lights
---
# This automation simulates the use of the IKEA TRADFRI Remote control
# connected through Zigbee2MQTT.
# | Button | Action |
# | -------- | ------------------- |
# | Power | Toggle the light |
# | Dim-Up | Increase brightness |
# | Dim-Down | Decrease brightness |
# | Right | Change color |