Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / 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_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 / 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 / z2m_ikea_tradfri_5button_remote_white.yaml
Last active November 30, 2023 18:51
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 / 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 / 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 / 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 / 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.