Conversation
Creating a " single_phase_16kw.py" definition.
Major changes from 5/8Kw to 16Kw
Sensor(172, "Grid_Ct_Power_10", WATT, -10),
Sensor(169, "Grid_power_10", WATT, -10),
SENSORS += NumberRWSensor(230, "Grid Charge Battery current", AMPS, min=0, max=140)
SENSORS += NumberRWSensor(210, "Battery Max Charge current", AMPS, min=0, max=290)
SENSORS += NumberRWSensor(211, "Battery Max Discharge current", AMPS, min=0, max=290)
Battery charge MAX is derived from the physical inverter LCD settings.
Grid and CT power is because it would only read eg. 500W instead of 5000W
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #405 +/- ##
==========================================
- Coverage 71.49% 71.16% -0.34%
==========================================
Files 27 28 +1
Lines 1912 1921 +9
==========================================
Hits 1367 1367
- Misses 545 554 +9 ☔ View full report in Codecov by Sentry. |
|
If you import from the single_phase you only need to define changes & not all sensors look at 3ph lv & hv to see how this is done |
Co-authored-by: Johann Kellerman <kellerza@gmail.com>
|
The selection mechanism is still pending. Or do you prefer me to work on that? |
config.yaml added sensor definition, documentation ammended |
|
Just commit changes to this branch, then it will update |
Please help , I think I'm stuck. |
|
The best would be to install pre-commit locally & use that to fix up your tests that are failing. pip install pre-commit
git add . && pre-commit run --allI implemented dynamic loading, so you should just add single-phase-16kw to config.yaml in the edge addon folder you can also rebase on the latest changes (after a commit!) using |
| SENSORS += NumberRWSensor(210, "Battery Max Charge current", AMPS, min=0, max=290) | ||
| SENSORS += NumberRWSensor(211, "Battery Max Discharge current", AMPS, min=0, max=290) | ||
|
|
||
| ) |
There was a problem hiding this comment.
You probably need to delete line 40 to make the test pass?
There was a problem hiding this comment.
Skip to content
Navigation Menu
kellerza
sunsynk
Code
Issues 23
Pull requests 4
Discussions
Actions
Projects
Security
Insights
Back to pull request #405
Create single_phase_16kw.py #286
Jobs
Run details
Annotations
1 error and 1 warning
Check pylint
failed Jan 27, 2025 in 28s
1s
0s
0s
18s
8s
Run pylint src
pylint src
shell: /usr/bin/bash -e {0}
env:
DEFAULT_PYTHON: 3.11
pythonLocation: /opt/hostedtoolcache/Python/3.11.11/x64
PKG_CONFIG_PATH: /opt/hostedtoolcache/Python/3.11.11/x64/lib/pkgconfig
Python_ROOT_DIR: /opt/hostedtoolcache/Python/3.11.11/x64
Python2_ROOT_DIR: /opt/hostedtoolcache/Python/3.11.11/x64
Python3_ROOT_DIR: /opt/hostedtoolcache/Python/3.11.11/x64
LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.11.11/x64/lib
************* Module sunsynk.definitions.single_phase_16Kw
src/sunsynk/definitions/single_phase_16Kw.py:32:0: C0303: Trailing whitespace (trailing-whitespace)
src/sunsynk/definitions/single_phase_16Kw.py:40:0: C0305: Trailing newlines (trailing-newlines)
src/sunsynk/definitions/single_phase_16Kw.py:1:0: C0103: Module name "single_phase_16Kw" doesn't conform to snake_case naming style (invalid-name)
src/sunsynk/definitions/single_phase_16Kw.py:3:0: W0611: Unused CELSIUS imported from sunsynk (unused-import)
src/sunsynk/definitions/single_phase_16Kw.py:3:0: W0611: Unused KWH imported from sunsynk (unused-import)
src/sunsynk/definitions/single_phase_16Kw.py:3:0: W0611: Unused VOLT imported from sunsynk (unused-import)
src/sunsynk/definitions/single_phase_16Kw.py:5:0: W0611: Unused SelectRWSensor imported from sunsynk.rwsensors (unused-import)
src/sunsynk/definitions/single_phase_16Kw.py:5:0: W0611: Unused SwitchRWSensor imported from sunsynk.rwsensors (unused-import)
src/sunsynk/definitions/single_phase_16Kw.py:5:0: W0611: Unused SystemTimeRWSensor imported from sunsynk.rwsensors (unused-import)
src/sunsynk/definitions/single_phase_16Kw.py:5:0: W0611: Unused TimeRWSensor imported from sunsynk.rwsensors (unused-import)
src/sunsynk/definitions/single_phase_16Kw.py:12:0: W0611: Unused BinarySensor imported from sunsynk.sensors (unused-import)
src/sunsynk/definitions/single_phase_16Kw.py:12:0: W0611: Unused FaultSensor imported from sunsynk.sensors (unused-import)
src/sunsynk/definitions/single_phase_16Kw.py:12:0: W0611: Unused InverterStateSensor imported from sunsynk.sensors (unused-import)
src/sunsynk/definitions/single_phase_16Kw.py:12:0: W0611: Unused MathSensor imported from sunsynk.sensors (unused-import)
src/sunsynk/definitions/single_phase_16Kw.py:12:0: W0611: Unused SDStatusSensor imported from sunsynk.sensors (unused-import)
src/sunsynk/definitions/single_phase_16Kw.py:12:0: W0611: Unused TempSensor imported from sunsynk.sensors (unused-import)
Your code has been rated at 9.91/10
Error: Process completed with exit code 20.
0s
0s
0s
Create single_phase_16kw.py · 7bd9b81
|
Hi @kellerza Am I on the right track? Could you please help with these last 2 errors? I have no idea what it means... In codecov |
| DONGLE_SERIAL_NUMBER: str? | ||
| PORT: str | ||
| SENSOR_DEFINITIONS: list(single-phase|three-phase|three-phase-hv) | ||
| SENSOR_DEFINITIONS: list(single-phase|single-phase-16Kw|three-phase|three-phase-hv) |
There was a problem hiding this comment.
Either all names needs to be lowercase, or we need a .lower() in the load function in definitions/init.py
Kw will not match the filename kw today
There was a problem hiding this comment.
I'm only stuck with codecov now, it helps to read, think and solve but codecov is another story...
There was a problem hiding this comment.
Codecov should be taken care of by a previous commit. It imports and tests all the existing definition files.
|
Thanks @deondti ! you should be able to test this once the edge version is built |
|
sorry for the lengthy mess and THANK YOU for your patience |
|
Tested and seems to be fine, thank you again for this great project |
|
I haven't fully tested it yet, but it seems that this mode also works on deye single_phase_18kw |
Creating a " single_phase_16kw.py" definition.
Major changes from 5/8Kw to 16Kw
Sensor(172, "Grid_Ct_Power_10", WATT, -10),
Sensor(169, "Grid_power_10", WATT, -10),
SENSORS += NumberRWSensor(230, "Grid Charge Battery current", AMPS, min=0, max=140) SENSORS += NumberRWSensor(210, "Battery Max Charge current", AMPS, min=0, max=290) SENSORS += NumberRWSensor(211, "Battery Max Discharge current", AMPS, min=0, max=290)
Battery charge MAX is derived from the physical inverter LCD settings.
Grid and CT power is because it would only read eg. 500W instead of 5000W