PHPackages                             alexcane/php-mettlertoledo - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. alexcane/php-mettlertoledo

ActiveLibrary[HTTP &amp; Networking](/categories/http)

alexcane/php-mettlertoledo
==========================

A PHP Library for Communicating with Mettler Toledo balances

v2.0.1(1mo ago)07MITPHPPHP ^8.1CI passing

Since Nov 6Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/alexcane/php-mettlertoledo)[ Packagist](https://packagist.org/packages/alexcane/php-mettlertoledo)[ Docs](https://github.com/alexcane)[ RSS](/packages/alexcane-php-mettlertoledo/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (2)Versions (4)Used By (0)

PHPMettlerToledo
================

[](#phpmettlertoledo)

A PHP Library for network communication with Mettler Toledo balances and scales that use the Mettler Toledo Standard Interface Command Set (MT-SICS). This works is based on [repo atlantis-software/mt-sics](https://github.com/ricado-group/dotnet-mettlertoledo)and [repo ricado-group/dotnet-mettlertoledo](https://github.com/ricado-group/dotnet-mettlertoledo)

Requirements
------------

[](#requirements)

- PHP 8.1 or higher
- ext-mbstring

Installation
------------

[](#installation)

Run `composer require alexcane/php-mettlertoledo`

Example
-------

[](#example)

Take a look in Example.php

```
use PhpMettlerToledo\MTSICS;

$scale = new MTSICS('192.168.1.100', 4305);
if($scale->isConnected()){
    $weight = $scale->readNetWeight();
} else {
    $error = $scale->getError()
}
```

Documentation
-------------

[](#documentation)

functionreturns valuedescriptionreadCommandsAvailable()arrayRetrieves a list of available commands supported by the Mettler Toledo scale.readWeightAndStatus()floatReads the current weight and status from the scale.readTareWeight()floatReads the tare weight from the scale.readNetWeight()floatReads the net weight from the scale, irrespective of balance stability.zeroStable()boolZeros the scale using a stable zero method.zeroImmediately()boolZeros the balance immediately regardless the stability of the balance.tareStable()boolSets the tare on the scale using a stable method.tareImmediately()boolSets the tare on the scale immediately regardless the stability of the balance.clearTare()boolClears the current tare value on the scale.readFirmwareRevision()stringReturns the balance SW version and type definition number.readSerialNumber()stringReturns the serial number of the scale.getError()stringReturns the last error message encountered.Testing
-------

[](#testing)

### Unit Testing (without hardware)

[](#unit-testing-without-hardware)

As of v2.0.0, you can use dependency injection to test your code without requiring a physical scale:

```
use PhpMettlerToledo\MTSICS;
use PhpMettlerToledo\SICS\ExecuteCommandInterface;

// Create a mock for testing
$mockExecuteCommand = $this->createMock(ExecuteCommandInterface::class);
$mockExecuteCommand->method('readNetWeight')->willReturn(123.45);

// Inject the mock
$scale = new MTSICS('192.168.1.100', 4305, $mockExecuteCommand);
$weight = $scale->readNetWeight(); // Returns 123.45
```

### Integration Testing (with hardware)

[](#integration-testing-with-hardware)

To run integration tests with a physical scale, update the IP address in `tests/PhpMettlerToledo/CommandTest.php` and run:

```
vendor/bin/phpunit tests/PhpMettlerToledo/CommandTest.php
```

Note: `CommandTest.php` is excluded from the default test suite as it requires physical hardware.

Upgrade Guide
-------------

[](#upgrade-guide)

### From v1.x to v2.0

[](#from-v1x-to-v20)

**Breaking change**: Minimum PHP version is now 8.1.

If you're still on PHP 7.4 or 8.0, you need to either:

- Upgrade your PHP version to 8.1 or higher, OR
- Stay on v1.x of this library (which will no longer receive updates)

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance92

Actively maintained with recent releases

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~255 days

Total

3

Last Release

41d ago

Major Versions

v1.0.0 → v2.0.02025-11-18

PHP version history (2 changes)v1.0.0PHP ^7.4 || ^8.0

v2.0.0PHP ^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/4d44e61b6e38602d7d6e0da5c52832d5017898060d5c3561838a1e47411a0067?d=identicon)[alexcane](/maintainers/alexcane)

---

Top Contributors

[![alexcane](https://avatars.githubusercontent.com/u/12563984?v=4)](https://github.com/alexcane "alexcane (24 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/alexcane-php-mettlertoledo/health.svg)

```
[![Health](https://phpackages.com/badges/alexcane-php-mettlertoledo/health.svg)](https://phpackages.com/packages/alexcane-php-mettlertoledo)
```

###  Alternatives

[friendsofsymfony/rest-bundle

This Bundle provides various tools to rapidly develop RESTful API's with Symfony

2.8k73.3M319](/packages/friendsofsymfony-rest-bundle)[php-http/discovery

Finds and installs PSR-7, PSR-17, PSR-18 and HTTPlug implementations

1.3k309.5M1.2k](/packages/php-http-discovery)[nyholm/psr7

A fast PHP7 implementation of PSR-7

1.3k235.4M2.4k](/packages/nyholm-psr7)[pusher/pusher-php-server

Library for interacting with the Pusher REST API

1.5k94.8M293](/packages/pusher-pusher-php-server)[spatie/crawler

Crawl all internal links found on a website

2.8k16.3M52](/packages/spatie-crawler)[react/http

Event-driven, streaming HTTP client and server implementation for ReactPHP

78126.4M414](/packages/react-http)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
