nystronsolar/growattspreadsheet

读取、编写和管理 Growatt 设备数据电子表格

1.0.5 2023-07-09 03:56 UTC

This package is auto-updated.

Last update: 2024-09-09 06:31:39 UTC


README

NystronSolarBadge semantic-release: angular

读取编写管理 Growatt 设备数据电子表格

包 🚀

该包提供几个类来提取电费单据。项目分为几个类。每个类提取特定类型的单据。

使用包 🎮

每个提取器类有两个主要方法:fromFilefromContent,它们都返回一个包含所有单据数据的关联数组。

示例 🔧

这里,我们将使用Extractor RGE,但它适用于任何其他提取器

<?php

use NystronSolar\ElectricBillExtractor\BR\RS\ExtractorRGE;

$extractor = new ExtractorRGE(/* You can put an custom PDF Parser (from smalot/pdfparser Package) */);
$output = $extractor->fromFile('my_bill.pdf'); // You can also use the fromContent() method, that does the same, but accepting an PDF Content String.

echo json_encode($output);

这应该返回类似以下内容

{
    "Client": {
        "Name": "Client Name",
        "Address": "Client Address",
        "District": "Client District",
        "City": "Client City",
        "Building": {
            "Classification": "Classification",
            "SupplyType": "Supply Type",
            "Voltage": {
                "Available": 220,
                "MinimumLimit": 202,
                "MaximumLimit": 231
            }
        }
    },
    "Batch": 1,
    "ReadingGuide": "Reading Guide",
    "PowerMeterId": 10000000,
    "Pages": {
        "Actual": 1,
        "Total": 1
    },
    "DeliveryDate": { /* PHP \DateTime Object */ },
    "NextReadingDate": { /* PHP \DateTime Object */ },
    "DueDate": { /* PHP \DateTime Object */ },
    "ActualReadingDate": { /* PHP \DateTime Object */ },
    "PreviousReadingDate": { /* PHP \DateTime Object */ },
    "TotalDays": 31,
    "InstallationCode": "Installation Code",
    "Date": { /* PHP \DateTime Object */ },
    "Cost": { /* Money from moneyphp/money Package */ },
    "Notices": {
        "Text": "Notices Text"
    },
    "SolarGeneration": {
        "ParticipationGeneration": 100,
        "Balance": 0,
        "NextMonthExpiringBalance": 0
    },
    "EnergyData": {
        "EnergyConsumed": {
            "Timetables": "Timetables",
            "PreviousReading": 1000,
            "ActualReading": 2000,
            "MeterConstant": 1,
            "Consumed": 250
        },
        "EnergyExcess": {
            "Timetables": "Timetables",
            "PreviousReading": 1000,
            "ActualReading": 2000,
            "MeterConstant": 1,
            "Consumed": 250
        }
    }
}

提取器列表 📌

RGE

此提取器使用 RGE 的新电费单据。请注意,仅新电费单据(RGE大约从 2022 年 5 月开始发送新电费单据)已实现提取。旧版本电费单据的提取器仍在开发中。image

图片来自 RGE 网站 - Nova Conta | RGE - 访问时间 2023 年 3 月 24 日(2023 年 5 月 24 日)