Skip to content

feat(deye): DEYE Cloud inverter integration#3917

Open
mgazza wants to merge 4 commits into
mainfrom
feat/component-value-injection
Open

feat(deye): DEYE Cloud inverter integration#3917
mgazza wants to merge 4 commits into
mainfrom
feat/component-value-injection

Conversation

@mgazza
Copy link
Copy Markdown
Collaborator

@mgazza mgazza commented May 12, 2026

Summary

Adds DEYE Cloud inverter support to PredBat via the DEYE OpenAPI (EMEA: eu1-developer.deyecloud.com).

  • DeyeAPI(ComponentBase, OAuthMixin) in deye.py — fetches real-time device data (SoC, battery/grid/PV power) and applies Time-of-Use charge/discharge schedules
  • components.py — registers DeyeAPI in COMPONENT_LIST with key, device_sn, automatic, token_expires_at, token_hash args
  • config.py — adds deye_key, deye_device_sn, deye_automatic, deye_token_expires_at, deye_token_hash to CONFIG_ITEMS
  • components.py value-injection support (feat(components): support provider injection via value key in args) allows the SaaS platform to inject OAuth access tokens directly without a separate config key

Key design notes

  • Bearer token injected by the PredBat SaaS platform; this module never calls the token endpoint itself
  • 3-retry exponential backoff on transient errors; 401/403 triggers handle_oauth_401() for token refresh
  • TOU schedule sent via POST /v1.0/order/sys/tou/update; real-time data via POST /v1.0/device/latest

Test plan

  • Unit tests: cd coverage && ./run_all -k deye (add test if needed)
  • Manual: configure DEYE inverter in PredBat SaaS, verify component starts, logs SoC/power readings, and applies charge schedule

🤖 Generated with Claude Code

mgazza and others added 4 commits May 11, 2026 15:22
Adds a "value" key to the component arg spec so callers can inject a
pre-built object directly, bypassing config lookup. Used by SaaS to swap
the StorageComponent backend for KeyDB without subclassing or monkey-patching.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@springfall2008
Copy link
Copy Markdown
Owner

I'll take a look once I manage to get a test key, but obviously this is incomplete as it has no controls linked to Predbat or sensors

@mgazza
Copy link
Copy Markdown
Collaborator Author

mgazza commented May 14, 2026 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants