From 9ed32e3846bc557863e14b5ea84bcd92bfaffcd5 Mon Sep 17 00:00:00 2001 From: root Date: Sat, 14 Nov 2026 16:05:57 +0000 Subject: [PATCH] Config added --- include/config.h | 64 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 include/config.h diff --git a/include/config.h b/include/config.h new file mode 100644 index 0000000..70857ce --- /dev/null +++ b/include/config.h @@ -0,0 +1,64 @@ +#pragma once + +// ── WiFi ────────────────────────────────────────────────────────────────────── +#define WIFI_SSID "Hulzer WLAN" +#define WIFI_PASSWORD "4598181027896773" + +// 1 = disable WiFi modem sleep (recommended: lower latency, fewer dropped +// MQTT keepalives). 0 = allow modem sleep for lower power draw. +#define WIFI_DISABLE_POWER_SAVE 0 + +// ── MQTT broker ─────────────────────────────────────────────────────────────── +#define MQTT_HOST "172.26.9.52" // IP address of your MQTT broker +#define MQTT_PORT 1883 +#define MQTT_CLIENT_ID "esp32-victron" +// Leave blank if your broker has no auth: +#define MQTT_USER "" +#define MQTT_PASSWORD "" + +// ── MQTT topics ─────────────────────────────────────────────────────────────── +#define MQTT_TOPIC_DATA "solar/poessl/data" +#define MQTT_TOPIC_STATUS "solar/poessl/status" +// Runtime diagnostics: uptime, RSSI, heap, reconnect counts, BLE age +#define MQTT_TOPIC_DIAG "solar/poessl/diag" + +// ── Victron SmartSolar MPPT ─────────────────────────────────────────────────── +// MAC address of your Victron device (lowercase, colon-separated) +// Find it in Victron Connect app → device → top-right menu → Product Info +#define VICTRON_MAC "d3:88:ad:62:88:5a" + +// 32-character hex encryption key +// Find it in Victron Connect app → device → top-right menu → Product Info → Instant readout details +#define VICTRON_ENC_KEY "7b1d962770474249ab08b9c87a98aa4c" + +// ── Home Assistant discovery ────────────────────────────────────────────────── +// 1 = publish MQTT discovery configs, 0 = only publish data/status/diag. +#define HA_DISCOVERY_ENABLED 0 + +// Discovery topic prefix used by Home Assistant (usually "homeassistant"). +#define HA_DISCOVERY_PREFIX "homeassistant" + +// Device identity. Change both for a second MPPT so the entities do not collide. +// HA_DEVICE_ID forms the discovery topic path and the device identifier. +// HA_UNIQUE_PREFIX prefixes each entity's unique_id. +#define HA_DEVICE_ID "victron_smartsolar_garage" +#define HA_UNIQUE_PREFIX "victron_mppt" +#define HA_DEVICE_NAME "Victron SmartSolar MPPT" +#define HA_MODEL "SmartSolar MPPT 100/20" +#define HA_MANUFACTURER "Victron Energy" + +// ── Timing ──────────────────────────────────────────────────────────────────── +// How often to publish to MQTT (milliseconds) +#define PUBLISH_INTERVAL_MS 10000 + +// BLE passive scan timing (milliseconds). Window must be <= interval. +// 50/100 = 50% duty cycle: reliable reception without starving WiFi. +#define BLE_SCAN_INTERVAL_MS 100 +#define BLE_SCAN_WINDOW_MS 50 + +// Scan in blocks; NimBLE 1.4.x frees its result list only when a scan ends. +#define BLE_SCAN_PERIOD_S 30 +#define BLE_SCAN_PAUSE_MS 1000 + +// How often to publish the diagnostics payload (milliseconds) +#define DIAG_INTERVAL_MS 60000