Temperature Probe

Temperature Probe

Recorded Data

The Temperature Probe records the following attribute during operation:

  • celcius: The temperature value measured by the temperature probe in degrees Celsius.

Python API

The Temperature Probe can be controlled and monitored using the Aqueduct Python API. The Python code for interacting with the temperature probe can be found in the aqueduct-py repository.

The probe.py module provides functions and classes to control the temperature probe and retrieve temperature readings. You can use this API to perform temperature measurements and integrate the temperature probe into your Python applications and automation scripts.

To use the Python API, you can import the TemperatureProbe class from the probe.py module and create an instance of the temperature probe. Then, you can call the available methods to retrieve temperature readings and perform other operations.

Here's an example of how to use the TemperatureProbe API:

import time

from aqueduct.core.aq import Aqueduct
from aqueduct.core.aq import InitParams
from aqueduct.core.units import TemperatureUnits
from aqueduct.devices.temperature import TemperatureProbe

# Parse the initialization parameters from the command line
params = InitParams.parse()

# Initialize the Aqueduct instance with the provided parameters
aq = Aqueduct(params.user_id, params.ip_address, params.port)

# Perform system initialization if specified
aq.initialize(params.init)

# Set the command delay for the Aqueduct instance
aq.set_command_delay(0.05)

# Get the temperature probe device from the Aqueduct instance
temperature_probe: TemperatureProbe = aq.devices.get("temperature_probe_000001")

temperature_probe.set_sim_values((25.0,), TemperatureUnits.FAHRENHEIT)

temperature_probe.set_sim_rates_of_change((1.0,), TemperatureUnits.FAHRENHEIT)

# Continuously perform operations on the temperature probe device
while True:
    # Get and print the temperature reading from the temperature probe device
    print(
        f"Temperature: {temperature_probe.fahrenheit[0]:.3f}F, "
        f"{temperature_probe.celsius[0]:.3f}C"
    )

    # Pause for 5 seconds
    time.sleep(5)

Please refer to the aqueduct-py repository for more details on how to use the Python API with the Temperature Probe.

Supported Hardware