 unsigned long measureInterval = 60000; // can send data to thingspeak every 15s, but once a minute is fine
 
 bool pumpOn = false;
+heardFromSensor = false;
 float waterHeight = 1000; // we want to make sure the relay isn't falsely triggered on from the get-go
 //################### update these vars ###################
 float lowerCutoff = 20; // lowest acceptable water height, in inches

		Particle.publish(eventPrefix + "/waterTankPump/pumpOn", boolToText(pumpOn));
		(data == "true") ? lastSignal = millis() : Serial.println(data);
	} else if (event == eventPrefix + "/waterTankSensor/waterHeight") {
		waterHeight = data.toFloat();
	}
}
}

void autoPumpControl() {
	if (heardFromSensor) {
		if (pumpOn) {
			if (millis() - lastSignal > pumpTimeout) { // if we haven't heard from the water tanks in a while, turn off the pump
				relayControl("off");
			}
		}
		if (waterHeight < lowerCutoff && millis() - lastPumpTimeOff > pumpOffTime) {
			success = relayControl("on");
		} else if (waterHeight > higherCutoff) {
			success = relayControl("off");
			lastPumpTimeOff = millis();
		} else {
			Serial.println("not doin nothin");
		}
	}
}

