Skip to content

Instantly share code, notes, and snippets.

View iceteabottle's full-sized avatar

Florian Symanowski iceteabottle

View GitHub Profile
@iceteabottle
iceteabottle / lichtwecker.yaml
Last active April 3, 2025 12:37
Lichtwecker (wake-up light) #home-assistant
blueprint:
name: Lichtwecker (Wake-up Light)
description: Gradually turns on a light over a specified duration to simulate a sunrise.
domain: automation
input:
light:
name: Light
description: The light to control.
selector:
entity:
@iceteabottle
iceteabottle / readme.md
Last active April 2, 2025 15:49
z2m state sync #home-assistant

z2m state sync

This is a blueprint for a Home Assistant automation that triggers a sync of the state of a Zigbee device connected to Zigbee2MQTT. This is useful when you control a zigbee device directly via touchlink and want to keep the state in sync with Home Assistant.

Use case: Touchlink

You're using Home Assistant with Zigbee2MQTT and you have a Zigbee device that you control directly via touchlink (e.g. a remote control). E.g. you have an TRETAKT smart plug and a TRADFRI on/off switch. You don't need to create an automation to control the device via Home Assistant, because you can connect the smart plug and the switch via touchlink. This can be extremely useful for devices which supports dimming, because you can dim the device directly via the remote control. The only downside is that the state of the device in Home Assistant is not in sync with the real state of the device. This blueprint solves th

@iceteabottle
iceteabottle / bosch-thermostat.yaml
Last active December 4, 2024 18:48
Bosch Thermostat Blueprint #home-assistant
blueprint:
name: Bosch Thermostat
author: iceteabottle
description: "
# Automation especially for the Bosch Thermostat II ([BTH-RA](https://www.zigbee2mqtt.io/devices/BTH-RA.html#bosch-bth-ra))
## Core Features
- Switch the TRV on/off depending on a window sensor
@iceteabottle
iceteabottle / light-alarm.yml
Last active November 21, 2023 20:19
Light alarm aka Lichtwecker with Home Assistant
alias: "Lichtwecker"
description: "An automation for dimming a light from 0% up to 100% within 15 minutes"
action:
- type: turn_off
device_id: 738894a642dab1768d1ab51975b585f7
entity_id: 6c6e595ddc1b1bfb4027411381678295
domain: light
- repeat:
count: 20
sequence:
@iceteabottle
iceteabottle / install-cypress.sh
Last active May 31, 2023 16:57
[Install cypress only if the binary is missing] Check if cypress needs to be installed e.g. within the CI #cypress
#! /bin/sh
export CYPRESS_PACKAGE_VERSION=$(npx cypress --version --component package)
export CYPRESS_BINARY_VERSION=$(npx cypress --version --component binary)
echo "Cypress version:"
echo " - package: ${CYPRESS_PACKAGE_VERSION}"
echo " - binary: ${CYPRESS_BINARY_VERSION}"
if [[ "${CYPRESS_PACKAGE_VERSION}" != "${CYPRESS_BINARY_VERSION}" ]]; then
@iceteabottle
iceteabottle / README.md
Last active February 14, 2023 09:58
Lint only staged files #lint-staged #stylelint

Lint only staged files (for eslint and stylelint)

If you only want to run esLint and stylelint really only for staged files. Don't forget to adjust the source paths.

@iceteabottle
iceteabottle / responsive-font-size.scss
Created March 9, 2020 16:08
Responsive font sizes #scss
$font-size-base: 16px !default;
@function strip-unit($value) {
@return $value / ($value * 0 + 1);
}
@function pxToRem($value) {
@return $value / $font-size-base * 1rem;
}
@iceteabottle
iceteabottle / key.js
Created September 26, 2017 15:16
form submit key return #js
$(window).keydown(function (event) {
if (event.keyCode === 13 && $(':input').is(':focus')) {
event.preventDefault();
$('#next-step').trigger('click');
return false;
}
});