The idea is simple: By giving a device (real or dummy) in Domoticz a name constructed by adding a pre-determined prefix to an existing device/group name, Lua is used to detect when *any* device with that prefix changes state and to carry out a specific action on an existing physical device/group defined already in Domoticz (and named with… This is a bit short, i would like to extend it to a longer period.

This is a script is used to determine if anyone is still upstairs, it is a time based script that runs every minute and it uses two motion detectors to determine if there is any movement upstairs, and which direction (up or down) the last person was heading, if there is no motion upstairs, and the last person was heading downstairs it turns off all lights in the group "scene:lights_upstairs" when 30 minutes have passed. This Lua time script will run every minute (if named script_time_ping.lua) and checks the status of a device by sending one IP ping command to its IP address. This wiki describes how combining Lua scripting with a clever device-naming convention based on the use of name-prefixes can make existing dumb devices smarter. Using time difference in seconds between time that script runs (t1) and the time the door status was last seen. There is already a lot of information available on the forum, but this is scattered throughout. the purpose of: commandArray['wakeup-server'] = 'Off' is to make sure that the wake on lan event only gets triggered once, since the script lacks any state checking capability 5. SimpleCppBinding. Table of contents. For every device create a user variable in Domoticz (set value to 1) This simple script sends a "wake on lan" event to a predefined host using the command "etherwake" on linux. With the script, Domoticz looks if the motion sensor stays in the 'Off' status for more than 30 minutes.The script above needs a uservariable called 'nomotionCounter', type 'Integer' and value '0' (zero).To create a more advanced motion detection system this script allows you to combine multiple detectors with multiple switches. [HC2] Lua scene – examples. There is already a lot of information available on the forum, but this is scattered throughout. 2. Description. Should the test be performed more often then once a minute a shell script can be used which can be found This Lua script checks the presence of a device by using the ping command. 5 = the delay in minutes (in this case if the device doesn't response 5 times in a row the switch is turned off) Blockly framework is developed by google.Wikipedia

Using a kaku/coco keyfob named "Surveillance mode". 2.

For every device create a dummy switch in Domoticz Many other examples of the use of Lua can be found by searching for Lua on the discussion forum and other pages on the wiki for specific situations (i.e. the argument to etherwake is the mac address of the computer to be woken. My motion sensors are X10, check the motion status on your pirs using: for i, v in pairs(devicechanged) do print(i, v) end Example: local t = domoticz.utils.fromJSON('{ "a": 1 }'). Scripts and logic to do that can be found under the automation par…

The motion sensor itself will switch back to 'Off' when no motion is detected anymore after 4 minutes.

However this will "hold up" the script for 3 seconds. You don't need to pair your device. ''Alert#Motion detected while in surveillance mode!

Should the device not respond to the first ping -c1 could be changed to -c3 to have it send three pings. Note that it goes to "Group On" when on!

Fill in the MAC-address (Bluetooth!) C++. C. VectorLibrarySample. I created a script that looks at the status of a motion sensor (Z-Wave) to detect presence. This code has 3 devices but you can expand with as many as you want. The script example above has the potential of locking the Domoticz's event system for up to 10 seconds in case that the assert function doesn't return within that time. For an introduction and overview/tutorial specific to Domoticz, see this wiki page: Scripting in Domoticz. Turns a json string to a Lua table. Blockly is an simple way to get started with automation and scripting in Domoticz.It's not as powerful as LUA and the other types of scripting that can also be used but an easy start This is how a script could look. ''turning off, no movement upstairs for more than 30m'Using Ping command to check the status of a network deviceUsing Ping & Bluetooth to check the status of a network deviceMotion detector 30 minute time-out (presence detection)--print('No motion has been detected for: ' ..no_motion_minutes.. ' minutes')--change the 30 to the amount of minutes you preferAdvanced motion detection with multiple detectors, switches and configurable timeouts-- The hallway_floor_0 is the variable name chosen earlier-- The detectors below can be anything that turns "On" when there's activity-- Store the no motion counter in the variable again-- If we have reached the timeout, disable the linked switches-- The hallway_floor_0 is the variable name chosen earlier-- The detectors below can be anything that turns "On" when there's activity-- Loop through all the changed devices sent by the trigger-- Check if it is one of the detectors and is set to "On"-- If one of the sensors was turned on, enable the light and reset the no motion variable

If you are thinking of contributing source code the SourceCodeFormatter may be helpful to you. LUA commands and variables list for use in Domoticz. This pageis a place to find & share useful scripts to enhance the capabilities of your Domoticz system, including specific details related to specific scripting languages.