The Intesis MHI gateway was switched from Modbus TCP to native MQTT mode (2026-08-13), publishing retained per-signal JSON status to hvac/mhi/IU<nn>/status/<signal> and subscribing to commands at hvac/mhi/IU<nn>/cmd/<signal>Cmd. This adds an MQTT ingest + command path alongside the now-dormant Modbus driver, under a new mhi_mqtt device type. Backend: - lib/mqtt.js: subscribe hvac/mhi/+/status/+, parse JSON payloads, auto- register each unit as an unassigned mhi_mqtt zone_devices row and cache live status (power/mode/setpoint/room temp/fan/health). Add publishMhiCommand() for on/off/mode/setpoint/fan/vanes writes (QoS 1, retain off — a retained command would replay stale on gateway reconnect). Numeric mode/fan enums map index-for-index to the frontend label arrays. - routes/override.js: mhi-status/mhi-control branch on device_type — mhi_mqtt serves from the push-populated cache and publishes commands; mhi_modbus keeps its synchronous register path unchanged. - routes/devices.js: discover() note for mhi_mqtt (units self-register). - No DB migration: existing status columns cover it. Credentials: getCredentials() now prefers env-injected creds (MQTT_BROKER_HOST/USERNAME/PASSWORD) over the settings fetch — the broker hashes each dynsec client password show-once, so it can't be re-served from settings at runtime. Compose passes the new env through. Frontend: add mhi_mqtt to DeviceType/labels/implemented list, render MhiControlPanel and count it as an AC device type. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
46 lines
1.2 KiB
YAML
46 lines
1.2 KiB
YAML
services:
|
|
backend:
|
|
build: ./backend
|
|
security_opt:
|
|
- apparmor=unconfined
|
|
environment:
|
|
- DATABASE_URL=${DATABASE_URL}
|
|
- CENTRAL_AUTH_SECRET=${CENTRAL_AUTH_SECRET}
|
|
- SETTINGS_URL=${SETTINGS_URL}
|
|
- SETTINGS_SECRET=${SETTINGS_SECRET}
|
|
- MQTT_BROKER_HOST=${MQTT_BROKER_HOST:-10.10.10.104}
|
|
- MQTT_BROKER_PORT=${MQTT_BROKER_PORT:-1883}
|
|
- MQTT_USERNAME=${MQTT_USERNAME:-}
|
|
- MQTT_PASSWORD=${MQTT_PASSWORD:-}
|
|
- APP_SLUG=hvac
|
|
- OFFICE_IP_CHECK=${OFFICE_IP_CHECK:-disabled}
|
|
- NEWBOOK_LOCATION_ID=${NEWBOOK_LOCATION_ID:-}
|
|
volumes:
|
|
- uploads_data:/app/uploads
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "wget -qO- http://127.0.0.1:3001/health || exit 1"]
|
|
interval: 10s
|
|
retries: 5
|
|
start_period: 20s
|
|
restart: unless-stopped
|
|
|
|
frontend:
|
|
build:
|
|
context: ./frontend
|
|
args:
|
|
VITE_HOTEL_NAME: ${VITE_HOTEL_NAME}
|
|
security_opt:
|
|
- apparmor=unconfined
|
|
ports:
|
|
- "${FRONTEND_PORT:-3080}:80"
|
|
depends_on:
|
|
backend:
|
|
condition: service_healthy
|
|
restart: unless-stopped
|
|
|
|
networks:
|
|
default:
|
|
driver: bridge
|
|
|
|
volumes:
|
|
uploads_data:
|