When you want to connect an IoT device to anything (or, for that matter, anything to anything), you should take a serious look at Node-RED, a free, open source visual process wiring system from IBM ...
You can also change the time using the xset s [value] command, where [value] is the time in seconds. The default value is 600 ...