Skip to content

Fix Grizzl-E Duo port 2 current/voltage/power reporting (#23) - #33

Open
stopsign002 wants to merge 2 commits into
mclare:mainfrom
stopsign002:main
Open

Fix Grizzl-E Duo port 2 current/voltage/power reporting (#23)#33
stopsign002 wants to merge 2 commits into
mclare:mainfrom
stopsign002:main

Conversation

@stopsign002

Copy link
Copy Markdown

Fixes #23.

Problem

On the Grizzl-E Duo, selecting 2 ports produced a second port with no current/voltage/power. The integration assumed cable 2 lived in curMeas2/voltMeas2, but on the Duo those are per-phase fields that stay 0 on a single-phase unit. From the real /main payloads in #23, cable 2 is actually reported through:

  • currentcurMeas1C2 (curMeas2 is always 0)
  • voltagevoltMeas1 (both cables share one circuit, so voltage is only reported once)
  • powerpowerMeas2
  • state/pilot/session → state2, pilot2, sessionTime2, sessionEnergy2, sessionMoney2, totalEnergy2, sessionStarted2

Separately, only Current/Voltage were ever created per-port; Power, Session/Total Energy, State, etc. were cable-1 only, so cable 2 had no power/energy tracking at all.

Fix

  • Add a port_key(field, port) helper in const.py that resolves each logical per-cable measurement to the correct JSON key for a given port (and generalizes the curMeas1C{n} pattern to a hypothetical 3rd cable).
  • Make all per-cable sensors port-aware — Power, Current, Voltage, Session Energy, Total Energy, Session Time, Session Money, State, Pilot State — plus the binary sensors (Session Started, Pilot Connected).
  • Port 1 keeps its original entity unique_ids, so existing single-port installs retain their history. Port 2+ get disambiguated ids (needed because both cables share voltMeas1).
  • Enum sensors (State, Pilot State) no longer carry an invalid measurement state class.

Tests

Added tests/test_ports.py with regression cases built from the exact Duo payloads posted in #23 (charging on cable 1 only, cable 2 only, and both at once).

Verified

Confirmed working on a real Grizzl-E Duo (GRD 40A 2025, FW GRD077L-01.09.5): port 2 now reports live current, voltage, and power.

🤖 Generated with Claude Code

claude added 2 commits July 6, 2026 13:51
The Duo does not report its second cable through curMeas2/voltMeas2
(those are per-phase fields that stay 0 on a single-phase unit). Cable 2
current comes from curMeas1C2, voltage from the shared voltMeas1, and
power from powerMeas2, with state2/pilot2/sessionTime2/... for the rest.

Add a port_key() mapping helper and make all per-cable sensors (power,
current, voltage, session energy/time/money, total energy, state, pilot)
and binary sensors (session started, pilot connected) port-aware. Port 1
keeps its original unique_ids so existing single-port history is retained;
port 2+ get disambiguated ids. Enum sensors no longer carry an invalid
measurement state class. Includes regression tests built from the real
Duo payloads in issue mclare#23.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KChaxBZUB3nMtU3LFERsrH
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.

Grizzl-e Duo Port 2 not reporting current/voltage

2 participants