Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(sma-sunny-island): Add nominal capacity #227

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions battery_inverters/sma_sunny_island/firmware.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ function send_properties()
if sma then
properties.serial_num = sma:read_u32_fix0(30057)
properties.model = parse_model(sma:read_u32_enum(30053))

local nominal_capacity_ah = sma:read_u32_fix0(40031)
local nominal_voltage = sma:read_u32_fix0(40037)
if nominal_capacity_ah and nominal_voltage then
properties.nominal_capacity = nominal_capacity_ah * nominal_voltage / 1000
end
end

local values, err = config.read_all()
Expand Down
3 changes: 3 additions & 0 deletions battery_inverters/sma_sunny_island/manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ properties:
unit_id:
display_name: Modbus Unit ID
type: integer
nominal_capacity:
display_name: Nominal Capacity, kWh
type: float

telemetry:
status:
Expand Down