Skip to content

Instant work mode notifications - #13

Open
jkpe wants to merge 2 commits into
mainfrom
feat/work-mode-push
Open

Instant work mode notifications#13
jkpe wants to merge 2 commits into
mainfrom
feat/work-mode-push

Conversation

@jkpe

@jkpe jkpe commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Adds real-time work mode change notifications from the Modbus bridge to the Check My Solar API. When the inverter's workMode changes and stays stable across consecutive polls, the bridge POSTs an event to /api/bridge/events/work-mode with the new mode, previous mode, timestamp, and SoC.

  • Introduces WorkModeNotifier to track work mode across poll cycles, debounce transient readings, and POST events to the CMS API
  • Adds CMS_API_URL (default https://checkmy.solar) and NOTIFY_DEBOUNCE_POLLS (default 2) config — wired through docker-compose.yml and documented in the README
  • Initializes notifier state from the latest stored telemetry on startup to avoid duplicate events after restarts
  • API failures are logged but do not interrupt the poll loop

work
mode. Adds `NOTIFY_DEBOUNCE_POLLS` and `CMS_API_URL` configuration
variables to control notification stability and the target API endpoint.
@jkpe jkpe changed the title Introduce WorkModeNotifier and configuration for notifications Instant work mode notifications Jul 23, 2026
Persist the last successfully notified work mode, post CMS events in the background with a timeout, and avoid blocking the Modbus poll loop.

Co-authored-by: Cursor <cursoragent@cursor.com>
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.

1 participant