CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/pypi-arduino-iot-client

Arduino IoT Cloud API Python Client for managing devices, things, properties, and timeseries data

Overview
Eval results
Files

properties.mddocs/

Property Management

Real-time and historical property data management with timeseries support. Properties represent data points associated with IoT things that can be read, written, and monitored over time.

Core Imports

from iot_api_client.api import (
    PropertiesV2Api,
    PropertyTypesV1Api
)
from iot_api_client.models import (
    ModelProperty,
    PropertyValue,
    ArduinoProperty,
    ArduinoPropertytype,
    ArduinoSeriesResponse
)

Capabilities

Property CRUD Operations

Core property management operations for creating, reading, updating, and deleting thing properties.

class PropertiesV2Api:
    def properties_v2_create(self, id: str, model_property: ModelProperty, x_organization: str = None) -> ArduinoProperty:
        """
        Creates a property associated to the given thing.

        Args:
            id: Thing ID
            model_property: Property creation payload
            x_organization: Organization ID for organization-level access

        Returns:
            ArduinoProperty: Created property object
        """

    def properties_v2_list(self, id: str, show_deleted: bool = None, x_organization: str = None) -> List[ArduinoProperty]:
        """
        Returns the list of properties associated to the given thing.

        Args:
            id: Thing ID
            show_deleted: Include deleted properties
            x_organization: Organization ID for organization-level access

        Returns:
            List[ArduinoProperty]: List of property objects
        """

    def properties_v2_show(self, id: str, pid: str, show_deleted: bool = None, x_organization: str = None) -> ArduinoProperty:
        """
        Returns the property requested by the user.

        Args:
            id: Thing ID
            pid: Property ID
            show_deleted: Include deleted properties
            x_organization: Organization ID for organization-level access

        Returns:
            ArduinoProperty: Property object
        """

    def properties_v2_update(self, id: str, pid: str, model_property: ModelProperty, x_organization: str = None) -> ArduinoProperty:
        """
        Updates a property associated to the given thing.

        Args:
            id: Thing ID
            pid: Property ID
            model_property: Property update payload
            x_organization: Organization ID for organization-level access

        Returns:
            ArduinoProperty: Updated property object
        """

    def properties_v2_delete(self, id: str, pid: str, force: bool = None, x_organization: str = None) -> None:
        """
        Removes a property associated to the given thing.

        Args:
            id: Thing ID
            pid: Property ID
            force: Force deletion even if property has data
            x_organization: Organization ID for organization-level access
        """

Property Value Publishing

Publish real-time values to properties.

class PropertiesV2Api:
    def properties_v2_publish(self, id: str, pid: str, property_value: PropertyValue, x_organization: str = None) -> None:
        """
        Publish a property value to Arduino IoT Cloud.

        Args:
            id: Thing ID
            pid: Property ID
            property_value: Value to publish
            x_organization: Organization ID for organization-level access
        """

Timeseries Data Access

Retrieve historical property data with flexible time ranges and aggregation options.

class PropertiesV2Api:
    def properties_v2_timeseries(self, id: str, pid: str, desc: bool = None, start: str = None, end: str = None, interval: int = None, x_organization: str = None) -> ArduinoSeriesResponse:
        """
        Get property timeseries data.

        Args:
            id: Thing ID
            pid: Property ID
            desc: Sort results in descending order
            start: Start timestamp (RFC3339 format)
            end: End timestamp (RFC3339 format)
            interval: Aggregation interval in seconds
            x_organization: Organization ID for organization-level access

        Returns:
            ArduinoSeriesResponse: Timeseries data
        """

Property Types

Discover available property types for creating properties.

class PropertyTypesV1Api:
    def property_types_v1_list_types(self) -> List[ArduinoPropertytype]:
        """
        Returns the list of available property types.

        Returns:
            List[ArduinoPropertytype]: Available property types
        """

Usage Examples

Creating a Property

from iot_api_client.models import ModelProperty

# Create a temperature property
temperature_property = ModelProperty(
    name="temperature",
    type="FLOAT",
    permission="READ_WRITE",
    variable_name="temp",
    persist=True,
    tag=1,
    update_strategy="ON_CHANGE",
    min_delta=0.1
)

property_obj = properties_api.properties_v2_create("thing-id", temperature_property)
print(f"Created property: {property_obj.name} (ID: {property_obj.id})")

Publishing Property Values

from iot_api_client.models import PropertyValue
from datetime import datetime

# Publish a temperature reading
value = PropertyValue(
    value=23.5,
    created_at=datetime.utcnow()
)

properties_api.properties_v2_publish("thing-id", "property-id", value)

Retrieving Timeseries Data

from datetime import datetime, timedelta

# Get last 24 hours of data with 1-hour intervals
end_time = datetime.utcnow()
start_time = end_time - timedelta(days=1)

timeseries = properties_api.properties_v2_timeseries(
    "thing-id",
    "property-id",
    start=start_time.isoformat() + "Z",
    end=end_time.isoformat() + "Z",
    interval=3600  # 1 hour in seconds
)

for data_point in timeseries.data:
    print(f"Time: {data_point.timestamp}, Value: {data_point.value}")

Getting Available Property Types

# List all available property types
property_types = property_types_api.property_types_v1_list_types()

for prop_type in property_types:
    print(f"Type: {prop_type.type}, Description: {prop_type.description}")

Types

class ModelProperty:
    max_value: float
    min_value: float
    name: str
    permission: str  # "READ", "WRITE", "READ_WRITE"
    persist: bool
    tag: int
    type: str  # Property type (FLOAT, INT, BOOL, STRING, etc.)
    update_parameter: float
    update_strategy: str  # "ON_CHANGE", "TIMED"
    variable_name: str
    min_delta: float

class PropertyValue:
    value: Any
    created_at: datetime

class ArduinoProperty:
    created_at: datetime
    deleted_at: datetime
    href: str
    id: str
    last_value: Any
    linked_variables: List[ArduinoLinkedvariable]
    max_value: float
    min_value: float
    name: str
    persist: bool
    permission: str
    tag: int
    thing_id: str
    type: str
    update_parameter: float
    update_strategy: str
    updated_at: datetime
    variable_name: str

class ArduinoPropertytype:
    type: str
    description: str

class ArduinoSeriesResponse:
    count_values: int
    data: List[TimeseriesDataPoint]
    from_date: datetime
    interval: int
    message: str
    query: str
    resp_version: int
    series_limit: int
    sort: str
    status: str
    times: List[str]
    to_date: datetime
    values: List[Any]

class TimeseriesDataPoint:
    timestamp: str
    value: Any

Install with Tessl CLI

npx tessl i tessl/pypi-arduino-iot-client

docs

dashboards.md

devices.md

index.md

lora.md

properties.md

series.md

things.md

tile.json