Help using the read_write "onChange" function to control a relay based on DHT readings

The concept behind "onChange" is often called state change detection:

You can do the same stuff on analog sensors: You compare the value to what it was before, and if it is different, act, and save the new value for next time.