![]() |
rasProject_01 / weSweetHome
R. 116 2026-05-14
process control / RasPi software by weinert-automation
|
Common values for an experimental smart home (lab) project. More...
#include "sweetDemo.h"#include <stdio.h>Functions | |
| void | chgFilNames (void) |
| Set the current date in event & retain file paths. | |
Variables | |
| cmdLookUp_t | cmdLookUp [] |
| The common command look up table. | |
| char | dayFilNam [] |
| Path of the table to log a set of values for every day. | |
| char | evtFilNam [] |
| Path of the daily event file. | |
| volatile float | fLine |
| last valid power line frequency | |
| volatile int | invHasUnloadPow |
| The miniJoule inverter has battery unload power. | |
| smdX30modbus_t | smdX30modbus [ANZmodSLAVES] |
| Descriptive and state array for smart meters on Modbus. | |
| volatile int | tempTankWater |
| Last value of tank water temperature in mgrdC. | |
| volatile uint8_t | tempWaterBadCnt |
| Tank water temperature bad read count. | |
| valFilVal_t | valFilVal |
| All process values relevant for log files and HMI. | |
Common values for an experimental smart home (lab) project.
Revision history
| void chgFilNames | ( | void | ) |
| char evtFilNam[] |
Path of the daily event file.
The current date in the format 2025-09-30 has to be set at position EFNY by chgFilNames().
The event file outLog is a text file used for one day for events and currently (see useOutLog4errLog) for errors, also.
| char dayFilNam[] |
Path of the table to log a set of values for every day.
This is the text file in csv format where a set of day start values is recorded for every day shortly after midnight.
It will be used "endlessly". To set an end respectively close that diary just rename the file. A new "dayFile" will then be created an used hence on.
| cmdLookUp_t cmdLookUp[] |
The common command look up table.
It must end with an entry {"", 0}.
The current (CGI) program uses linear search for the command mnemonic. Hence, and cause of structure, alphabetic sorting is of no avail.
| volatile float fLine |
last valid power line frequency
Last valid power line frequency.
last valid power line frequency
The measurement is taken from the more precise home three phase meter if communicative via Modbus. Otherwise the other meter's value is taken if available. Due to slow Modbus communication the values may be older than two seconds worst case.
This low sampling rate won't comply with VDE-AR-N 4105 cut off rules requiring a 0.1s reaction outside 47.5..51.5Hz. Nevertheless the current experimental set-up is a working proof-of-concept implementation (with very low power) — and a faster frequency measurement could easily be implemented.
| smdX30modbus_t smdX30modbus[ANZmodSLAVES] |
Descriptive and state array for smart meters on Modbus.
The number of meters is ANZmodSLAVES.
| volatile int tempTankWater |
Last value of tank water temperature in mgrdC.
This value will be the last good .tempTankTop (see valFilVal_t) or the last good .tempPipe. If neither is good for 251 measurements BAD_TEMP_READ (an incredibly high value) will be set.
This last tank water temperature will be checked against a safety limit to allow electric heating as ballast.
The value is in units of 1/1000 grdC.
| volatile uint8_t tempWaterBadCnt |
Tank water temperature bad read count.
This last tank water temperature will be checked against a safety limit to allow electric heating as ballast.
In case of too many bad reads the value must be fixed at 253
| volatile int invHasUnloadPow |
The miniJoule inverter has battery unload power.
Or at least may still have due to step up converter capacitors.