adding the &c1=1 flag is not always correct

オープン
#11 コメント 4 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
48/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
静か
技術スタック
python
領域
api

調査の方向性

Start by locating the condition that appends &c1=1 when gen_state_class is total or total_increasing, then inspect how the entity id and state metadata are available. Done means daily-reset values such as sensor.growatt_inverter_growatt_2_today_s_solar_energy omit the flag while lifetime energy values retain it.

索引モデルが issue の本文から書いたものです。

説明

I have a growatt inverter with a ShineWiLan-X2 datalogger.
The inverter gets read with the SolaX Inverter Modbus integration in home assistant.
The values i use to upload to pvoutput are: Today's solar energy and output power.
The value Today's solar energy is a running total per day gets reset to 0 at 0:00 in the night.
Because the code only looks at if gen_state_class in ["total", "total_increasing"]: the flag payload += "&c1=1" gets appended.
But in this case because it resets at night this is not correct. In the api documentation is states that:
Cumulative Energy

The following values are valid for the c1 flag.

    1 - Both v1 and v3 values are **lifetime** energy values.

    2 - Only v1 generation is a **lifetime** energy value.

    3 - Only v3 consumption is a **lifetime** energy value.

In my case it is not a lifetime value and the flag should not be added.
I don't have a solutions on how to correct this. Maybe look for the value today in the entitiy id. The entity id is sensor.growatt_inverter_growatt_2_today_s_solar_energy

Image Image Image

I just commented out the addition of the flag. and that works for me.

主要言語
Python
スター
5
フォーク
0
PR マージ指標
30日以内にマージされた PR はありません

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

SourceLabOrg/HomeAssistant-PVOutputPublisher のほかの issue

SourceLabOrg/HomeAssistant-PVOutputPublisher の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。