Download the PHP package graystackit/laravel-testo-api without Composer

On this page you can find all versions of the php package graystackit/laravel-testo-api. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-testo-api

graystackit/laravel-testo-cloud

A Laravel package for the Testo Smart Connect API, built on Saloon 4.

Retrieve historical measurements, alarm events, HACCP task records, device properties, device health status, measuring object configurations, and location hierarchies from Testo Smart Connect — all with a clean, Laravel-native interface.

Requirements

Installation

Laravel auto-discovers the service provider. Then publish the config file:

Configuration

Add the following to your .env file:

Generate your API key from the Smart Connect home page. Keys are valid for up to one year.

Async Workflow

All data-export endpoints use the same two-step async pattern:

  1. Submit a POST request → receive a request_uuid
  2. Poll a GET request with that UUID until status is Completed
  3. Download each URL in dataUrls using downloadDataFile()

Usage

Resolve TestoCloudClient from the container or inject via constructor.


Measurements POST /v2/measurementsGET /v2/measurements/{uuid}

$from must be strictly before $to — an \InvalidArgumentException is thrown otherwise.

Parse NDJSON measurement data


Alarms POST /v3/alarmsGET /v3/alarms/{uuid}

Retrieve historical alarm events for the configured account.


Tasks POST /v3/tasksGET /v3/tasks/{uuid}

Retrieve quality-management / HACCP activity records executed by staff.


Device Properties POST /v3/devices/propertiesGET /v3/devices/properties/{uuid}

Retrieve device metadata including serial numbers, model codes, firmware versions, calibration status, and equipment relationships.

No date range required — returns current configuration.


Device Status POST /v3/devices/statusGET /v3/devices/status/{uuid}

Retrieve battery level, signal strength, last communication timestamp, firmware version, and serial numbers for all devices.

No date range required — returns current status snapshot.


Measuring Objects POST /v1/measuring-objectsGET /v1/measuring-objects/{uuid}

Retrieve measuring-object configurations including customer_uuid, customer_site, product_family_id, measurement settings, and channel assignments.

No date range required — returns current configuration.


Locations POST /v1/locationsGET /v1/locations/{uuid}

Retrieve the location hierarchy (sites, zones, rooms) associated with the account.

No date range required — returns current location structure.


Data Objects

Submission response — AsyncSubmitResponse

Returned by every submit*() method.

Property Type Description
requestUuid string UUID to use when polling status
status AsyncRequestStatus Enum — Submitted on initial response

Status response — AsyncStatusResponse

Returned by every check*Status() method.

Property Type Description
status AsyncRequestStatus Current state (see enum below)
dataUrls string[] Download URLs (populated when completed)
metadataUrl ?string Metadata file URL (populated when completed)
error ?string Error message (populated when failed)

Helper methods: isCompleted(), isProcessing(), isFailed()

AsyncRequestStatus enum

The enum normalises all API status strings, including "In Progress"Processing.

Legacy measurement objects

Used by checkRequestStatus() (measurements only):

Class Properties
MeasurementSubmitResponse requestUuid, status (string)
MeasurementStatusResponse status, dataUrls[], metadataUrl, error, helpers

Error Handling

All client methods throw GraystackIT\TestoCloud\Exceptions\TestoApiException on failure.

submit*Request() methods that accept a date range additionally throw \InvalidArgumentException when $from >= $to.

If TESTO_API_KEY is not configured, a \RuntimeException is thrown on container resolution.


API Endpoint Reference

Module Submit Check Status
Measurements POST /v2/measurements GET /v2/measurements/{uuid}
Alarms POST /v3/alarms GET /v3/alarms/{uuid}
Tasks POST /v3/tasks GET /v3/tasks/{uuid}
Device Properties POST /v3/devices/properties GET /v3/devices/properties/{uuid}
Device Status POST /v3/devices/status GET /v3/devices/status/{uuid}
Measuring Objects POST /v1/measuring-objects GET /v1/measuring-objects/{uuid}
Locations POST /v1/locations GET /v1/locations/{uuid}

Base URL: https://data-api.{region}.smartconnect.testo.com


Database Storage

Migration

Run the migration to create the testo_measurements table:

To customise the migration before running it, publish it first:

testo_measurements schema

Column Type Description
id bigint Auto-increment primary key
logger_uuid string|null Logger device UUID (populated when available)
measured_at timestamp Timestamp of the measurement
temperature decimal(8,4)|null Temperature reading
humidity decimal(8,4)|null Humidity reading
created_at timestamp Record insertion time
updated_at timestamp Record update time

Model

Disabling automatic storage

Set TESTO_STORE_MEASUREMENTS=false in your .env (or store_measurements => false in config/testo.php) to fetch and parse data without writing to the database.


Artisan Command

Fetches historical measurements from the Testo API, parses the NDJSON response, and — when storage is enabled — persists every row to testo_measurements.

Options

Option Default Description
--from= default_from_days ago Start date (Y-m-d)
--to= today End date (Y-m-d)
--format= JSON Export format (JSON or CSV)
--logger-uuid= (all loggers) Filter results to a single device UUID

Examples

Console output


Testing

Tests use Saloon's MockClient — no real API calls are made.

License

MIT


All versions of laravel-testo-api with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
illuminate/console Version ^11.0|^12.0|^13.0
illuminate/database Version ^11.0|^12.0|^13.0
illuminate/http Version ^11.0|^12.0|^13.0
illuminate/support Version ^11.0|^12.0|^13.0
saloonphp/saloon Version ^4.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package graystackit/laravel-testo-api contains the following files

Loading the files please wait ...