Home Automation Control of Android by SMS , WiFi , Internet , eMail (eHouse4Andoid) library for programming

eHouse Home Automation and communication with Android panels, smartphones, tablets, GSM Phones and other devices.
To send one or more system event  ehousecommunication class was created, with a single command (1 line of source code)
All functions of this class runs stastically (without creating an instance of the class) . Class ehousecommunication contains and is expanded to all methods of sending commands to control { Home Automation eHouse – Control To} eHouse  Building Automation for Controllers { Building Automation eHouse – Controllers } of devices with Android { Home Automation eHouse – Management } and  EHouse home automation – Software (Gallery of the software screens { Building Automation eHouse – Gallery of Software Control }) .

Currently these are:

  • SMS
  • eMail
  • TCP / IP (WiFi , Ethernet , Internet , Intranet , LAN , WAN)

Features available in the  ” ehousecommunication ” class for eHouse Automation


public static int AddAsciiEvent (String event)

Adding an event (command eHouse) for drivers to queue events for transmission of messages by any method
parameter event: the event code (written in code DirectEvent hex) according to standard eHouse:
example: ehousecommunication . AddAsciiEvent ( ” 37010101020000000000 ” ) ; Event – switch (change state) outputs 1 in RM 1 (address 55 , 1)

ehousecommunication . AddAsciiEvent ( ” 37010101020000000000 ” ) ; / / Toggle output 1 of RM1 – hex address (37h , 1) {} addrh – > ; 55 (37h) (address of the controller H) addrl – > ; A – (Address of the driver, L) command a – command => ; output setting arg a – output number (1) – a parameter for the command (no output) arg 2 – set value (2) – 2 for the command parameter (switch – change state) arg 3 – 3 for the command parameter arg 4 – 4 for the command parameter arg 5 – 5 for the command parameter arg 6 – 6 for the command parameter arg 7 – 7 for the command parameter

returns the number of bytes in the queue binary – 10 bytes for each added event .

Events are also added to the queue binary: EventToRunByte 10B each event
and text: EventToRun 20 characters each event (coded in ASCII hex code – as a function parameter)

If you send the events via TCP / IP,  a maximum of 20 events (200B) (binary is sent to the queue)  can be sent.
In the case of events sent via SMS You,  a maximum of seven events (sent to a queue of text) can be sent .
In the case of events sent by eMail You,  a maximum of seven events (sent to a queue of text)  can be sent.

For compatibility issues is best to adopt the lowest value for all methods (7) to be able to choose any form of transmission events from the queue to eHouse system controllers


public static void ClearEventQueue ()

Clears the contents of both queues events (binary and text and the length of the queue)

Example of use: ehousecommunication . ClearEventQueue () ;


public static void init ()

Initializes the communication settings for all modes – reads the configuration files of applications exported from ” eHouse . exe / mobile ” .

This feature must be activated first (before starting the transmission attempts , data synchronization, etc.)

Current configuration files must be uploaded to the SD card directory ” / ISYS / ” .
These files should be exported from an application eHouse and update if:

  • Changes in the hash – encryption code
  • transmission by changing the settings to any media
  • change passwords
  • adding / removing devices
  • rename drivers , O , I
  • changes to the graphic visualization of images

Example of use:

ehousecommunication . init () ;


static public String GetLog ()

returns the contents of the log
Example of use:

String Log = ehousecommunication . GetLog () ;


public static void ClearLog ()

Cleans automatic system log contains important information about the transmission, etc.
Example of use:

ehousecommunication . ClearLog () ;


static public String GetSmtpLog ()

returns the contents of the log to send emails through an SMTP server
Example of use:

String Log = ehousecommunication . GetSmtpLog () ;


public static void ClearSmtpLog ()

Clears the log automatically sending email through SMTP server
Example of use:

ehousecommunication . ClearSmtpLog () ;


public static boolean SendEmail ()

Sends an event queue by eMail

returns ” true ” how about

clears the event queue as ok

writes the results to the SMTP log

Example of use:

ehousecommunication . SendEmail () ;


public static boolean SendSMS ()

Sends an event queue by SMS

returns ” true ” how about

clears the event queue as ok

Example of use:

ehousecommunication . SendSMS () ;


public static boolean SendWiFi (String host , int port)

Sends an event queue for a TCP / IP (WiFi , Ethernet , Internet , LAN , WAN)

host – ip address of the server that receives a local or global events or services, or similar ddns
port – No port of the server that receives data

returns ” true ” how about

clears the event queue as ok

Example of use: locally for CommManager ‘ { control of blinds TCP/IP Communication module and GSM }

ehousecommunication . SendWiFi ( ” 192 . 168 . 0 . 254 ” , 9876) ;



A complete code example

Building automation eHouse – Android communicate with the SMS , WiFi , Internet , eMail source code

More information about the system (other controllers):

central heating control and recuperation
control gates

EHouse System Features:

Home Automation Savings Home Automation – Security

Home Automation eHouse – Independent System Design

Building Automation eHouse – Self-Installation