Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
275abb9
feat(gateway): add Python protobuf bindings for gateway telemetry and…
mgazza Mar 13, 2026
9805dbc
feat(gateway): add GatewayMQTT static methods with tests for protobuf…
mgazza Mar 13, 2026
c626665
feat(gateway): add ComponentBase lifecycle, MQTT connection and run loop
mgazza Mar 13, 2026
52cc28a
feat(gateway): register GatewayMQTT in COMPONENT_LIST
mgazza Mar 13, 2026
6268ee1
feat(gateway): implement JWT token refresh with 1-hour pre-expiry ren…
mgazza Mar 13, 2026
434f5a6
feat(gateway): add EMS multi-inverter entity mapping with per-sub-inv…
mgazza Mar 13, 2026
de9847b
test(gateway): add MQTT integration test for plan publish format
mgazza Mar 13, 2026
1d5debe
fix(gateway): address spec compliance review findings
mgazza Mar 13, 2026
88e18e5
fix(gateway): use oauth-refresh endpoint with provider predbat_gateway
mgazza Mar 13, 2026
6690b66
refactor(gateway): remove mqtt_refresh_token — server handles refresh
mgazza Mar 13, 2026
b8dba8c
fix(gateway): guard protobuf/aiomqtt imports for safe degradation
mgazza Mar 14, 2026
c487205
feat(predbat): add GWMQTT inverter type for ESP32 gateway MQTT
mgazza Mar 15, 2026
4a2873f
feat(gateway): add per-inverter entity injection, auto-config, and pl…
mgazza Mar 15, 2026
246e595
fix(gateway): use HasField() for proto3 sub-message presence checks
mgazza Mar 15, 2026
1b99066
fix(gateway): address review findings — import guards, entity consist…
mgazza Mar 15, 2026
89fa8f3
fix(gateway): revert instance_id param, read user_id from config args
mgazza Mar 15, 2026
2052d61
fix(gateway): rename EnergyCounters proto fields from _total_wh to _t…
mgazza Mar 16, 2026
4cecb2e
feat: add rate_max_w field to BatteryStatus proto
mgazza Mar 16, 2026
7a4f015
fix(gateway): address code review issues
mgazza Mar 16, 2026
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
2 changes: 2 additions & 0 deletions .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
"ignorePaths": [
"**/*.json",
"**/*.yaml",
"**/*_pb2.py",
"**/*.proto",
".gitignore",
],
"import": [
Expand Down
4 changes: 4 additions & 0 deletions .cspell/custom-dictionary-workspace.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ afci
AIO
AIO's
aiohttp
aiomqtt
Alertfeed
allclose
Anson
Expand Down Expand Up @@ -134,6 +135,7 @@ givtcp
gridconsumption
gridconsumptionpower
growatt
GWMQTT
HACS
hadashboard
hahistory
Expand Down Expand Up @@ -169,6 +171,7 @@ ivtime
jedlix
jsyaml
kaiming
keepalive
killall
kopt
Kostal
Expand Down Expand Up @@ -249,6 +252,7 @@ onmouseover
openweathermap
overfitting
ownerapi
pbgw
pdata
pdetails
perc
Expand Down
23 changes: 23 additions & 0 deletions apps/predbat/components.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,14 @@
from db_manager import DatabaseManager
from fox import FoxAPI
from web_mcp import PredbatMCPServer

try:
from gateway import GatewayMQTT

HAS_GATEWAY = True
except (ImportError, Exception):
HAS_GATEWAY = False
GatewayMQTT = None
from load_ml_component import LoadMLComponent
from datetime import datetime, timezone, timedelta
import asyncio
Expand Down Expand Up @@ -309,6 +317,21 @@
},
}

if HAS_GATEWAY:
COMPONENT_LIST["gateway"] = {
"class": GatewayMQTT,
"name": "PredBat Gateway",
"event_filter": "predbat_gateway_",
"args": {
"gateway_device_id": {"required": True, "config": "gateway_device_id"},
"mqtt_host": {"required": True, "config": "gateway_mqtt_host"},
"mqtt_port": {"required": False, "config": "gateway_mqtt_port", "default": 8883},
"mqtt_token": {"required": True, "config": "gateway_mqtt_token"},
},
"phase": 1,
"can_restart": True,
}


class Components:
"""Central component registry and lifecycle manager.
Expand Down
27 changes: 27 additions & 0 deletions apps/predbat/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -1933,6 +1933,33 @@
"charge_discharge_with_rate": False,
"target_soc_used_for_discharge": True,
},
"GWMQTT": {
"name": "ESP32 Gateway MQTT",
"has_rest_api": False,
"has_mqtt_api": False,
"output_charge_control": "power",
"charge_control_immediate": True,
"has_charge_enable_time": True,
"has_discharge_enable_time": True,
"has_target_soc": True,
"has_reserve_soc": True,
"has_timed_pause": False,
"charge_time_format": "HH:MM:SS",
"charge_time_entity_is_option": True,
"soc_units": "%",
"num_load_entities": 1,
"has_ge_inverter_mode": False,
"time_button_press": False,
"clock_time_format": "%H:%M:%S",
"write_and_poll_sleep": 2,
"has_time_window": True,
"support_charge_freeze": False,
"support_discharge_freeze": False,
"has_idle_time": False,
"can_span_midnight": True,
"charge_discharge_with_rate": False,
"target_soc_used_for_discharge": False,
},
}

# Control modes for Solax inverters
Expand Down
Loading
Loading