Skip to content

Show the house rate when Predbat splits the import cell for a car slot - #89

Open
tico24 wants to merge 1 commit into
pacemaker82:mainfrom
tico24:fix/split-house-car-import-cell
Open

tico24 wants to merge 1 commit into
pacemaker82:mainfrom
tico24:fix/split-house-car-import-cell

Conversation

@tico24

@tico24 tico24 commented Oct 14, 2026

Copy link
Copy Markdown

Predbat now prices car slots separately, and when the car rate in a slot differs from the house rate (an Octopus Intelligent Go dispatch, for example) the import cell holds two divs instead of a plain value:

<td id=import data-minute=780 data-rate=8.0 style="padding:0;"><div style="display:flex;"><div style="flex:1;padding:4px;background-color:#3AEE85;" title="House rate: 8.00p/kWh"><b>8.00</b></div><div style="flex:1;padding:4px;background-color:#74C1FF;" title="Car rate: 0.00p/kWh (differs from house rate)">0.00</div></div></td>

The card reads that td as a plain value, so those rows render as junk:

  • the brackets in the Car rate title make it look like a debug value, and the regex then pulls numbers out of the markup
  • the td has no bgcolor, so the cell loses its colour

This change takes the House rate div's content and background colour when it is there, so the cell goes through the existing import column handling like any other. Cells without the split are untouched.

I tested it with jsdom against a real Predbat plan that had Intelligent Go dispatch slots in it: the split cells became <b>8.00</b> with the house rate colour, and the 88 plain import cells were unchanged. It has also been running on my own dashboard.

Since Predbat started pricing car slots separately, the import cell for a slot where the car rate differs from the house rate holds two divs, one titled House rate and one titled Car rate. The card treated the whole thing as a plain value. The bracket in the car rate title tripped the debug parser, which then pulled numbers out of the markup, and the cell lost its colour because the td has no bgcolor. Now the card takes the house rate div and its background colour, so the cell parses like any other. Tested against a real Predbat plan with Octopus Intelligent Go dispatch slots: the split cells become 8.00 in the house rate colour and the plain cells are unchanged.
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