Constraining properties of dusty environments by infrared variability