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.
This solution is for a server project and requires iRidi Server.
Documentation updated 01.01.2024
How it works...
- Download the sample server project from our website.
- Subscribe to the required drivers and channels.
- Link the controls to the graphical interface.
- Start monitoring the channels.
- Start presence simulation.
Example: Panel Project
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:
- 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".
- Specify the names of the channels to subscribe to and monitor for incoming data:

- Link the database (DB) control commands to an event (for example, a button press).
- 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.
- 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.

- 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);
| Input | Value | Description |
|---|---|---|
| days | 7 | type: 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);
| Input | Value | Description |
|---|---|---|
| days | 7 | type: number number of days to emulate |
| loop | false | type: boolean * true - restart the process when emulation finishes; * false - do not restart the process when emulation finishes. |
| start_from | 1 | type: number day on which emulation starts |
| Output | ||
|---|---|---|
| - |
Example
function AEmulate7()
{
g_oPrecenceWorker.Emulate(7);
}
g_oPrecenceWorker.Stop
Stop all processes.
Syntax
g_oPrecenceWorker.Stop();
| Input | Value | Description |
|---|---|---|
| - |
| Output | ||
|---|---|---|
| - |
Example
function AStop()
{
g_oPrecenceWorker.Stop();
}
g_oPrecenceWorker.Clear
Clear the database.
Syntax
g_oPrecenceWorker.Clear()
| Input | Value | Description |
|---|---|---|
| - |
| Output | ||
|---|---|---|
| - |
Example
function AClear()
{
g_oPrecenceWorker.Clear();
}