Add Home Assistant controls over MQTT

Upgrade ArduinoHA from 1.3.0 to 2.1.0 and rewrite mqtt.ino for it.
The clock now shows up in Home Assistant (discovery prefix
"homeassistant") with:
- switches Tubes (blank the display, runtime only) and Auto dim
- numbers Day/Night brightness
- light Backlight (on/off, brightness, RGB mapped to the colour wheel)
- select LED effect, button Cathode protect
- sensors Light (LDR) and WiFi signal, plus the upstream sensors when
  the clock has them; master-clock subscriptions are kept

Settings changed from HA are saved to EEPROM 3 s after the last change.
Fixes the unbounded memcpy in the MQTT message handler.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
mangavalkandClaude Opus 5.5 committed 2026-10-25 21:37:25 +01:00
1 parent 0d3e878051
commit 9a7061383c
108 files changed
+11482 -6567

No files matched your search

@@ -247,6 +247,9 @@ DNSServer dnsServer;
#ifdef USE_ARDUINO_OTA
#include <ArduinoOTA.h>
#endif
#ifdef USE_MQTT
#include <ArduinoHA.h> //here and not only in mqtt.ino: PlatformIO's generated prototypes need its types early
#endif
#if defined(USE_NEOPIXEL) || defined(WORDCLOCK)
#include <NeoPixelBrightnessBus.h>
@@ -338,6 +341,7 @@ volatile boolean EEPROMsaving = false; //saving in progress - stop display refre
bool colonBlinkState = false;
boolean radarON = true;
boolean mqttRadarON = true;
volatile boolean tubesOn = true; //Tubes switch from Home Assistant (runtime only, not saved); honoured by nixie595.ino
unsigned long radarLastOn = 0;
boolean makeFirmwareUpdate = false;
boolean makeCathodeProtect = false;