PHPackages                             topphp/topphp-meter-api - 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. [API Development](/categories/api)
4. /
5. topphp/topphp-meter-api

ActiveLibrary[API Development](/categories/api)

topphp/topphp-meter-api
=======================

v1.1.4(5y ago)3151MITPHPPHP ~7.2

Since Oct 17Pushed 5y ago1 watchersCompare

[ Source](https://github.com/topphp/topphp-meter-api)[ Packagist](https://packagist.org/packages/topphp/topphp-meter-api)[ RSS](/packages/topphp-topphp-meter-api/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (6)Dependencies (3)Versions (7)Used By (0)

topphp/topphp-meter-api
=======================

[](#topphptopphp-meter-api)

[![Latest Version on Packagist](https://camo.githubusercontent.com/9fbeabdca01460dadde8fa798ba4ee7201798bb948daf3bb9d76aedf791de141/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f746f707068702f746f707068702d6d657465722d6170692e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/topphp/topphp-meter-api)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/af6e56e994fd60ea2b95183132a8856ab99c9070ad8da2008cc941c5cfdc1b9c/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f746f707068702f746f707068702d6d657465722d6170692f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/topphp/topphp-meter-api)[![Coverage Status](https://camo.githubusercontent.com/b8ec50bb61d5252486bca2070b4ab299c9014f7b8c4a6ef9d7fd35a29cc83cd7/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f746f707068702f746f707068702d6d657465722d6170692e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/topphp/topphp-meter-api/code-structure)[![Quality Score](https://camo.githubusercontent.com/269916cba57b55dc32c124fca21efb31dc66b9985b5787c418bb6d8a1e4ef4ce/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f746f707068702f746f707068702d6d657465722d6170692e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/topphp/topphp-meter-api)[![Total Downloads](https://camo.githubusercontent.com/3fa245c2ac6bb274cb4344e854d533a2ac6952873a800639ba907063cfdc871c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f746f707068702f746f707068702d6d657465722d6170692e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/topphp/topphp-meter-api)

本模块集成了水电表的api
-------------

[](#本模块集成了水电表的api)

目前对接了拓强水电表 接口地址:

Structure
---------

[](#structure)

> 组件结构

```
bin/
build/
docs/
config/
src/
tests/
vendor/

```

3个文件使用说明

```
TqMeter/AsyncApi/EleMeterClient.php 异步电表接口
TqMeter/AsyncApi/WaterMeterClient.php 异步水表接口
MeterClient.php 同步水电表操作接口

```

完成以下接口对接

```
---------------同步接口---------------
采集器添加
采集器删除
查询N个采集器
查询全部采集器
电能表添加
电能表删除
电能表档案查询
水表添加
水表删除
水表档案查询
操作状态查询
取消操作

---------------异步接口---------------
抄电表数据
设置电表参数
电表拉闸
电表合闸
电表清零_同步模式
电表清零_非同步模式
电表开户_同步模式
电表开户_非同步模式
电表充值_同步模式
电表充值_非同步模式

抄水表数据
水表关阀
水表开阀
水表清零
Mbus水表充值_同步模式
Mbus水表充值_非同步模式
Lora水表充值_同步模式
Lora水表充值_非同步模式

Lora普通预付费水表设置水价
Lora阶梯预付费水表设置水价

---------------第一套数据接口--------------
查询历史数据接口
查询设备列表和当前状态
查询采集器列表和当前状态
查询价格档案
查询用户档案
查询参数档案
查询电表当前状态数据
查询水表当前状态数据

```

Install
-------

[](#install)

Via Composer

```
$ composer require topphp/topphp-meter-api
```

Usage
-----

[](#usage)

```
//同步
$gateway = new MeterClient();
$res     = $gateway->setAuthCode('37577f8fb62a7b14ba55cc6faec5a142')
    ->setNonce('XOfX547SeCIlhufeeBBwgZIN')
    ->collectorQuery([]);
var_dump($res);

// 异步
$gateway = new EleMeterClient();
$res     = $gateway->setAuthCode('37577f8fb62a7b14ba55cc6faec5a142')
    ->setNonce('XOfX547SeCIlhufeeBBwgZIN')
    ->setNotifyUrl('')
    ->eleSecurityOpenAccount([
        [
            "opr_id"      => $gateway->generateOperateId(),
            "time_out"    => 0,
            "must_online" => true,
            "retry_times" => 1,
            "cid"         => "19020618114",
            "address"     => "000066660942",
            "params"      => [
                "money" => "100",
            ]
        ],
    ], '');
var_dump($res);
```

Change log
----------

[](#change-log)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Testing
-------

[](#testing)

```
$ composer test
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) and [CODE\_OF\_CONDUCT](CODE_OF_CONDUCT.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [topphp](https://github.com/topphp)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity53

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 ~4 days

Total

6

Last Release

2007d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3774ddafd6cc1dbff3db41386611fac2236c095e12c9e99f1717da35ad792087?d=identicon)[topphp](/maintainers/topphp)

---

Top Contributors

[![go-sleep](https://avatars.githubusercontent.com/u/100214298?v=4)](https://github.com/go-sleep "go-sleep (15 commits)")

###  Code Quality

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/topphp-topphp-meter-api/health.svg)

```
[![Health](https://phpackages.com/badges/topphp-topphp-meter-api/health.svg)](https://phpackages.com/packages/topphp-topphp-meter-api)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M475](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M270](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M186](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M33](/packages/facebook-php-business-sdk)[microsoft/microsoft-graph

The Microsoft Graph SDK for PHP

65723.5M95](/packages/microsoft-microsoft-graph)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)

PHPackages © 2026

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