Hydroponics, Tile Buttons to run scripts for pump/relay

assuming that you have both the code working fine and you are able to read sensor data.
so next is that you need to send the sensor data from this two code to cayenne.
Below is the basic code which is used to send data to cayenne.

#!/usr/bin/env python
import cayenne.client
import time
//include any library/packages you want to use.
# Cayenne authentication info. This should be obtained from the Cayenne Dashboard.
MQTT_USERNAME  = "MQTT_USERNAME"
MQTT_PASSWORD  = "MQTT_PASSWORD"
MQTT_CLIENT_ID = "MQTT_CLIENT_ID"


client = cayenne.client.CayenneMQTTClient()
client.begin(MQTT_USERNAME, MQTT_PASSWORD, MQTT_CLIENT_ID)
# For a secure connection use port 8883 when calling client.begin:
# client.begin(MQTT_USERNAME, MQTT_PASSWORD, MQTT_CLIENT_ID, port=8883)

i=0
timestamp = 0

while True:
    client.loop()
    //code to read your sensor.
    if (time.time() > timestamp + 10):
        //this sends data every 10 seconds. 
        client.celsiusWrite(1, i)
        client.luxWrite(2, i*10)
        client.hectoPascalWrite(3, i+800)
        timestamp = time.time()
        i = i+1

So there are three main things to consider:

have a look at this Data types for Cayenne MQTT API