From 1f77cf3762febab39bb81522eec6ffb9d168120c Mon Sep 17 00:00:00 2001 From: David Gwilliam Date: Tue, 11 Aug 2026 00:42:15 -0700 Subject: [PATCH] infra: register Dual Outlet - Couch, fix Node-RED double-toggle, add meshtastic mqtt --- flows/zigbee-monitor.yaml | 8 ++++++++ infra/compose.yaml | 14 ++++++++++++++ infra/meshtastic-mqtt/acl.conf | 1 + infra/meshtastic-mqtt/mosquitto.conf | 5 +++++ infra/zigbee2mqtt/configuration.yaml | 2 ++ 5 files changed, 30 insertions(+) create mode 100644 infra/meshtastic-mqtt/acl.conf create mode 100644 infra/meshtastic-mqtt/mosquitto.conf diff --git a/flows/zigbee-monitor.yaml b/flows/zigbee-monitor.yaml index 82c3c8f..14ad8c9 100644 --- a/flows/zigbee-monitor.yaml +++ b/flows/zigbee-monitor.yaml @@ -63,6 +63,10 @@ flows: type: function name: Single click code: | + const now = Date.now(); + const last = context.get('lastTime') || 0; + if (now - last < 50) return null; + context.set('lastTime', now); try { const p = JSON.parse(msg.payload); if (p.action === 'single') { @@ -76,6 +80,10 @@ flows: type: function name: Hold release code: | + const now = Date.now(); + const last = context.get('lastTime') || 0; + if (now - last < 50) return null; + context.set('lastTime', now); try { const p = JSON.parse(msg.payload); if (p.action === 'release') { diff --git a/infra/compose.yaml b/infra/compose.yaml index a4009d9..290db13 100644 --- a/infra/compose.yaml +++ b/infra/compose.yaml @@ -83,6 +83,15 @@ services: # Action: TOGGLE on zigbee2mqtt/Squiggle/set # On a fresh alert, flash the plug: N toggles spaced FLASH_INTERVAL_SECONDS # so the total runtime is FLASH_DURATION_SECONDS. + meshtastic-mqtt: + image: eclipse-mosquitto:latest + container_name: meshtastic-mqtt + restart: unless-stopped + ports: + - "1884:1883" + volumes: + - ./meshtastic-mqtt:/mosquitto/config:ro + doorbell-listener: build: ./doorbell-listener container_name: doorbell-listener @@ -96,6 +105,11 @@ services: environment: MQTT_HOST: 192.168.81.147 MQTT_PORT: "1883" + PLUG_TOPIC: "zigbee2mqtt/Squiggle/set" + POLL_INTERVAL: "5" + MAX_AGE_SECONDS: "180" + FLASH_INTERVAL_SECONDS: "1" + FLASH_DURATION_SECONDS: "7" TZ: America/Los_Angeles volumes: diff --git a/infra/meshtastic-mqtt/acl.conf b/infra/meshtastic-mqtt/acl.conf new file mode 100644 index 0000000..bea8b6f --- /dev/null +++ b/infra/meshtastic-mqtt/acl.conf @@ -0,0 +1 @@ +topic readwrite msh/# diff --git a/infra/meshtastic-mqtt/mosquitto.conf b/infra/meshtastic-mqtt/mosquitto.conf new file mode 100644 index 0000000..971c9be --- /dev/null +++ b/infra/meshtastic-mqtt/mosquitto.conf @@ -0,0 +1,5 @@ +listener 1883 +allow_anonymous true +acl_file /mosquitto/config/acl.conf +persistence false +log_dest stdout diff --git a/infra/zigbee2mqtt/configuration.yaml b/infra/zigbee2mqtt/configuration.yaml index e2d7145..5c98ce9 100644 --- a/infra/zigbee2mqtt/configuration.yaml +++ b/infra/zigbee2mqtt/configuration.yaml @@ -59,3 +59,5 @@ devices: friendly_name: Bamboo Lights "0xffffb40e0603ef11": friendly_name: DJ Booth + "0x4ce175523f710000": + friendly_name: Dual Outlet - Couch