Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
141 commits
Select commit Hold shift + click to select a range
6ac73ad
Initial changes
GraemeDBlue Sep 25, 2025
ab33b5f
Testing init
GraemeDBlue Sep 25, 2025
50c54ea
Test
GraemeDBlue Sep 25, 2025
850486a
clearer
GraemeDBlue Sep 25, 2025
2c1fe2d
formatting
GraemeDBlue Sep 25, 2025
6cb1177
trying path
GraemeDBlue Sep 26, 2025
94ad1f9
fix domain
GraemeDBlue Sep 26, 2025
9eaea9d
trying path
GraemeDBlue Sep 26, 2025
7a99f4b
change path back
GraemeDBlue Sep 26, 2025
b7bdb35
remove requirements
GraemeDBlue Sep 26, 2025
bc8f643
added into same project
GraemeDBlue Sep 26, 2025
8446eb4
fix types lookup
GraemeDBlue Sep 26, 2025
d263616
trying to add directly in
GraemeDBlue Sep 26, 2025
de67821
set to instantiate
GraemeDBlue Sep 26, 2025
64e51b6
devieType
GraemeDBlue Sep 26, 2025
4fe51de
fix typo
GraemeDBlue Sep 26, 2025
b721adb
impport devicetype
GraemeDBlue Sep 26, 2025
e5eb299
find plants
GraemeDBlue Sep 26, 2025
eeba8da
debug
GraemeDBlue Sep 26, 2025
00d64f7
fix typo
GraemeDBlue Sep 26, 2025
3fdaa7f
remove duplicate api call
GraemeDBlue Sep 26, 2025
71dea98
working, needs additional param mapping
GraemeDBlue Sep 26, 2025
e183ac5
fix plant_id
GraemeDBlue Sep 26, 2025
df0aaeb
fix mappings for V1
GraemeDBlue Sep 26, 2025
aca07f7
Fix last update time
GraemeDBlue Sep 26, 2025
292f20c
Fix some mappings
GraemeDBlue Sep 26, 2025
70d52f4
last update time
GraemeDBlue Sep 29, 2025
29765b0
fix lastupdatetime with offse
GraemeDBlue Sep 29, 2025
1afb966
Rollback last update as broken
GraemeDBlue Sep 29, 2025
01e08e4
enable backwards compatibility for api_key, and latestupdate
GraemeDBlue Sep 30, 2025
f6fb20f
revery some watts to kilowatts
GraemeDBlue Sep 30, 2025
18bb3de
fix formatting
GraemeDBlue Sep 30, 2025
aaa7b8d
debug for time
GraemeDBlue Sep 30, 2025
40a8b84
add more logging for time
GraemeDBlue Sep 30, 2025
e509c64
force time
GraemeDBlue Sep 30, 2025
1380a6f
fit typo
GraemeDBlue Sep 30, 2025
d8d8255
test key finder
GraemeDBlue Sep 30, 2025
0ac5f22
typo
GraemeDBlue Sep 30, 2025
cb7ce48
revert some var names
GraemeDBlue Sep 30, 2025
705e959
trest parse datetime
GraemeDBlue Sep 30, 2025
71dda21
trying to fix timestamp
GraemeDBlue Sep 30, 2025
91338f4
fix namespacing
GraemeDBlue Sep 30, 2025
c32d9af
test
GraemeDBlue Sep 30, 2025
b9f7b5e
rewrite tz timezone
GraemeDBlue Sep 30, 2025
09f14a4
test
GraemeDBlue Sep 30, 2025
7ef729b
fix typo again
GraemeDBlue Sep 30, 2025
607a8ea
rework tz logic
GraemeDBlue Sep 30, 2025
2e6d4f2
change missing var
GraemeDBlue Sep 30, 2025
9f4126d
remove debug and update key
GraemeDBlue Sep 30, 2025
90c07a6
trting new key
GraemeDBlue Sep 30, 2025
a50263a
Add vscode task
GraemeDBlue Oct 1, 2025
859da29
fix devcontainer
GraemeDBlue Oct 2, 2025
f88f5d1
remove hard code depenedency
GraemeDBlue Oct 2, 2025
2f51c02
code quality updates
GraemeDBlue Oct 2, 2025
e258273
Add divisor for some fields to map the same as legacy
GraemeDBlue Oct 3, 2025
aceea97
changing constants over
GraemeDBlue Oct 14, 2025
e04c0bb
Initial changes
GraemeDBlue Sep 25, 2025
abff527
Testing init
GraemeDBlue Sep 25, 2025
aa04412
Test
GraemeDBlue Sep 25, 2025
5fa1286
clearer
GraemeDBlue Sep 25, 2025
bce9944
formatting
GraemeDBlue Sep 25, 2025
f5b9fab
trying path
GraemeDBlue Sep 26, 2025
0a915c5
fix domain
GraemeDBlue Sep 26, 2025
60b699b
trying path
GraemeDBlue Sep 26, 2025
8b79ffa
change path back
GraemeDBlue Sep 26, 2025
81065d4
remove requirements
GraemeDBlue Sep 26, 2025
787f204
added into same project
GraemeDBlue Sep 26, 2025
de89bbc
fix types lookup
GraemeDBlue Sep 26, 2025
780a310
trying to add directly in
GraemeDBlue Sep 26, 2025
bf78fe3
set to instantiate
GraemeDBlue Sep 26, 2025
9914177
devieType
GraemeDBlue Sep 26, 2025
401103b
fix typo
GraemeDBlue Sep 26, 2025
b80cc63
impport devicetype
GraemeDBlue Sep 26, 2025
48854dc
find plants
GraemeDBlue Sep 26, 2025
1be109e
debug
GraemeDBlue Sep 26, 2025
9891d0e
fix typo
GraemeDBlue Sep 26, 2025
cbc150a
remove duplicate api call
GraemeDBlue Sep 26, 2025
d172d9c
working, needs additional param mapping
GraemeDBlue Sep 26, 2025
b84036e
fix plant_id
GraemeDBlue Sep 26, 2025
1551202
fix mappings for V1
GraemeDBlue Sep 26, 2025
d576043
Fix last update time
GraemeDBlue Sep 26, 2025
fbb6b5b
Fix some mappings
GraemeDBlue Sep 26, 2025
e634280
last update time
GraemeDBlue Sep 29, 2025
e6d59c0
fix lastupdatetime with offse
GraemeDBlue Sep 29, 2025
3f7f275
Rollback last update as broken
GraemeDBlue Sep 29, 2025
2619b24
enable backwards compatibility for api_key, and latestupdate
GraemeDBlue Sep 30, 2025
a05b1e5
revery some watts to kilowatts
GraemeDBlue Sep 30, 2025
f6fd039
fix formatting
GraemeDBlue Sep 30, 2025
056dfbc
test
GraemeDBlue Sep 30, 2025
fd9b30e
debug for time
GraemeDBlue Sep 30, 2025
74d044e
fix typo again
GraemeDBlue Sep 30, 2025
9a80ba9
add more logging for time
GraemeDBlue Sep 30, 2025
ff11ee2
rework tz logic
GraemeDBlue Sep 30, 2025
b54d5e3
force time
GraemeDBlue Sep 30, 2025
fcf3bab
change missing var
GraemeDBlue Sep 30, 2025
ac346bf
fit typo
GraemeDBlue Sep 30, 2025
176b4a5
remove debug and update key
GraemeDBlue Sep 30, 2025
1f575b4
test key finder
GraemeDBlue Sep 30, 2025
db9a534
trting new key
GraemeDBlue Sep 30, 2025
05bebe3
typo
GraemeDBlue Sep 30, 2025
effc9ba
Add vscode task
GraemeDBlue Oct 1, 2025
043c2e0
revert some var names
GraemeDBlue Sep 30, 2025
dc02f5d
fix devcontainer
GraemeDBlue Oct 2, 2025
7b70217
trest parse datetime
GraemeDBlue Sep 30, 2025
8751aad
remove hard code depenedency
GraemeDBlue Oct 2, 2025
f5e605a
trying to fix timestamp
GraemeDBlue Sep 30, 2025
2fa9455
code quality updates
GraemeDBlue Oct 2, 2025
cc85860
fix namespacing
GraemeDBlue Sep 30, 2025
5de011d
Add divisor for some fields to map the same as legacy
GraemeDBlue Oct 3, 2025
45a83cd
test
GraemeDBlue Sep 30, 2025
87723d2
changing constants over
GraemeDBlue Oct 14, 2025
79925bd
rewrite tz timezone
GraemeDBlue Sep 30, 2025
4f4b641
Merge branch 'johanzander-master' into sync-upstream
GraemeDBlue Oct 30, 2025
d437ccb
fix manifest
GraemeDBlue Oct 30, 2025
7e5d564
updating my changes to integrate johans
GraemeDBlue Nov 3, 2025
6b01a20
Got the modes to work successfuly, can set charge or discharge windows
GraemeDBlue Nov 5, 2025
27b246e
Full write for SPH grid first, battery first load first
GraemeDBlue Nov 6, 2025
29bbc96
Speciifc TLX and SPH time segements read
GraemeDBlue Nov 6, 2025
0adf805
Add the options to appear in Automations
GraemeDBlue Nov 7, 2025
6c10911
Moved Time setting bits to Controls
GraemeDBlue Nov 7, 2025
0706d03
Fix the setting for commands to charge and discharge
GraemeDBlue Nov 7, 2025
6a8d367
Working Mix read and write for selected params
GraemeDBlue Nov 7, 2025
4fa05d8
fix manifest
GraemeDBlue Nov 7, 2025
2cc54fa
Merge pull request #3 from GraemeDBlue/integrate_sph_write
GraemeDBlue Nov 10, 2025
56d1bce
try different branch
GraemeDBlue Nov 10, 2025
d1d6c84
Merge pull request #4 from GraemeDBlue/integrate_sph_write
GraemeDBlue Nov 10, 2025
02f0410
trying to force correct version
GraemeDBlue Nov 10, 2025
9f1b7b5
Merge pull request #5 from GraemeDBlue/integrate_sph_write
GraemeDBlue Nov 10, 2025
6d443ca
rework imports
GraemeDBlue Nov 10, 2025
3f84579
Merge pull request #6 from GraemeDBlue/integrate_sph_write
GraemeDBlue Nov 10, 2025
6c95409
fix import
GraemeDBlue Nov 10, 2025
1adf9fc
Merge pull request #7 from GraemeDBlue/integrate_sph_write
GraemeDBlue Nov 10, 2025
07ea110
test sys import
GraemeDBlue Nov 10, 2025
8bc313f
Merge pull request #8 from GraemeDBlue/integrate_sph_write
GraemeDBlue Nov 10, 2025
ea75fc3
force dependency
GraemeDBlue Nov 10, 2025
36a21ac
trying a different approach
GraemeDBlue Nov 10, 2025
2d7e9e8
Merge pull request #9 from GraemeDBlue/integrate_sph_write
GraemeDBlue Nov 10, 2025
9091a8a
trying someing else
GraemeDBlue Nov 10, 2025
bd4f6f0
Merge pull request #10 from GraemeDBlue/integrate_sph_write
GraemeDBlue Nov 10, 2025
063e986
fix isotime import again
GraemeDBlue Nov 10, 2025
8bd31fe
Merge pull request #11 from GraemeDBlue/integrate_sph_write
GraemeDBlue Nov 10, 2025
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
50 changes: 50 additions & 0 deletions .devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"name": "johanzander/growatt_server_upstream",
"image": "mcr.microsoft.com/devcontainers/python:3.13",
"postCreateCommand": "scripts/setup",
"forwardPorts": [
8123
],
"portsAttributes": {
"8123": {
"label": "Home Assistant",
"onAutoForward": "notify"
}
},
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",
"mounts": [
"source=/home/graeme/web/PyPi_GrowattServer/growattServer,target=/custom_components/growatt_server/growattServer,type=bind",
"source=/home/graeme/web/PyPi_GrowattServer/growattServer,target=/workspaces/${localWorkspaceFolderBasename}/custom_components/growatt_server/growattServer,type=bind"
],
"customizations": {
"vscode": {
"extensions": [
"charliermarsh.ruff",
"github.vscode-pull-request-github",
"ms-python.python",
"ms-python.vscode-pylance",
"ryanluker.vscode-coverage-gutters"
],
"settings": {
"files.eol": "\n",
"editor.tabSize": 4,
"editor.formatOnPaste": true,
"editor.formatOnSave": true,
"editor.formatOnType": false,
"files.trimTrailingWhitespace": true,
"python.analysis.typeCheckingMode": "basic",
"python.analysis.autoImportCompletions": true,
"python.defaultInterpreterPath": "/usr/local/bin/python",
"[python]": {
"editor.defaultFormatter": "charliermarsh.ruff"
}
}
}
},
"remoteUser": "vscode",
"features": {
"ghcr.io/devcontainers-extra/features/apt-packages:1": {
"packages": "ffmpeg,libturbojpeg0,libpcap-dev"
}
}
}
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,8 @@ env/
.vscode/
.idea/
*.swp
*.swo
*.swo

# Home Assistant configuration
config/*
!config/configuration.yaml
25 changes: 25 additions & 0 deletions .ruff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# The contents of this file is based on https://github.com/home-assistant/core/blob/dev/pyproject.toml

target-version = "py313"

[lint]
select = [
"ALL",
]

ignore = [
"ANN401", # Dynamically typed expressions (typing.Any) are disallowed
"D203", # no-blank-line-before-class (incompatible with formatter)
"D212", # multi-line-summary-first-line (incompatible with formatter)
"COM812", # incompatible with formatter
"ISC001", # incompatible with formatter
]

[lint.flake8-pytest-style]
fixture-parentheses = false

[lint.pyupgrade]
keep-runtime-typing = true

[lint.mccabe]
max-complexity = 25
35 changes: 35 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "Start Home Assistant",
"type": "shell",
"command": "scripts/develop",
"group": {
"kind": "test",
"isDefault": true
},
"presentation": {
"reveal": "always",
"panel": "new"
},
"problemMatcher": []
},
{
"label": "Start Home Assistant (Debug)",
"type": "shell",
"command": "PYTHONBREAKPOINT=pdb.set_trace scripts/develop",
"group": {
"kind": "test",
"isDefault": false
},
"presentation": {
"echo": true,
"reveal": "always",
"focus": false,
"panel": "shared"
},
"problemMatcher": []
}
]
}
42 changes: 26 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,40 +9,50 @@ Upstream development version of the Growatt Server integration for Home Assistan

This repository serves as an **upstream testing ground** for improvements to the Growatt Server integration before they are submitted to Home Assistant Core. From version 1.5.0 it should be compatible with the [Growatt BESS (Battery Energy Storage System) Manager][bess]

## Features (v1.5.0)
## Features (v2.2.0)

**Base Version**: Home Assistant Core 2025.9.0 Growatt Server integration

**Changes from Base Version**:

1. `manifest.json` updated for custom component distribution
2. [API Token authentication support][pr-149783] - Official V1 API for MIN/TLX devices
3. [MIN inverter control][pr-153468] - Number and switch entities for controlling inverter settings
4. Adds 5 min rate limit to login to prevent account locking - aims to fix [account locking issue][issue-150732]
5. **Fixed sensor naming issue** - Sensors now display proper translated names instead of generic device class names
6. **Fixed timezone handling in API throttling** - Fixed bug that could cause very long throttling times (500 minutes)
7. **Enhanced TLX sensor coverage** - Added 14 new sensors for power and energy
2. [API Token authentication support][pr-149783] - Official V1 API for MIN/TLX/MIX devices
3. [MIN inverter control][pr-153468] - Number, switch, and time entities for controlling inverter settings
4. **MIX/SPH inverter control** - Full support for charge/discharge power, SOC limits, and time-of-use scheduling
5. Adds 5 min rate limit to login to prevent account locking - aims to fix [account locking issue][issue-150732]
6. **Fixed sensor naming issue** - Sensors now display proper translated names instead of generic device class names
7. **Fixed timezone handling in API throttling** - Fixed bug that could cause very long throttling times (500 minutes)
8. **Enhanced TLX sensor coverage** - Added 14 new sensors for power and energy
monitoring
8. Proper implementation of read / write Time Of Use (TOU) settings using service calls:
9. Proper implementation of read / write Time Of Use (TOU) settings using service calls:
`growattserver.read_time_segments,
growattserver.update_time_segment`

### MIN/TLX Inverter Control Features (V1 API)
### MIN/TLX/MIX Inverter Control Features (V1 API)

When using token authentication with MIN/TLX inverters, you get:
When using token authentication with MIN/TLX or MIX/SPH inverters, you get:

**Number Entities** (0-100%):
**Number Entities**:

- Charge power
- Charge stop SOC
- Discharge power
- Discharge stop SOC
- Charge power (W)
- Charge stop SOC (%)
- Discharge power (W)
- Discharge stop SOC (%)

**Switch Entities**:

- AC charge enable/disable
- Charge period 1 enabled
- Discharge period 1 enabled

All control entities provide real-time feedback and proper error handling.
**Time Entities**:

- 1. Charge start time
- 2. Charge end time
- 3. Discharge start time
- 4. Discharge end time

All control entities provide real-time feedback and proper error handling. MIX/SPH devices support full time-of-use (TOU) scheduling with separate charge and discharge periods.

### Enhanced TLX Sensor Coverage (v1.4.6)

Expand Down
12 changes: 12 additions & 0 deletions config/configuration.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# https://www.home-assistant.io/integrations/default_config/
default_config:

# https://www.home-assistant.io/integrations/homeassistant/
homeassistant:
debug: true

# https://www.home-assistant.io/integrations/logger/
logger:
default: info
logs:
custom_components.growatt_server: debug
Loading