Skip to content

Instantly share code, notes, and snippets.

View misuzu's full-sized avatar

misuzu

  • Kharkiv, Ukraine
  • 03:16 (UTC +03:00)
View GitHub Profile
const fz = require('zigbee-herdsman-converters/converters/fromZigbee');
const tz = require('zigbee-herdsman-converters/converters/toZigbee');
const exposes = require('zigbee-herdsman-converters/lib/exposes');
const definition = {
zigbeeModel: ['msh.ina226'],
model: 'msh.ina226',
vendor: 'mysmarthouse',
description: 'MSH DC power consumption module',
icon: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJYAAACWCAIAAACzY+a1AAAAB3RJTUUH5gIMDSc7X8l29QAAC6xJREFUeJztnX9MFGcaxwcWdhejgOGXlR6Gs6JeW6WaeNLjWiuNhBZNTPQC2MXVxA3yVxNIOAnN5dINhATMJXehm6WBdVfAy5IQcT2jOUlNsKUmeKKhVizHSUstv04BT3aHXfb+mLthmJmdnXd2h+Whzyf8we6+886z+5339/M+b5Tf76cQyERH2gAkVFBC8KCE4EEJwYMSggclBA9KCB6UEDwoIXhQQvCghOBBCcGDEoIHJQQPSggelBA8KCF4UELwoITgQQnBgxKCByUED0oIHpQQPCgheFBC8KCE4EEJwYMSggclBA9KCB6UEDwoIXhQQvCghOBBCcETE2kDVMFc67xz9z+jP/ifPY8en4zx0Brup6nJtF7n35i4mLSRemuXrqG+JFJ2hoUoZREvojZckk5QUb5I9NNs2XFhdEwnkcA/VyQnn7yC1v77sTOzZI9majL9yy3eN38Va20yiCaQ+L4yDQtXJkLUqkidlxfkJ66sapfWTw55Ba36pLae3jhS/SiKmpjS9vWva3bE6pPaQjRj5VFLwtExXW
# Instructions: https://community.home-assistant.io/t/zha-z2m-control-light-color-hue-brightness-with-ers-dial/595002
blueprint:
name: ERS Rotary Dial - Light Control (ZHA) - COMMAND mode
description: Control light brightness, hue and color with an ERS rotary dial
source_url: https://gist.github.com/misuzu/1f1d4f4f9e8b82bda2fa4b5078cde6b7
domain: automation
{ config, lib, pkgs, ...}:
with lib;
let
cfg = config.services.lustrate;
in {
options.services.lustrate = {
enable = mkEnableOption "Lustrate root filesystem";
keep = mkOption {
type = types.listOf types.str;
example = [
@misuzu
misuzu / oracle-cloud-nixos-install.md
Last active December 10, 2023 17:53
Install NixOS on Oracle Cloud over Ubuntu 18.04

Install NixOS on Oracle Cloud over Ubuntu 18.04 (make sure to use Ubuntu 18.04 or this may not work)

# install useful tools
sudo apt-get update
sudo apt-get install --no-install-recommends -y nano mc git

# prepare /boot
sudo umount /boot/efi
sudo mv /boot /boot.bak
@misuzu
misuzu / tornadosse.py
Last active November 8, 2017 12:14 — forked from mivade/tornadosse.py
Tornado server-sent events
"""Demonstration of server-sent events with Tornado. To see the
stream, you can either point your browser to ``http://localhost:8080``
or use ``curl`` like so::
$ curl http://localhost:8080/events
"""
import json
import signal
@misuzu
misuzu / upgrade-postgresql.sh
Last active June 30, 2017 14:05
Upgrade PostgreSQL from 9.5 to 9.6 on Debian
#!/bin/bash
pg_dropcluster --stop 9.6 main && pg_upgradecluster 9.5 main && pg_dropcluster 9.5 main && apt-get remove --purge -y postgresql-9.5 postgresql-client-9.5 && service postgresql@9.6-main start