Building Automation eHouse – Creating a Windows software overlays and custom algorithms

Home Automation eHouse with PC software allows you to create overlays for building automation system .


This allows you to create your own , individual algorithms , are not implemented in firmware or driver software that controls the serial Home Automation eHouse .

To this end, we provide users with the software source codes (in Delphi 5). They can be compiled with newer versions of Delphi or used for other programming languages.

We consciously chose this archaic versions as they are already available for free for amateur program.

They work just as reliably on Windows XP , Vista , Windows 7 both 32 and 64 bit .

This software is called eHouseLogAnalizer and these logs template applications that read text files up to date.

It can be managed and monitored by applications KillWdt.exe .

Key features of the application:

  • Reading out the status and names of all the drivers
  • Read status and enter the names of all drivers
  • Read the measurements and the names of all the drivers measuring inputs
  • Load all the data to the internal program memory , which can be further processed by an application

The application uses the status of created files to text files in a directory ‘logs/status/’ extension ‘.status’ .
The file is read only in the event of changes in the application eHouse.exe .

Data controllers are loaded in the following instances Records “ehouse_rm_em_hm” listed in the array RM .

In addition, data are kept HeatManager the following variables:

bonfire_status: string ; // Status of bonfire for HeatManager – Status fireplace heating panel eHouse.exe

boiler_status: string ; // Status of boiler for HM – status of the boiler heating panel eHouse.exe

Solar_status: string ; // Status of solar system – status of solar heating panel eHouse.exe

recuperator_status: string ; // Status of recuperation , ventilation , air heating – status of heating ventilation and heat recovery

HADC: array [0 . . 15] of double ; // Heat Temperatures manager – temperature measurements HeatManager

// Heat manager indexes for direct access of HADC array – Constant temperature indices for direct reading of temperature HeatManager

CONST HM_GWC = 3 ; // GWC – Ground Heat Exchanger

HM_KOM1 = 4 ; // Fireplace Coat 1 – Bonfire water jacket 1

HM_KOMKONV = 5 ; // Fireplace convection – convection bonfire

HM_KOM2 = 6 ; // Fire PLANE 2 – bonfire water jacket 2 (backup)

HM_TWEWN = 7 ; // Internal room temperature – internal room temperature

HM_SOLAR = 9 ; // Collector sun – solar system

HM_ZEWNPN = 8 ; // External temperature north – external temperature north

HM_ZEWNPD = 1 ; // External temperature of the south – external temperature south

HM_KOC = 10 ; // Temperature boiler – boiler temperature

HM_BANDOL = 11 ; // CO / hot water tank down – hot water bottom buffer

HM_REQIN = 12 ; // Clean air recuperator input – recuperation clear air input

HM_REQOUT = 13 ; // Output recuperator home – heaten recuperation fresh blow air to room – temperature

HM_NAG = 14 ; // Temperature controlled three-way valve for heating and for radiators – temperature after three ways cutoff for water heater or other heating system

HM_REQWYC = 15 ; // Home recuperator extract dirty – recuperation from home dirty exhaust temp

HM_BANGORA = 2 ; // Heating / hot water tank top – hot water buffer TOP

HM_BANSRO = 0 ; // Heating / hot water storage tank a means of – MIDDLE hot water buffer

var HADCNames: array [0 . . 15] of string ; // The names of the sensors (measuring inputs) HeatManager
Basic functions EhouseLogAnalizer:

procedure init_heat_temperature_names ; // Initialize and / or temperature sensors read the names of HM

procedure loadnames_rm ; // Load RoomManagerów names (eHouse 1)

procedure readethernetdevs ; // Reads the Ethernet driver names (eHouse 2)

get_index_rm function (str: string): integer ; // Returns the index of the table with roomManager search by file name status

function gb (chr: char): boolean ; // Returns a boolean value for the read status

adc_hm procedure (str: string ; index: integer) ; // Converts the string with recorded temperatures of the read status HeatManager

adc_rm procedure (str: string ; index: integer) ; // Converts string of analog measurements when reading the status RoomManagerów

gbs function (b: boolean): String ; // Write boolean in text form (0 , 1)

RMDeviceIndexByName function (str: string): integer ; // Returns the index of the table with RoomManager search by name driver

RMGetOutputStateNr function (index: integer ; OutputNr: integer): boolean ; // Return the output state RM [index] and the output number OutputNR

RMGetOutputState function (index: integer ; OutputName: string): boolean ; // Returns the output state RM [index] and called out OutputName

RMGetInputStateNr function (index: integer ; InputNr: integer): boolean ; // Returns the status of the input RM [index] and the number of entry InputNr

RMGetInputState function (index: integer ; InputName: string): boolean ; // Returns the status of the input RM [index] and the name of the entry InputName

RMGetTempNr function (index: integer ; InputNr: integer): double ; // Returns the RM temperature [index] and the number of entry InputNr

RMGetTemp function (index: integer ; InputName: string): double ; // Returns the RM temperature [index] and the name of the entry InputName

RMGetInvPercent function (index: integer ; InputName: string): double ; // Returns a percentage measurement of reverse 100 % – x RM [index] and the name of the entry InputName (in relation to the supply voltage controller)

RMGetInvPercentNr function (index: integer ; InputNr: integer): double ; // Returns a percentage measurement of reverse 100 % – x RM [index] and the number of entry InputNr (in relation to the supply voltage controller)

RMGetPercent function (index: integer ; InputName: string): double ; // Returns a percentage measurement of RM [index] and the name of the entry InputName (in relation to the supply voltage controller)

RMGetPercentNr function (index: integer ; InputNr: integer): double ; // Returns a percentage measurement of reverse 100 % – x RM [index] and the name of the entry InputNr (in relation to the supply voltage controller)

RMGetDeviceOutputState function (Devname: string ; OutputName: string): boolean ; // Returns the state of the output driver called Devname and called out OutputName

RMGetDeviceInputState function (Devname: string ; InputName: string): boolean ; // Returns the status of the driver input the name and the name of the entry Devname InputName

HMGetTemp function (InputName: string): double ; // Return temperature of the measuring input called for HeatManager InputName

HMGetTempNr function (InputNr: integer): double ; // Return temperature of the measuring input number for HeatManager InputNr (1 . . 16)

chk_int function (st: string): integer ; // Safe to convert a string to an integer

procedure update_status ; // Update the status of all the drivers in the table (must be run periodically)

procedure Test_save ; // Test procedure to write the results to a text file for easy

Initialize the driver and all the names are made once the application is started (FormCreate)

procedure TForm1 . FormCreate (Sender: TObject) ;

begin

path: = getcurrentdir () ; // Get the current path of the program must be in the directory % eHouse_DIR % \ BIN \

path: = stringreplace (path , ‘ \ Bin ‘ , ‘ \ ‘ , [Rfignorecase]) ; // Get path of application eHouse – sets the application path eHouse

loadnames_rm ; // Load controller names ehouse1 – loads the drivers name eHouse 1

init_heat_temperature_names; // Load sensors heatManager name

readethernetdevs; // Load controllers ethernet eHouse names – reading device names eHouse 2

timer1.Interval: = 3000; // Set cyclic task interval in milliseconds – Sets the time to start checking cyclic data

timer1.Enabled: = true; // Start automatic tasks (status update – includes regular checking of data

update_status; // Reads the first status

end;

Cyclic data checking is done by the function Timer1 (Timer1Timer) runs in an interval of time set in the parameter Timer1.Interval (in milliseconds) .

procedure TForm1.Timer1Timer (Sender: TObject) ;

var tf: textfile ;

begin

update_status ; // Converts the status of the driver

Test_save ; // For test writes all results to a text file

try // create a marker file for the application KillExec . exe that can ” watch ” application before crash

AssignFile (tf , path + ‘logs\log-analizer.stp ‘ ) ;

// Notify WDT That application working correctly using stampfile “log\log-analizer.stp”

rewrite (tf) ;

writeln (tf , ‘1’ ) ;

finally ;

closefile (tf) ;

end ;

end ;