Add doorbell-listener: ntfy → zigbee2mqtt Sideboard Lamp toggle
Polls ntfy.sh for ALERT_klubhaus_topic(_test) and publishes
{state: TOGGLE} to zigbee2mqtt/Sideboard Lamp/set on each new
message event. Dual-topic subscription so switching from test to
production requires no code change; sender still uses test topic.
- infra/doorbell-listener/: uv-based Docker service (arm64)
- compose: depends_on mosquitto, persists last_id per topic
- justfile: doorbell-publish, doorbell-logs, doorbell-rebuild,
restart-all now includes doorbell-listener
This commit is contained in:
@@ -132,7 +132,28 @@ restart SERVICE:
|
||||
|
||||
# Restart the full stack
|
||||
restart-all:
|
||||
ssh {{RPI_HOST}} 'docker restart mosquitto zigbee2mqtt nodered'
|
||||
ssh {{RPI_HOST}} 'docker restart mosquitto zigbee2mqtt nodered doorbell-listener'
|
||||
|
||||
# Tail doorbell-listener container logs
|
||||
doorbell-logs:
|
||||
ssh {{RPI_HOST}} 'docker logs --tail 50 -f doorbell-listener'
|
||||
|
||||
# Restart just the doorbell-listener
|
||||
restart-doorbell:
|
||||
ssh {{RPI_HOST}} 'docker restart doorbell-listener'
|
||||
|
||||
# Publish a test alert to ntfy (used for E2E testing the listener).
|
||||
# Usage: just doorbell-publish "Title" "Body"
|
||||
doorbell-publish TITLE BODY="Someone is at the door":
|
||||
curl -sS -X POST "https://ntfy.sh/ALERT_klubhaus_topic_test" \
|
||||
-H "Title: {{TITLE}}" \
|
||||
-H "Priority: high" \
|
||||
-d "{{BODY}}" \
|
||||
-w "\nHTTP %{http_code}\n"
|
||||
|
||||
# Build + (re)start the listener (after edits to infra/doorbell-listener/)
|
||||
doorbell-rebuild:
|
||||
ssh {{RPI_HOST}} 'cd {{RPI_DIR}}/nr-flow-validator && docker compose build doorbell-listener && docker compose up -d doorbell-listener'
|
||||
|
||||
# Show paired zigbee devices and their friendly names
|
||||
z2m-devices:
|
||||
|
||||
Reference in New Issue
Block a user