adding the &c1=1 flag is not always correct
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 48/100
Research direction
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.
Written by the indexing model from the issue text.
Description
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
I just commented out the addition of the flag. and that works for me.
- Dominant language
- Python
- Stars
- 5
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from SourceLabOrg/HomeAssistant-PVOutputPublisher
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 3/5 1-2 days Newbie friendliness 62/100
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
SourceLabOrg/HomeAssistant-PVOutputPublisher#9 · 2 comments ·
All issues in SourceLabOrg/HomeAssistant-PVOutputPublisher
Similar issues
-
documentation help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
simonw/sqlite-utils#872 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100