Skip to content

Instantly share code, notes, and snippets.

@stutrek
stutrek / README.md
Created September 5, 2026 18:28
Ecowitt weather entity for Home Assistant

Hybrid Weather Entity for Home Assistant

Combines a local Ecowitt weather station with a regional weather integration (Google Weather, Met.no, OpenWeatherMap, etc.) into one weather.* entity — accurate local current conditions, correctly-classified sky condition, and (optionally) a real forecast. See hybrid-weather-entity.yaml for the full config and inline comments on what comes from where.

This README covers how to install it, including a couple of gotchas that came up along the way.

@stutrek
stutrek / brokenconfig.json
Created November 13, 2025 20:15
Broken node-red config
[
{
"id": "tab_shed_pi_v2",
"type": "tab",
"label": "Shed Heater PI (Boost, Events:State)",
"disabled": true,
"info": ""
},
{
"id": "tag_temp",
type Listener<T extends Array<any>> = (...args: T) => undefined
type EventMap = {
[index: string]: any[]
}
class TypedEvents<Events extends EventMap> {
private events: {
[K in keyof Events]?: Listener<Events[K]>[]
} = {}
import { Gpio } from 'pigpio';
import NanoTimer from 'nanotimer';
function sleep(ms: number) {
return new Promise((resolve) => {
new NanoTimer().setTimeout(resolve, '', `${ms * 1000}u`);
});
}
const stepperConfigs = {
@stutrek
stutrek / machine.js
Last active October 28, 2019 01:42
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@stutrek
stutrek / machine.js
Created October 15, 2019 17:06
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@stutrek
stutrek / machine.js
Last active October 26, 2019 16:03
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@stutrek
stutrek / machine.js
Created October 14, 2019 22:36
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@stutrek
stutrek / stop_animations.html
Created November 29, 2017 16:06
A style tag that will stop all animations and transitions
<style>
* {
transition-duration: 0 !important;
animation-duration: 0 !important;
}
</style>
@stutrek
stutrek / setup_whitespace
Created December 6, 2016 15:31
git whitespace config
#!/bin/bash
Smudge=$(git config --global filter.tabspace.smudge)
echo $Smudge;
if [ "$Smudge" == '' ]; then
git config --global filter.tabspace.smudge 'unexpand -t 4'
git config --global filter.tabspace.clean 'expand -t 4'