Great work! Got this kind of scripted myself, but I have Domoticz start a script on each device-input. This might be a good upgrade to my own code. :) Just to be sure I got this correct: You make a event for each device. That event fires the LUA script, that on its turn runs the PHP code through ...