Have a look at the functions I have here. The first one scales the input, then outputs the current based on voltage. All you need to do is set the temperature range you want to start reducing the current inside the function. The second function filters for a change, so the values are not constantly written.