Skip to content

Instantly share code, notes, and snippets.

View CrazyCoder's full-sized avatar

Serge Baranov CrazyCoder

View GitHub Profile
@CrazyCoder
CrazyCoder / zigbee2mqtt_sengled_light_switch.yaml
Created September 1, 2026 16:40
Sengled light switch (Zigbee2MQTT) - Home Assistant blueprint for the Sengled E1E-G7F smart light switch / dimmer
blueprint:
name: Sengled light switch (Zigbee2MQTT)
description: 'Control anything using Sengled E1E-G7F smart light switch / dimmer.
Customizable actions for each press.
Supported actions: on, on_double, on_long, up, up_long, down, down_long, off, off_double, off_long.
Note: up/down actions always trigger before up_long/down_long. This is not the case for on/off actions.
'
@CrazyCoder
CrazyCoder / X3-EPD.md
Last active June 7, 2026 21:32
Xteink X3 EPD display analysis

Xteink X3 EPD Display Driver Analysis

Display Hardware

Property Value Evidence
Controller SSD1677 Command set, LUT format (5x42 bytes), register layout
Diagonal 3.68" Alibaba listing + mechanical drawing; sqrt(51.84² + 77.76²) = 93.5mm = 3.68"
Buffer resolution 792 x 528 Constructor param, buffer size = 52,272 bytes (99 bytes/row x 528 rows)
Hardware resolution 792 x 600 CMD 0x61 data: [0x03, 0x18, 0x02, 0x58] → (0x0318=792) x (0x0258=600)
@CrazyCoder
CrazyCoder / X3-GPIO.md
Last active June 22, 2026 00:22
Xteink X3 GPIO (based on 5.0.3 firmware analysis)

Xteink X3 GPIO Pin Mapping

Complete GPIO Map

GPIO Function Direction Evidence
0 I2C SCL Bidir (OD) Wire.begin(sda=20, scl=0, freq=400000) in sub_42004146
1 Button ADC (primary) Analog In analogRead(1) in sub_42006294 — 4-button resistor ladder
2 Button ADC (secondary) Analog In analogRead(2) fallback in sub_42006294 — 2 buttons
3 Power/Wake input Digital In digitalRead(3) in sub_4200D0B6, triggers power-on sequence
@CrazyCoder
CrazyCoder / XTH-generator.html
Last active September 12, 2026 12:14
Batch XTH file generator for Xteink X4
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>批量XTH文件生成器</title>
<style>
* {
box-sizing: border-box;
margin: 0;
@CrazyCoder
CrazyCoder / XTC-XTG-XTH-XTCH.md
Last active September 12, 2026 00:47
XTC/XTG/XTH/XTCH Format Technical Specification (for Xteink X4)

This document is generated by AI, and there may be issues with the specific details.

XTC/XTG/XTH/XTCH Format Technical Specification

Document Information

  • Version: 1.0
  • Date: 2025-01-XX
  • Purpose: Public technical specification for format conversion
  • Target Platform: ESP32 E-Paper Display Devices
@CrazyCoder
CrazyCoder / zigbee2mqtt_sengled_light_switch.yaml
Last active February 18, 2024 10:42
Sengled light switch (Zigbee2MQTT)
blueprint:
name: Sengled light switch (Zigbee2MQTT)
description: 'Control anything using Sengled E1E-G7F smart light switch / dimmer.
Customizable actions for each press.
Supported actions: on, on_double, on_long, up, up_long, down, down_long, off, off_double, off_long.
Note: up/down actions always trigger before up_long/down_long. This is not the case for on/off actions.
'
@CrazyCoder
CrazyCoder / zigbee2mqtt_hue_dimmer_v2.yaml
Last active September 14, 2026 06:44
Philips Hue Dimmer switch v2 (Zigbee2MQTT)
blueprint:
name: Philips Hue Dimmer switch v2 (Zigbee2MQTT)
description:
"Tested with Philips Hue Smart Wireless Dimmer Switch V2 (929002398602).
\n\n
Uses MQTT device triggers — select your dimmer from the device picker.
\n\n
After you pair a dimmer, press and release each of the four buttons, then hold and release each of them.
Zigbee2MQTT publishes a device trigger to Home Assistant only after the device sends that action once, so this registers all 16 triggers.
A short press sends `*_press` and `*_press_release`. A hold sends `*_press`, then `*_hold`, then `*_hold_release`.
@CrazyCoder
CrazyCoder / zigbee2mqtt_aqara_wireless_switch.yaml
Last active September 1, 2026 16:47 — forked from rhl2401/zigbee2mqtt_aqara_wireless_switch.yaml
Aqara Wireless Switch (single, double, hold, release)
blueprint:
name: Aqara Wireless Switch (single, double, hold, release)
description: 'Control anything using Aqara Wireless Switch.
Customizable actions for each press.
This version of the blueprint is for buttons supporting single, double, hold and
release actions. '
domain: automation
local logger = require("logger")
local Device = require("device")
Device.input.rotation_map = nil
logger.info("Hardware button rotation disabled by user patch")
# 1. Open https://link.springer.com/search/page/1?facet-content-type=%22Book%22&package=mat-covid19_textbooks
# 2. Click on the button on the top right of the table to save results into CSV file (SearchResults.csv)
# 3. Run: python springer.py SearchResults.csv
# Note: Python 3 is needed, `pip install requests` if the module is missing
import sys
import csv
import requests
from pathlib import Path
from os import path