Anyone feel like making a device handler?


(Spinn360) #1

I have failed repeatedly trying to make a device handler for a device that works with this code (groovy on computer) It takes a local (IPaddress), and a (authToken) for the two inputs from the user, to create a url of (IPaddress):3003/getData?authToken=(authToken). Can this even be done on SmartThings device handlers?
Any of the experts feel like showing off their skills and make this for me?

 import groovy.json.JsonSlurper
    def i=100;
    //create the timer for between iterance
    		Thread y = new Thread();

    while(i>0){
          def jsonSlurper = new JsonSlurper()
          def object = jsonSlurper.parseText('http://192.168.1.109:3003/getData?authToken=filvhe'.toURL().text)
//print motion value from object.movement
          println("Motion: " + object.movement);
//print temp from object.temperature
          println("Temp: "+ object.temperature);
//print illuminance from object.lightValue
          println("LightValue: " + object.lightValue);
          //timer run for 1 second
    				y.sleep(1000);
    				i--;
    				println "\n";
               
    }