3-phase PV router
Loading...
Searching...
No Matches
config.h File Reference

Router configuration: loads, relays, control pins and features. More...

#include "config_types.h"
Include dependency graph for config.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Variables

constexpr uint8_t BOOST_TEMP_SENSOR { 0 }
 
constexpr bool CALIBRATION_MODE { false }
 
constexpr bool DIVERSION_PIN_PRESENT { false }
 
constexpr uint8_t diversionPin { unused_pin }
 
constexpr bool DUAL_TARIFF { false }
 
constexpr uint8_t dualTariffPin { unused_pin }
 
constexpr bool ENABLE_DEBUG { true }
 
constexpr int16_t iTemperatureThreshold { 100 }
 
constexpr uint8_t loadPrioritiesAtStartup [NO_OF_DUMPLOADS] { 0, 1, 2 }
 
constexpr uint8_t NO_OF_DUMPLOADS { 3 }
 
constexpr bool OVERRIDE_PIN_PRESENT { true }
 
constexpr OverridePins overridePins { { { 4, ALL_LOADS() } } }
 
constexpr PcbVersion PCB_VERSION { PcbVersion::NEW }
 
constexpr uint8_t physicalLoadPin [NO_OF_DUMPLOADS]
 
constexpr bool RELAY_DIVERSION { false }
 
constexpr uint8_t RELAY_FILTER_DELAY { 2 }
 
constexpr RelayEngine relays
 
constexpr bool RF_LOGGING_PRESENT { false }
 
constexpr uint32_t ROTATION_AFTER_SECONDS { 8UL * 3600UL }
 
constexpr RotationGroups rotationGroups {}
 
constexpr RotationModes { RotationModes::OFF }
 
constexpr uint8_t rotationPin { unused_pin }
 
constexpr bool ROUTER_OFF_PIN_PRESENT { false }
 
constexpr uint8_t routerOffPin { unused_pin }
 
constexpr ScheduledBoosts scheduledBoosts { { { BEFORE_END( integral_constant< uint16_t, ((3) * 60) > {} ), FOR( integral_constant< uint16_t, ((2) * 60) > {} ), { LOAD(0) } } } }
 
constexpr SerialOutputType SERIAL_OUTPUT_TYPE = SerialOutputType::IoT
 
constexpr bool TEMP_SENSOR_PRESENT { false }
 
constexpr TemperatureSensing temperatureSensing
 
constexpr uint8_t ul_OFF_PEAK_DURATION { 8 }
 
constexpr bool WATCHDOG_PIN_PRESENT { false }
 
constexpr uint8_t watchDogPin { unused_pin }
 

Detailed Description

Router configuration: loads, relays, control pins and features.

Edit it by hand, or create it with the configurator: https://fredm67.github.io/Mk2PVRouter/configurateur/

Settings only: no #include line but the one below, nothing computed. The firmware builds what it needs from these settings in config_derived.h.

Version
2.0
Date
2026-11-24

Definition in file config.h.

Variable Documentation

◆ BOOST_TEMP_SENSOR

uint8_t BOOST_TEMP_SENSOR { 0 }
inlineconstexpr

the sensor checked against it: its index in temperatureSensing, from 0

Definition at line 175 of file config.h.

◆ CALIBRATION_MODE

bool CALIBRATION_MODE { false }
inlineconstexpr

Definition at line 35 of file config.h.

◆ DIVERSION_PIN_PRESENT

bool DIVERSION_PIN_PRESENT { false }
inlineconstexpr

set it to 'true' if you want to control diversion ON/OFF

Definition at line 57 of file config.h.

◆ diversionPin

uint8_t diversionPin { unused_pin }
inlineconstexpr

if LOW, no surplus diversion: only forced loads/relays are ON

Definition at line 104 of file config.h.

◆ DUAL_TARIFF

bool DUAL_TARIFF { false }
inlineconstexpr

set it to 'true' if there's a dual tariff each day AND the router is connected to the billing meter

Definition at line 64 of file config.h.

◆ dualTariffPin

uint8_t dualTariffPin { unused_pin }
inlineconstexpr

off-peak trigger, the meter's dry contact

Definition at line 103 of file config.h.

◆ ENABLE_DEBUG

bool ENABLE_DEBUG { true }
inlineconstexpr

Definition at line 29 of file config.h.

◆ iTemperatureThreshold

int16_t iTemperatureThreshold { 100 }
inlineconstexpr

the temperature threshold to stop overriding in °C

Definition at line 174 of file config.h.

◆ loadPrioritiesAtStartup

uint8_t loadPrioritiesAtStartup[NO_OF_DUMPLOADS] { 0, 1, 2 }
inlineconstexpr

load priorities at startup (0=highest)

Definition at line 91 of file config.h.

◆ NO_OF_DUMPLOADS

uint8_t NO_OF_DUMPLOADS { 3 }
inlineconstexpr

TOTAL number of dump loads (local + remote)

Definition at line 40 of file config.h.

◆ OVERRIDE_PIN_PRESENT

bool OVERRIDE_PIN_PRESENT { true }
inlineconstexpr

set it to 'true' if there's a override pin

Definition at line 60 of file config.h.

◆ overridePins

OverridePins overridePins { { { 4, ALL_LOADS() } } }
inlineconstexpr

list of override pin/loads-relays pairs

Definition at line 157 of file config.h.

◆ PCB_VERSION

PcbVersion PCB_VERSION { PcbVersion::NEW }
inlineconstexpr

Definition at line 21 of file config.h.

◆ physicalLoadPin

uint8_t physicalLoadPin[NO_OF_DUMPLOADS]
inlineconstexpr
Initial value:
{
}
constexpr uint8_t local(uint8_t pin)
Declares a load driven locally by the router.
Definition load_map.h:68

the load map: one packed entry per dump load

Definition at line 50 of file config.h.

◆ RELAY_DIVERSION

bool RELAY_DIVERSION { false }
inlineconstexpr

set it to 'true' if a relay is used for diversion

Definition at line 63 of file config.h.

◆ RELAY_FILTER_DELAY

uint8_t RELAY_FILTER_DELAY { 2 }
inlineconstexpr

EWMA filter delay in minutes for relay control

Definition at line 123 of file config.h.

◆ relays

RelayEngine relays
inlineconstexpr
Initial value:
{ { unused_pin, 100, 200, 1, 1 },
{ unused_pin, 300, 400, 1, 1 },
{ unused_pin, 500, 600, 1, 1 } } }
constexpr uint8_t RELAY_FILTER_DELAY
Definition config.h:123
constexpr uint8_t unused_pin
Definition utils_bits.h:20

config for relay diversion with optimized EWMA filtering

Definition at line 130 of file config.h.

◆ RF_LOGGING_PRESENT

bool RF_LOGGING_PRESENT { false }
inlineconstexpr

set it to 'true' if RF data logging is needed

Definition at line 66 of file config.h.

◆ ROTATION_AFTER_SECONDS

uint32_t ROTATION_AFTER_SECONDS { 8UL * 3600UL }
inlineconstexpr

rotates load priorities after this period of inactivity

Definition at line 181 of file config.h.

◆ rotationGroups

RotationGroups rotationGroups {}
inlineconstexpr

the loads that take turns, {} without rotation

Definition at line 100 of file config.h.

◆ RotationModes

RotationModes { RotationModes::OFF }
inlineconstexpr

set it to 'OFF/AUTO/PIN' if you want manual/automatic rotation of priorities

Definition at line 59 of file config.h.

◆ rotationPin

uint8_t rotationPin { unused_pin }
inlineconstexpr

if LOW, trigger a load priority rotation

Definition at line 106 of file config.h.

◆ ROUTER_OFF_PIN_PRESENT

bool ROUTER_OFF_PIN_PRESENT { false }
inlineconstexpr

set it to 'true' if you want a pin that switches the router OFF

Definition at line 58 of file config.h.

◆ routerOffPin

uint8_t routerOffPin { unused_pin }
inlineconstexpr

if LOW, router OFF: every load and relay is OFF, forcing included

Definition at line 105 of file config.h.

◆ scheduledBoosts

ScheduledBoosts scheduledBoosts { { { BEFORE_END( integral_constant< uint16_t, ((3) * 60) > {} ), FOR( integral_constant< uint16_t, ((2) * 60) > {} ), { LOAD(0) } } } }
inlineconstexpr

load #1, from 3 hours before the end, for 2 hours

Definition at line 172 of file config.h.

◆ SERIAL_OUTPUT_TYPE

SerialOutputType SERIAL_OUTPUT_TYPE = SerialOutputType::IoT
inlineconstexpr

Definition at line 24 of file config.h.

◆ TEMP_SENSOR_PRESENT

bool TEMP_SENSOR_PRESENT { false }
inlineconstexpr

set it to 'true' if temperature sensing is needed

Definition at line 65 of file config.h.

◆ temperatureSensing

TemperatureSensing temperatureSensing
inlineconstexpr
Initial value:
{ { 0x28, 0xBE, 0x41, 0x6B, 0x09, 0x00, 0x00, 0xA4 },
{ 0x28, 0x1B, 0xD7, 0x6A, 0x09, 0x00, 0x00, 0xB7 } } }

list of temperature sensor Addresses

Definition at line 177 of file config.h.

◆ ul_OFF_PEAK_DURATION

uint8_t ul_OFF_PEAK_DURATION { 8 }
inlineconstexpr

Duration of the off-peak period in hours: must match the meter (it places the boosts counted back from the end)

Definition at line 159 of file config.h.

◆ WATCHDOG_PIN_PRESENT

bool WATCHDOG_PIN_PRESENT { false }
inlineconstexpr

set it to 'true' if there's a watch led

Definition at line 62 of file config.h.

◆ watchDogPin

uint8_t watchDogPin { unused_pin }
inlineconstexpr

watch dog LED

Definition at line 107 of file config.h.