Эта страница является
переводом страницы
Presence Simulator. Перевод выполнен на 100%.
Presence Simulator
When it is required to leave a house or an apartment unattended for several day, there appears a question of protection against intrusion. For a house not to attract attention of uninvited guests we offer a system to control light and other equipment imitating presence of house owners.
Solution for server project.
documentation was last updated on 28.8.2020
How does it work?
- Download an example of a server project from our website.
- Choose required drivers and channels to track.
- Assign control to graphic items.
- Start keeping track of channels.
- Start presence simulator.
Project Setting
The panel project contains tags of a virtual server to send a command to remember device events (7 and 14 days), to start simulation (7 and 14 days), to stop emulation and clear the database and it does not require further setting.
The server project contains two scripts required for work: Main and PresenceWorker. To set your project, open a tab of the "Main" script in the server project and enter all required data:
1 Enter the driver name you want to keep track of, the script will imitate the work of this device in the absence of house owners. "Modbus TCP" is used in the example.
2 Enter names of channels which changes you want to track:
3 Assign commands to control Database to an event (for example, when a button is pressed)
- Collect7 - Start collecting data for 7 days;
- Collect14 - Start collecting data for 14 days;
- Emulate7 - Start emulation for 7 days;
- Emulate14 - Start emuation for 14 days;
- Stop - Stop all launched processes;
- Clear - Clear the database.
You can create your own virtual command in there server project and write a required function in the Script Modifier field.
You can change the number of days to read and write in the corresponding functions “Collect” (read) and “Emulate” (write).
When data collection is launched all previous data in the database are deleted!
The emulation process starts with the second day of writing.
Script
These examples will help you to use more settings of script functions.
g_oPrecenceWorker.Collect
Start writing data.
Syntax
g_oPrecenceWorker.Collect(days);
| days
|
7
|
type: number start collecting data for a definite number of days
|
-
Sample
function ACollect7()
{
g_oPrecenceWorker.Collect(7);
}
g_oPrecenceWorker.Emulate
Start the emulation process
Syntax
g_oPrecenceWorker.Emulate(days, loop, starts_from);
| days
|
7
|
type: number number of days for emulation
|
| loop
|
false
|
type: boolean
- true - when emulation is over, the process starts from the begining;
- false - when emulation is over, the process won't start again.
|
| start_from
|
1
|
type: number day of emulation start
|
-
Sample
function AEmulate7()
{
g_oPrecenceWorker.Emulate(7);
}
g_oPrecenceWorker.Stop
Stop all processes
Syntax
g_oPrecenceWorker.Stop();
-
-
Sample
function AStop()
{
g_oPrecenceWorker.Stop();
}
g_oPrecenceWorker.Clear
Clear the database.
Syntax
g_oPrecenceWorker.Clear()
-
-
Sample
function AClear()
{
g_oPrecenceWorker.Clear();
}