json has array of lights. Controling looping from ios