adding the &c1=1 flag is not always correct

未关闭
#11 4 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
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. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

SourceLabOrg/HomeAssistant-PVOutputPublisher 的其他 Issue

查看 SourceLabOrg/HomeAssistant-PVOutputPublisher 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。