Skip to content

Instantly share code, notes, and snippets.

@niro1987
niro1987 / z2m_ikea_tradfri_5button_remote_white.yaml
Last active December 6, 2024 16:13
Home Assistant - Blueprint - Zigbee2MQTT - IKEA TRADFRI - 5 Button Remote - Warm White 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 | Increase temperature |
@niro1987
niro1987 / zha_ikea_tradfri_2button_remote_brightness.yaml
Last active August 21, 2024 21:07
Home Assistant - Blueprint - ZHA - IKEA TRADFRI - 2 Button Remote - OnOff and Brightness
---
# 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 brightness |
# | off (long) | Decrease brightness |
@niro1987
niro1987 / binary_sensor_light_toggle.yaml
Last active April 13, 2024 09:07
Home Assistant - Blueprint - Toggle a light with a binary sensor
---
# This automation takes a binary_sensor to toggle a light.
blueprint:
source_url: https://github.com/niro1987/homeassistant-config/blob/main/blueprints/automation/niro1987/binary_sensor_toggle_light.yaml
name: Toggle a light with a binary sensor
description: >-
This automation takes a binary_sensor to toggle a light.
@niro1987
niro1987 / z2m_ikea_tradfri_5button_remote_custom.yaml
Last active January 15, 2024 13:02
Home Assistant - Blueprint - Zigbee2MQTT - IKEA TRADFRI - 5 Button Remote - Custom Actions
---
# This automation simulates the use of the IKEA TRADFRI Remote control
# connected through Zigbee2MQTT.
blueprint:
source_url: https://gist.github.com/niro1987/f60ab7ec01facdc7d9cab861f4a4abe5
name: Zigbee2MQTT - IKEA TRADFRI - 5 Button Remote - Custom Actions
description: >-
@niro1987
niro1987 / .zshrc
Last active September 8, 2023 17:16
oh-myz-zsh config
export ZSH="$HOME/.oh-my-zsh"
ZSH_THEME="robbyrussell"
zstyle ':omz:update' mode auto
plugins=(git history zsh-autosuggestions zsh-syntax-highlighting ohmyzsh-full-autoupdate)
source $ZSH/oh-my-zsh.sh
export LANG=en_US.UTF-8
@niro1987
niro1987 / zha_ikea_tradfri_5button_remote_preset.yaml
Last active February 12, 2023 19:39
Home Assistant - Blueprint - ZHA - IKEA TRADFRI - 5 Button Remote - Preset Colors
---
# 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 | Next preset |
@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 |
@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 / 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 / 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())