ADR-0080: The month's balance of the cars, a « Voitures » button on the Balance page of the Energy popup¶
Page en anglais
Cette page n'existe qu'en anglais.
Status: Proposed (2026-11-10; draft pull request, judged on the off-device render only — not on the real screen, not with a real car). Date: 2026-11-10
Context¶
Lot 5 of the author's plan for the electric cars (sketch B4). The « Bilan » page of the Energy popup (ADR-0058, ADR-0062) shows, on the left, the « Batterie réseau » card of the month and, on the right, the net per hour, day or month as bars and its running total as a curve, with three buttons Heures / Jours / Mois. It says nothing about the cars. The analysis of ADR-0074 already returns, in its bilan string, what the month's charges add up to: per car the energy charged, the share that came from the sun, the kilometres (only when an odometer is chosen), the kWh per 100 km, the energy that came from the grid, and the share of the home's consumption that the cars make. The sketch asks to show it on this page, with a ring « the cars = x % of the home » and a card per car.
Decision¶
- One service, the string as it is.
tab5_maj_voiture_bilan(vue, debut, payload):vueismois_civil(the only one the screen reads: the analysis computes the calendar month, and any other value is refused with a warning),debutis the first of the month (YYYY-MM-DD, the analysis'bilan_debut) andpayloadis the analysis'bilanpushed as it is: eleven fields separated by|, five per car —kwh | part_soleil | km | kwh_100km | reseau— car 1 then car 2, then the home's share (part). Empty = unknown; the five fields of a car all empty = no such car; an empty payload = no balance (the button disappears). Appended at the end of the family of the other car services,continue_on_erroron the Home Assistant side (an older firmware lacks it).script.tab5_energiepushes it right after the charges and the day's consumption, from the same analysis answer, at the same moments (the popup opens, then at most every 5 minutes). - Placement chosen: a fourth button « Voitures » on the right card, which swaps the graph for the cars' balance. The hero card on the left (« Batterie réseau ») and the buttons Heures / Jours / Mois are what they were; the new button sits at the right end and stays hidden until a balance is received. When it is, the four buttons become 110 px wide, 10 px apart, still starting at the same left edge as the three of 150 px (so the month title keeps its 248 px and nothing on the page moves before the button is pressed). Pressing « Voitures » replaces the graph by one panel — on its left the cars together (the ring « x % de la maison » split between car 1 in
ACCENTand car 2 inACCENT_ALT, the total kWh, the share of the sun with its kWh, the energy bought from the grid), on its right one card per car (name and silhouette, the kWh of the month in large, a bar of the share of the sun over the share of the grid, the grid kWh, then km and kWh/100 km), and the note below. Pressing Heures / Jours / Mois goes back to the graph. The panel is not asked of Home Assistant (nothing to request: it was pushed). - Discarded: a strip under the graph. It keeps the graph visible but takes its height — the plot would drop from about 352 px to about 200 px, and every constant of the graph (
kBilZoneH, the scale, the bubble) would have to change, so the page without a car would no longer be identical; it cannot fit the 7B either. Discarded: a sixth tab of the popup: the tab bar's width does not hold another name in the longest languages, and the plan says « in the Bilan page ». The button keeps the existing page the way it was and adds a face to it. - Nothing that is not known is drawn. The ring and the card figures come from a pure reading in
Tab5/socle/tab5_parse.*(voiture_bilan_lire,voiture_bilan_total,voiture_bilan_parts; tolerant like the other readings, tested on a PC and fuzzed): a car exists when its kWh are readable (negative, absurd or unreadable = no car), a share outside 0–100, a kilometre count or a kWh/100 km out of bounds is « unknown », shown « -- ». The total share of the sun weights each car's share by its kWh and counts only the cars whose share is known (it needs at least 0.05 kWh). What each car weighs in the home's share is the home's share spread over the cars by their energy; with no home share, no ring. - No money. The sketch has a band « réseau payé / part du soleil » in euros; the analysis has no price (ADR-0074 gives kWh, the price lives in the Balance page's own payload and may be absent), so the panel shows the kWh bought from the grid, not an amount. Said here so that an amount can be added later where the price is known, not guessed now.
- Kilometres and kWh/100 km are approximations. They exist only when an odometer is chosen in the blueprint; otherwise « -- ». The second one is the energy charged divided by the kilometres driven — it includes the losses of the charger, the cold, the energy not spent on the road — and is written with a « ~ » and a note below the panel (« kWh/100 km estimés : énergie chargée / km parcourus »), never as a consumption that was measured.
- Not on the 7B (
kBilanVoitures = kCorpsH >= kCorpsHTab5): its body is 508 × 423, there is no room for a panel and a button; nothing is created for it, the service is accepted and changes nothing, the page is the one of before. - Contract 1.8.0, a pure addition (
tab5_maj_voiture_bilan); the firmware must be updated first (contrat_api.py --matrice).
Consequences¶
- No balance received: the page is the one of before, pixel for pixel (every existing screen of the off-device render is compared with
main). After the balance is emptied the button disappears and the three buttons get their 150 px back. - About fifty more LVGL objects (counted in
construire_voitures_bilan, not measured on the device) are created at the first build of the popup, hidden, and about as many colour writes (compared first) are replayed at each theme switch; the RAM, the time of the first build and the cost of a theme switch were not measured. - The balance is that of the calendar month, so it restarts from zero on the 1st; between midnight on the 1st and the next push the tablet still shows the previous month, named by its title.
- A car removed from the blueprint after a balance was received keeps its card on the tablet until the next push of a payload without it, which
script.tab5_energiemakes only while it runs: the same limit as the cars of ADR-0076. - Not judged on the real screen and not on a real car (the author owns none): the legibility of the two narrow cards in German or Turkish, the ring split with real shares, the figures themselves — the demo's numbers are invented, coherent with the six charges of the Charges page. The off-device render shows the layout; the author's eye decides.