The development versus production boot mode, configured via Home Assistant and stored persistently in EEPROM, provides an additional testing safety mechanism. When set to development mode (flag value 1), every Arduino reboot clears all EEPROM-stored relay states (pump, P1 through P4 all set to OFF) and timer configurations (TimeON, TimeOFF, TimeON2, TimeOFF2 all set to 0). This forces the system into a known safe idle state where no outputs will activate unexpectedly, preventing dangerous pump activation during code development when the Arduino might reboot frequently due to programming cycles or intentional resets.
In production mode (flag value 0), the system restores all EEPROM states on boot. If the pump was on when power was lost, it will be on when power returns. If peripherals were enabled with specific timing configurations, those configurations persist. This maintains operational continuity through power outages, ensuring that if a fire event is in progress and utility power fails, the system will resume its defensive configuration when power returns (assuming the battery-backed diesel pump continued running during the outage).
The mode selection is controlled via MQTT topic home/system/devmode/set accepting payloads "0", "OFF", "PRODUCTION" for production mode or "1", "ON", "DEVELOPMENT", "DEV" for development mode. The setting is stored in EEPROM and persists across reboots, preventing accidental mode changes. The current mode is published to home/system/devmode/state as a retained message so the Home Assistant dashboard always displays the actual active mode.
<< Testing Infrastructure and System Validation cont | | Testing Infrastructure and System Validation cont >> |Table of Contents>
