Skip to main content

Simulating occupancy at home

Leaving a house or apartment unattended for several days raises the question of protection against unauthorized entry. To avoid attracting unwanted attention to the house, we offer a system that controls lighting and other equipment to simulate the owners' presence.

Note

This solution is for a server project and requires iRidi Server.

Documentation updated 01.01.2024

How it works...

  1. Download the sample server project from our website.
  2. Subscribe to the required drivers and channels.
  3. Link the controls to the graphical interface.
  4. Start monitoring the channels.
  5. Start presence simulation.

Configuring a project​

The Panel Project contains virtual server tags for commands to record device events (7 and 14 days), start emulation (7 and 14 days), stop emulation, and clear the database (DB). It requires no further configuration.

The server project contains two scripts required for operation: Main and PresenceWorker. To configure your project, open the "Main" script tab in the server project and enter all the required data:

  1. Specify the name of the driver to subscribe to. The script will simulate this device's operation while the owners are away. This example uses "Modbus TCP".

Simulator1.png

  1. Specify the names of the channels to subscribe to and monitor for incoming data:

Simulator2.png

  1. Link the database (DB) control commands to an event (for example, a button press).

Simulator3.png

  • Collect7 - Start collecting data for 7 days;
  • Collect14 - Start collecting data for 14 days;
  • Emulate7 - Start emulating 7 days;
  • Emulate14 - Start emulating 14 days;
  • Stop - Stop all running processes;
  • Clear - Clear the database.
Note
  • You can create your own virtual command in the server project and specify the required function in the Script Modifier field.
  • You can change the number of days for reading and writing in the corresponding "Collect" (reading) and "Emulate" (writing) functions.

Simulator4.png

Important
  • Starting data collection deletes all previous database records!
  • Emulation starts from the second day of recording.

Script​

These examples let you use more advanced settings for the script functions.

g_oPrecenceWorker.Collect​

Start recording data.

Syntax

g_oPrecenceWorker.Collect(days);

InputValueDescription
days7type: number
start collecting data for a specified number of days
Output
-

Example

function ACollect7()
{
g_oPrecenceWorker.Collect(7);
}

g_oPrecenceWorker.Emulate​

Start emulation.

Syntax

g_oPrecenceWorker.Emulate(days, loop, starts_from);

InputValueDescription
days7type: number
number of days to emulate
loopfalsetype: boolean
* true - restart the process when emulation finishes;
* false - do not restart the process when emulation finishes.
start_from1type: number
day on which emulation starts
Output
-

Example

function AEmulate7()
{
g_oPrecenceWorker.Emulate(7);
}

g_oPrecenceWorker.Stop​

Stop all processes.

Syntax

g_oPrecenceWorker.Stop();

InputValueDescription
-
Output
-

Example

function AStop()
{
g_oPrecenceWorker.Stop();
}

g_oPrecenceWorker.Clear​

Clear the database.

Syntax

g_oPrecenceWorker.Clear()

InputValueDescription
-
Output
-

Example

function AClear()
{
g_oPrecenceWorker.Clear();
}