The Raspberry Pi 4 runs a fairly sophisticated home automation and bushfire defense monitoring system with all services running from a Solid State Disk (SSD) mounted at /srv in its directory structure . The system consists of three main components working together: Home Assistant and Mosquitto MQTT broker in Docker containers, plus Tailscale (with ZeroTier One as a fallback) for secure remote access. This configuration supports the local ARMAC bushfire defence system at Fairhaven, Victoria. A second Raspberry Pi at Rowe Street, Melbourne, runs the same set-up for the TestSys bench system (see TestSys).
Docker Container Architecture
Both Home Assistant and Mosquitto run via Docker Compose, defined in /srv/docker-compose.yml. The compose file uses version 3.9 and defines two services that provide the core functionality of the system.
Home Assistant Container
Home Assistant runs the official ghcr.io/home-assistant/home-assistant:stable image with network mode set to host. This configuration is crucial as it allows Home Assistant to discover and communicate with local network devices without NAT translation, enabling protocols like mDNS discovery and direct communication with IoT devices. The container mounts /srv/homeassistant to /config inside the container, storing all configuration files, databases, and custom components on the persistent SSD. The system timezone is synchronized by mounting /etc/localtime as read-only.
The Home Assistant configuration is organized using packages, with the main configuration.yaml including additional YAML files from a packages directory. This modular structure keeps the fire monitoring configuration separate from other home automation functions. Home Assistant is configured for the Australian environment with metric units, Melbourne timezone, and coordinates set to those of the local site.
Mosquitto MQTT Broker
Mosquitto runs the latest eclipse-mosquitto image with two ports exposed: port 1883 for standard MQTT protocol and port 9001 for websocket connections (though websockets are currently commented out in the configuration). The broker's persistent data is organized across three mounted volumes:
/srv/mosquitto/config- containsmosquitto.confand any additional configuration/srv/mosquitto/data- stores persistent message data/srv/mosquitto/log- contains all broker logs
The mosquitto.conf is intentionally minimal and permissive for the local network environment. It enables anonymous connections (no authentication required), activates message persistence to survive restarts, and logs all activity including connection messages with timestamps. This configuration is appropriate for a closed local network where all external access is through the VPNs or the SSH tunnel described below.
Both containers use restart: unless-stopped, ensuring automatic recovery from crashes or system reboots while allowing manual shutdown when needed.
Network Architecture and Security
Tailscale runs natively on the Raspberry Pi 4 host operating system (not containerised) and provides the main method for external access to the system. This is a critical security design decision - no ports are exposed to the public internet. Remote connections to Home Assistant from external platforms, mobile devices, or remote monitoring systems normally traverse the Tailscale VPN network.
Tailscale creates a secure, encrypted WireGuard-based mesh network that appears as a local network to the applications. Remote users connect as if they were on the local LAN, but all traffic is encrypted end-to-end. This eliminates the need for port forwarding, dynamic DNS, or exposing Home Assistant to internet scanning and attacks.
Because remote access is so important in a fire, Tailscale is not the only way in. ZeroTier One, a second, independent VPN, also runs on the Pi as a fallback in case Tailscale fails. And since both VPNs may struggle through the mobile network's address translation when the RUT240 mobile router is carrying the internet, the Pi also keeps a permanent outbound reverse SSH tunnel (autossh) to the project's VPS, through which a shell - and, with a port forward, the Home Assistant dashboard - can be reached over any internet connection. A Nabu Casa cloud subscription was originally used, but later removed as surplus to requirements, but could of course be added as a further optional path. How to use these paths is described in Troubleshooting.
The MQTT broker facilitates local communications between Home Assistant and the ARMAC system components, including pump controls, motorized valves, peripheral devices, and sensors. Home Assistant subscribes and publishes to various MQTT topics to control relays and monitor system state. For example, the pump control uses topics like home/relay/pump for state and home/pump/inTopic for commands, with simple "1"/"0" payloads for on/off control.
ARMAC Fire Threat Monitoring System
The system includes three sophisticated Python scripts that power the Current Fire Threats page in Home Assistant. These scripts run as Home Assistant command-line sensors, executing every 5 minutes (300 second scan interval) and outputting JSON data that updates the fire threat monitoring dashboard.
VicEmergency Events Monitor (vic_events_compact.py)
This script fetches the official Victorian emergency GeoJSON feed from emergency.vic.gov.au and filters it for bushfire-related events (bushFire, grassFire, forestFire) within a configurable radius of the home location. It uses caching (2-minute cache validity) to avoid hammering the government API while maintaining relatively fresh data. The script handles complex geometry including polygons and multi-polygons for fire perimeters, calculates distances from home to various fire features (points, edges, perimeters), and returns the 120 nearest events to avoid overwhelming Home Assistant's attribute size limits.
FFMVic Burnt Area Tracker (ffm_burnt_area_front.py)
This script queries the Forest Fire Management Victoria (FFMVic) ArcGIS MapServer for current burnt area polygons (SUBTYPE=2). It implements sophisticated matching logic to associate burnt area polygons with specific VicEmergency incidents using name matching (with prefix token comparison) and proximity fallback. The script computes the nearest boundary point of the burnt area polygon to both the home location and the VicEmergency incident anchor point. This provides accurate distance and bearing information for the actual fire front, which is more reliable than VicEmergency's incident points that may be offset from the actual fire location. The script uses local equirectangular projection for efficient distance calculations without external geometry libraries.
DEA Hotspot Cluster Analyzer (dea_hotspot_cluster_front.py)
This script fetches thermal hotspot data from the Digital Earth Australia (DEA) recent hotspots feed, which provides satellite-detected heat signatures from the last ~72 hours. It implements a custom clustering algorithm to identify "significant" hotspot clusters based on density rules (connected components within a specified distance threshold and minimum cluster size). The script filters hotspots by both spatial radius and temporal window (typically last 8 hours), then selects the best cluster based on proximity to the VicEmergency anchor point. It returns the nearest hotspot point in that cluster to home as a conservative "active heat boundary" proxy, useful when burnt area polygons are stale or erratic during rapidly developing fires.
Integration with Home Assistant
All three scripts are configured as command-line sensors in the jf_fire_wind_fairhaven.yaml package file. They receive parameters dynamically from Home Assistant input helpers (home coordinates, relevance radius, query parameters) and return structured JSON with extensive attributes. Template sensors process this data to calculate derived values and trigger automations.
The fire monitoring system also integrates Bureau of Meteorology wind data from Aireys Inlet to assess fire behavior and direction. MQTT switches control the physical ARMAC infrastructure - pumps, sprinklers via motorised valves, and peripheral equipment - through AR1, allowing manual activation of bushfire defence measures from the dashboard.
This monitoring setup provides multiple data sources (official incidents, burnt area mapping, real-time thermal detection) for accurate and timely assessment of approaching fire threats. The use is explained in the User Guide. The detailed operational logic is documented separately in ARMAC Appendix 19.
See also Hardening the Raspberry Pi and Backing up and restoring the Raspberry Pi.
Packages at Fairhaven
Besides the fire monitoring package, the ARMAC configuration at Fairhaven includes packages for the Autonomous mode hand-over countdown and status (armac_auto_handover.yaml), the RS-485 failure SMS with its once-a-day limit and tap-to-acknowledge link (ar3_comms_sms_ack.yaml), internet connection monitoring - which hands control to Autonomous mode after five minutes without internet and reports when it returns (internet_monitoring.yaml) - and the net flow into and out of the tank (tank_net_flow.yaml). Sensitive values (site coordinates, email and SMS accounts, phone numbers) are kept in secrets.yaml (see Security measures and credential management). The alerts are described in Alerts.
Home Assistant controls
- Disable Shed Cooling switch. ON stops shed cooling; OFF (the default) allows it. While the system is locked (Enable Controls off) the switch can be turned ON but not OFF - the lock can always stop water use but never start it. In Autonomous mode Arduino 3 controls shed cooling itself and this switch has no effect. The switch only ever stops cooling - it never energises the cooling relay; in Autonomous mode Arduino 1 does not run its own Time ON / Time OFF cycle; the Shed Cooling LED always shows the actual cooling relay, and in Autonomous mode the switch keeps showing its real position.
- Time ON / Time OFF. The sprinkler cycle and shed cooling each have Time ON and Time OFF settings (0-30 minutes). For shed cooling: both 0 - cooling follows the pump; Time ON only - continuous; Time OFF only - off; both set - cycles on and off, starting with ON. The times are set with - and + buttons (1 minute per tap). The new value is sent to Arduino 1 two seconds after the last tap, so several taps send only the final value. The settings are kept when Home Assistant restarts. For the sprinkler cycle with both times set, Time ON sends the water to the sprinklers and Time OFF recirculates it to the tank.
- Gel needs reduced flow. The flow constriction creates the pressure difference that drives the Dosatron DN009 gel pump, so gel only works on reduced flow. The flow valve is a motorised T valve: with its relay (P3) off it sits in the through-flow position, through the constriction (reduced flow, the default); with the relay energised it switches to the tail of the T (high flow). In manual, turning Gel ON also switches the flow to reduced, and Flow High is refused while gel is on (the info line shows "GEL ON - reduced flow required"); turning gel off leaves the flow on reduced. In Autonomous mode gel is only injected on reduced flow, and Arduino 3 also forces reduced flow whenever gel is on, as a final safeguard.
- LED indicators. The first row of the Sprinkler Cycle and Shed Cooling cards is an LED that lights while the sprinklers are actually spraying (pump running and the valve set to the sprinklers rather than recirculation), or while shed cooling is on. It works in manual and autonomous operation.
- Autonomous Mode State dashboard. The single place for Auto. Its Autonomous Status card starts with three plain-English rows (Auto, Sprinkler cycle, Shed cooling) that show whether Autonomous mode is on and why (including a running test), what the autonomous sprinkler and shed cooling cycles are doing, and - if all temperature sensors have failed - the fallback stage. Its Current Relay States card shows the actual outputs: Pump, Sprinklers spraying, Recirc valve (Through flow or Recirculate), Shed cooling on, Flow valve (Reduced flow or High flow) and Retardant. Both valves are motorised T valves: the recirculation valve's default through-flow position sends water to the sprinklers and the tail of the T recirculates it to the tank; the flow valve's default through-flow position goes through the constriction (reduced flow) and the tail of the T gives high flow.
- Sensor status card. On the System Health dashboard: Temperature sensors (OK, or which have failed) and Tank level source (Gauge, or a warning that the level is estimated from the flow meters). Both apply in manual as well as autonomous operation.
Technical maintenance controls
A few controls are defined in the Home Assistant configuration but deliberately not placed on any dashboard, because they are not needed in normal use. They are available for technical maintenance from Home Assistant's Settings > Devices & Services > Entities list (search by name), or by publishing to the MQTT topic shown.
| Control | MQTT topic | Effect |
|---|---|---|
| AR1 Reboot (button) | home/ar1/reboot (payload 1) | Restarts Arduino AR1 at once; the Restarts card then shows the cause as "HA command". Not normally needed: AR1 reconnects by itself after a Pi restart, restarts itself after 15 minutes without a connection, and its watchdog restarts it if it freezes |
| Acknowledge Flame Alarm (switch) | home/flame/acknowledge | Left over from an earlier alert scheme: AR1 records the acknowledgement, but nothing depends on it. Ember alerts are sent by Home Assistant once, at most every 15 minutes, and need no acknowledgement |
| FD Auto Resume States (switch) | home/auto/resume | Left over: intended to choose whether manual control resumes the previous valve states after Autonomous mode. AR1 always starts manual control from the safe state, so it has no effect |
| Pump Temperature Auto-Trigger (switch) | home/pump/TempAutoTrigger | Left over: AR1 stores the setting but does not use it |
The technician's switches that are on the System Health dashboard (comms path force, AR1 Development Mode, Connection self-restarts) are described in The dashboard, and the USB serial test commands for the Arduinos (TEST1-4, TESTSTOP, WDTTEST, NOMQTT, MUTE / UNMUTE, NOCLIENT) in Test scenarios.
Last checked against the Fairhaven Pi: 7 November 2026. Using the dashboard: The dashboard.
<< Output Control and Safety Interlocks | | Hardening the Raspberry Pi >> |Table of Contents>
