Skip to content

Instantly share code, notes, and snippets.

@b2un0
b2un0 / coordinator_backup_remove_stale.sh
Last active September 20, 2025 09:53
zigbee2mqtt cleanup stale devices (nvram / trust center full)
#!/usr/bin/env bash
set -euo pipefail
# --- inputs in current directory ---
DB="database.db" # Zigbee2MQTT JSONL database
BACKUP="coordinator_backup.json" # coordinator backup JSON
CLEANED="z2m_coordinator_backup.cleaned.json"
# -----------------------------------
# sanity checks
substitutions:
name: "buro-fan"
friendly_name: "Büro Ventilator"
comment: "Sonoff Ifan03 Ventilator (ESP01 1M)"
on_boot_light: ALWAYS_ON # or ALWAYS_OFF
spare_button_light_entity: "light.buro"
esphome:
name: $name
comment: $comment
@b2un0
b2un0 / energymeter.yaml
Last active February 26, 2025 13:27
esphome SML Reader (Volkszähler)
substitutions:
name: energymeter
friendly_name: energymeter
comment: "ESP01 SML Reader (Volkszähler)"
esphome:
name: $name
comment: $comment
esp8266:
@b2un0
b2un0 / home_assistant_mqtt.yaml
Last active December 8, 2023 07:26
Home Assistant Lidl HG06467 _TZE200_s8gkrkxk Effect Switch (Melinera smart LED string lights)
# replace "Livingroom Christmas Tree" and the identifier "zigbee2mqtt_0xbc33acfffe0443e5" with your device
mqtt:
switch:
- unique_id: mqtt_z2m_livingroom_christmas_tree_scene_rainbow
name: "Livingroom Christmas Tree Rainbow"
icon: "mdi:looks"
device:
identifiers: zigbee2mqtt_0xbc33acfffe0443e5
availability:
- topic: "zigbee2mqtt/Livingroom Christmas Tree/availability"

features

  • working macvlan with docker
  • systemd network devices
  • each container can reach the whole nework (full routing)
  • docker-compose.yml example with static ipv4 on macvlan
  • if no ip defined, container get a ip within 192.168.155.192/27