Code running on the sensor for the CitizenWatt project.