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

Configuration values to be set by the end-user. More...

#include "config_system.h"
#include "debug.h"
#include "types.h"
#include "utils_dualtariff.h"
#include "utils_relay.h"
#include "utils_temp.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.

Macros

#define ENABLE_DEBUG
 
#define SERIALOUT
 
#define SERIALPRINT
 

Variables

constexpr bool DIVERSION_PIN_PRESENT { true }
 
constexpr uint8_t diversionPin { 15 }
 
constexpr bool DUAL_TARIFF { false }
 
constexpr uint8_t dualTariffPin { 0xff }
 
constexpr bool EMONESP_CONTROL { false }
 
constexpr uint8_t forcePin { 3 }
 
constexpr int16_t iTemperatureThreshold { 100 }
 
constexpr uint8_t loadPrioritiesAtStartup [NO_OF_DUMPLOADS] { 0 }
 
constexpr uint8_t NO_OF_DUMPLOADS { 1 }
 
constexpr bool OLD_PCB { false }
 
constexpr bool OVERRIDE_PIN_PRESENT { true }
 
constexpr uint8_t physicalLoadPin [NO_OF_DUMPLOADS] { 4 }
 
constexpr bool RELAY_DIVERSION { false }
 
constexpr RelayEngine relays { { { 0xff, 1000, 200, 1, 1 } } }
 
constexpr pairForceLoad rg_ForceLoad [NO_OF_DUMPLOADS] { { -3, 2 } }
 
constexpr uint16_t ROTATION_AFTER_SECONDS { 8u * 3600u }
 
constexpr RotationModes { RotationModes::OFF }
 
constexpr uint8_t rotationPin { 0xff }
 
constexpr SerialOutputType SERIAL_OUTPUT_TYPE = SerialOutputType::IoT
 
constexpr bool TEMP_SENSOR_PRESENT { false }
 
constexpr TemperatureSensing temperatureSensing
 
constexpr DisplayType TYPE_OF_DISPLAY { DisplayType::OLED }
 
constexpr uint8_t ul_OFF_PEAK_DURATION { 8 }
 
constexpr bool WATCHDOG_PIN_PRESENT { false }
 
constexpr uint8_t watchDogPin { 0xff }
 

Detailed Description

Configuration values to be set by the end-user.

Author
Frédéric Metrich (frede.nosp@m.ric..nosp@m.metri.nosp@m.ch@l.nosp@m.ive.f.nosp@m.r)
Version
0.1
Date
2024-10-03

Definition in file config.h.

Macro Definition Documentation

◆ ENABLE_DEBUG

#define ENABLE_DEBUG

enable this line to include debugging print statements

Definition at line 21 of file config.h.

◆ SERIALOUT

#define SERIALOUT

Uncomment if a wired serial connection is used

Definition at line 23 of file config.h.

◆ SERIALPRINT

#define SERIALPRINT

include 'human-friendly' print statement for commissioning - comment this line to exclude.

Definition at line 22 of file config.h.

Variable Documentation

◆ DIVERSION_PIN_PRESENT

bool DIVERSION_PIN_PRESENT { true }
inlineconstexpr

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

Definition at line 38 of file config.h.

Referenced by checkDiversionOnOff(), getInputPins(), and initializeOldPCBPins().

◆ diversionPin

uint8_t diversionPin { 15 }
inlineconstexpr

if LOW, set diversion on standby

Definition at line 74 of file config.h.

Referenced by check_pins(), checkDiversionOnOff(), getInputPins(), and initializeOldPCBPins().

◆ 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 44 of file config.h.

Referenced by getInputPins(), initializeOldPCBPins(), and proceedLoadPrioritiesAndOverriding().

◆ dualTariffPin

uint8_t dualTariffPin { 0xff }
inlineconstexpr

for 3-phase PCB, off-peak trigger

Definition at line 73 of file config.h.

Referenced by getInputPins(), initializeOldPCBPins(), and proceedLoadPrioritiesAndOverridingDualTariff().

◆ EMONESP_CONTROL

bool EMONESP_CONTROL { false }
inlineconstexpr

Definition at line 37 of file config.h.

Referenced by proceedLoadPrioritiesAndOverriding().

◆ forcePin

uint8_t forcePin { 3 }
inlineconstexpr

◆ iTemperatureThreshold

int16_t iTemperatureThreshold { 100 }
inlineconstexpr

the temperature threshold to stop overriding in °C

Definition at line 88 of file config.h.

Referenced by printDualTariffConfiguration(), and proceedLoadPrioritiesAndOverridingDualTariff().

◆ loadPrioritiesAtStartup

uint8_t loadPrioritiesAtStartup[NO_OF_DUMPLOADS] { 0 }
inlineconstexpr

load priorities and states at startup

Definition at line 69 of file config.h.

Referenced by check_load_priorities(), initializeOldPCBPins(), and initializeProcessing().

◆ NO_OF_DUMPLOADS

◆ OLD_PCB

bool OLD_PCB { false }
inlineconstexpr

set it to 'true' if the old PCB is used

Definition at line 49 of file config.h.

Referenced by initializeProcessing().

◆ OVERRIDE_PIN_PRESENT

bool OVERRIDE_PIN_PRESENT { true }
inlineconstexpr

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

Definition at line 40 of file config.h.

Referenced by forceFullPower(), getInputPins(), initializeOldPCBPins(), and proceedLoadPrioritiesAndOverriding().

◆ physicalLoadPin

uint8_t physicalLoadPin[NO_OF_DUMPLOADS] { 4 }
inlineconstexpr

for 1-phase PCB - "trigger" port is pin 4, "mode" port is pin 3

Definition at line 68 of file config.h.

Referenced by check_pins(), getOutputPins(), initializeOldPCBPins(), and updatePortsStates().

◆ RELAY_DIVERSION

bool RELAY_DIVERSION { false }
inlineconstexpr

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

Definition at line 43 of file config.h.

Referenced by calcBufferSize(), check_pins(), check_relay_pins(), getOutputPins(), handlePerSecondTasks(), initializeOldPCBPins(), loop(), printForJSON(), printForSerialText(), and sendTelemetryData().

◆ relays

◆ rg_ForceLoad

pairForceLoad rg_ForceLoad[NO_OF_DUMPLOADS] { { -3, 2 } }
inlineconstexpr

force config for load #1 ONLY for dual tariff

Definition at line 84 of file config.h.

Referenced by _rg_OffsetForce< N, OffPeakDuration >::_rg_OffsetForce(), and printDualTariffConfiguration().

◆ ROTATION_AFTER_SECONDS

uint16_t ROTATION_AFTER_SECONDS { 8u * 3600u }
inlineconstexpr

rotates load priorities after this period of inactivity

Definition at line 92 of file config.h.

Referenced by proceedLoadPrioritiesAndOverriding().

◆ RotationModes

RotationModes { RotationModes::OFF }
inlineconstexpr

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

Definition at line 39 of file config.h.

◆ rotationPin

uint8_t rotationPin { 0xff }
inlineconstexpr

if LOW, trigger a load priority rotation

Definition at line 75 of file config.h.

Referenced by check_pins(), getInputPins(), initializeOldPCBPins(), and proceedLoadPrioritiesAndOverriding().

◆ SERIAL_OUTPUT_TYPE

SerialOutputType SERIAL_OUTPUT_TYPE = SerialOutputType::IoT
inlineconstexpr

constexpr variable to set the serial output type

Definition at line 33 of file config.h.

Referenced by printConfiguration(), sendResults(), and setup().

◆ TEMP_SENSOR_PRESENT

bool TEMP_SENSOR_PRESENT { false }
inlineconstexpr

◆ temperatureSensing

TemperatureSensing temperatureSensing
inlineconstexpr
Initial value:
{ 0xff,
{ { 0x28, 0x1B, 0xD7, 0x6A, 0x09, 0x00, 0x00, 0xB7 } } }

list of temperature sensor Addresses

Definition at line 89 of file config.h.

Referenced by calcBufferSize(), check_pins(), printForJSON(), printForSerialText(), sendTelemetryData(), setup(), and updateTemperature().

◆ TYPE_OF_DISPLAY

DisplayType TYPE_OF_DISPLAY { DisplayType::OLED }
inlineconstexpr

set it to installed display including optional additional logic chips

Definition at line 51 of file config.h.

Referenced by check_pins(), configureValueForDisplay(), displayForced(), displayOff(), initializeDisplay(), refresh7SegDisplay(), setupOLED(), updateOLED(), and updateWatchdog().

◆ ul_OFF_PEAK_DURATION

uint8_t ul_OFF_PEAK_DURATION { 8 }
inlineconstexpr

Duration of the off-peak period in hours

Definition at line 83 of file config.h.

Referenced by printDualTariffConfiguration().

◆ WATCHDOG_PIN_PRESENT

bool WATCHDOG_PIN_PRESENT { false }
inlineconstexpr

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

Definition at line 42 of file config.h.

Referenced by getOutputPins(), handlePerSecondTasks(), and initializeOldPCBPins().

◆ watchDogPin

uint8_t watchDogPin { 0xff }
inlineconstexpr

watch dog LED

Definition at line 77 of file config.h.

Referenced by check_pins(), getOutputPins(), handlePerSecondTasks(), and initializeOldPCBPins().