infra: register Dual Outlet - Couch, fix Node-RED double-toggle, add meshtastic mqtt
This commit is contained in:
@@ -63,6 +63,10 @@ flows:
|
|||||||
type: function
|
type: function
|
||||||
name: Single click
|
name: Single click
|
||||||
code: |
|
code: |
|
||||||
|
const now = Date.now();
|
||||||
|
const last = context.get('lastTime') || 0;
|
||||||
|
if (now - last < 50) return null;
|
||||||
|
context.set('lastTime', now);
|
||||||
try {
|
try {
|
||||||
const p = JSON.parse(msg.payload);
|
const p = JSON.parse(msg.payload);
|
||||||
if (p.action === 'single') {
|
if (p.action === 'single') {
|
||||||
@@ -76,6 +80,10 @@ flows:
|
|||||||
type: function
|
type: function
|
||||||
name: Hold release
|
name: Hold release
|
||||||
code: |
|
code: |
|
||||||
|
const now = Date.now();
|
||||||
|
const last = context.get('lastTime') || 0;
|
||||||
|
if (now - last < 50) return null;
|
||||||
|
context.set('lastTime', now);
|
||||||
try {
|
try {
|
||||||
const p = JSON.parse(msg.payload);
|
const p = JSON.parse(msg.payload);
|
||||||
if (p.action === 'release') {
|
if (p.action === 'release') {
|
||||||
|
|||||||
@@ -83,6 +83,15 @@ services:
|
|||||||
# Action: TOGGLE on zigbee2mqtt/Squiggle/set
|
# Action: TOGGLE on zigbee2mqtt/Squiggle/set
|
||||||
# On a fresh alert, flash the plug: N toggles spaced FLASH_INTERVAL_SECONDS
|
# On a fresh alert, flash the plug: N toggles spaced FLASH_INTERVAL_SECONDS
|
||||||
# so the total runtime is FLASH_DURATION_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:
|
doorbell-listener:
|
||||||
build: ./doorbell-listener
|
build: ./doorbell-listener
|
||||||
container_name: doorbell-listener
|
container_name: doorbell-listener
|
||||||
@@ -96,6 +105,11 @@ services:
|
|||||||
environment:
|
environment:
|
||||||
MQTT_HOST: 192.168.81.147
|
MQTT_HOST: 192.168.81.147
|
||||||
MQTT_PORT: "1883"
|
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
|
TZ: America/Los_Angeles
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
topic readwrite msh/#
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
listener 1883
|
||||||
|
allow_anonymous true
|
||||||
|
acl_file /mosquitto/config/acl.conf
|
||||||
|
persistence false
|
||||||
|
log_dest stdout
|
||||||
@@ -59,3 +59,5 @@ devices:
|
|||||||
friendly_name: Bamboo Lights
|
friendly_name: Bamboo Lights
|
||||||
"0xffffb40e0603ef11":
|
"0xffffb40e0603ef11":
|
||||||
friendly_name: DJ Booth
|
friendly_name: DJ Booth
|
||||||
|
"0x4ce175523f710000":
|
||||||
|
friendly_name: Dual Outlet - Couch
|
||||||
|
|||||||
Reference in New Issue
Block a user