-- Put this 'script_device_VcNotifications.lua' file in ...YOURCOMPUTER_PROGRAMS\Domoticz\scripts\lua folder. -- Simple lua script that will trigger an event in VC called "Domoticz.state" each time devices switch to state on or off. -- The "Domoticz.state" event will have 2 payloads: {1} is the device name, {2} is the device state (on or off). -- This script uses the udpsender.exe program that comes in the VoxCommando Extras zip file, available at -- Put udpsender.exe in a directory that is accessible on your Domoticz server (e.g. 'C:/Users/YOURUSERNAME/') -- In the script below, edit the UDPfilepath variable to point to the correct filepath on your system. commandArray = {} print ("All based event fired"); UDPfilepath = 'C:/Users/USERNAMEHERE/udpsender.exe' --REPLACE WITH THE CORRECT FILE PATH ON YOUR COMPUTER thisDevice=next(devicechanged) if devicechanged[thisDevice]=='On' then os.execute(UDPfilepath..' 33000 "vc.triggerevent&&Domoticz.state&&'..thisDevice..'&&On') print(thisDevice.." Device is On") elseif devicechanged[thisDevice]=='Off' then os.execute(UDPfilepath..' 33000 "vc.triggerevent&&Domoticz.state&&'..thisDevice..'&&Off') print(thisDevice.." Device is Off") end --end return commandArray