Skip to content

Add optional redesigned React based web interface - #5393

Open
calvind80 wants to merge 130 commits into
springfall2008:mainfrom
calvind80:feature/modern-web-ui
Open

calvind80 wants to merge 130 commits into
springfall2008:mainfrom
calvind80:feature/modern-web-ui

Conversation

@calvind80

@calvind80 calvind80 commented Oct 4, 2026 •

Copy link
Copy Markdown

Summary

Adds an optional modern web interface for Predbat, with responsive layouts, light and dark themes, and navigation between Overview, Dashboard, Plan, Charts, Compare, configuration and system pages.

Setting web_ui: modern in apps.yaml serves the bundled modern interface. If the option is omitted or set to legacy, Predbat continues to use the existing interface.

Plan-1

The new interface includes:

  • Responsive dashboard and energy overview
  • Plan timeline, table, history and debug views
  • Battery, power, cost, rates, solar, savings, degradation, marginal-cost and CO₂ charts
  • Apps configuration editor with schema help and Home Assistant entity autocomplete
  • Tariff helper with reviewable configuration suggestions
  • Entities, logs, compare, annual, discovery, cards, internals and documentation pages
  • Home Assistant ingress navigation and mobile layouts
  • Optional weather effects and configurable Overview integrations
  • PredHeat configuration reuse for weather and heat-pump data

Compatibility

  • The legacy interface remains the default.
  • Users do not need Node.js or Vite. The compiled interface is included in apps/predbat/frontend.zip.
  • Existing apps.yaml configurations remain supported.
  • Modern-only entities and settings are optional.
  • Frontend source remains available under frontend/.

Configuration

Add the relevant settings to your existing pred_bat: section in apps.yaml. Replace the example entity IDs with your own.
Only web_ui: modern is needed to select the modern interface. All additional Overview settings below are optional. Existing grid, solar, battery and household entities are reused automatically.

pred_bat:
  # Select the modern interface.
  # Optional overall: omit this or use "legacy" to retain the original UI.
  web_ui: modern

  # OPTIONAL: weather conditions and outdoor temperature on Overview.
  # Also supplies the conditions used by the optional visual weather effects.
  weather: weather.forecast_home

  # OPTIONAL: total solar-generation forecast for today, in kWh.
  # Reuse your existing setting if already configured.
  pv_forecast_today: sensor.solar_forecast_today

  # OPTIONAL EV SETTINGS
  # Only add these if your existing charger integration has not configured them.
  # Keep one entry per car, in the same order across the per-car lists.

  # OPTIONAL: number of cars represented by your configuration.
  # Keep your existing value if already configured.
  num_cars: 1

  # OPTIONAL: live charger power; enables the EV power display.
  # The entity must report W, kW or another convertible power unit.
  car_charging_power:
    - sensor.ev_charger_power

  # OPTIONAL: charger state, such as unplugged, connected or charging.
  car_charging_status:
    - sensor.ev_charger_status

  # OPTIONAL: vehicle battery state of charge, as a percentage.
  car_charging_soc:
    - sensor.ev_battery_percentage

  # OPTIONAL: daily accumulated charger electricity use, in kWh.
  car_charging_energy:
    - sensor.ev_charger_energy_today

  # OPTIONAL ASHP SETTINGS
  # Enable the heat-pump card when not already enabled by PredHeat.
  ashp_enable: true

  # OPTIONAL: current heat-pump electrical power consumption.
  # The entity must report W or a convertible power unit.
  ashp_power: sensor.heat_pump_power

  # OPTIONAL: heat-pump operating state.
  # Use off, hot_water or heating for the corresponding Overview states.
  ashp_status: sensor.heat_pump_status

  # OPTIONAL: indoor temperature, in degrees Celsius.
  internal_temperature: sensor.living_room_temperature

  # OPTIONAL: daily heat-pump ELECTRICITY consumption, in kWh.
  # Use electrical input energy rather than heat output.
  heat_energy: sensor.heat_pump_electricity_today

  # OPTIONAL compatibility alternative to heat_energy.
  # Use this only if heat_energy is not configured.
  # ashp_energy_today: sensor.heat_pump_electricity_today

Existing integrations and defaults

  • PredHeat: pump mode enables the ASHP card automatically and supplies its calculated indoor temperature and daily heating energy. Duplicate Overview settings are unnecessary.
  • Weather: predheat.weather takes precedence over the top-level weather setting. If neither is configured, Overview tries weather.forecast_home. Unavailable weather information is hidden.
  • EV integrations: retain automatically configured entities wherever available. Changing car settings can also affect Predbat’s existing charging configuration.
  • Optional readings: missing entities do not prevent the core Overview page from working.
  • Browser preferences: weather effects and device subtraction are controlled in the interface; they need no additional apps.yaml entries.

Validation

  • 72 frontend tests pass.
  • Production build, lint and changed-file pre-commit checks pass.
  • Tooltip positioning checked at both edges in a browser fixture.
  • Production frontend bundle rebuilt.
  • Tested through Home Assistant ingress on desktop and mobile

= and others added 30 commits September 26, 2026 09:11
Added instructions for testing the UI in Predbat.
Corrected typo in README regarding editing apps.yaml.
Add dashboard cards and improve plan timeline
@calvind80

calvind80 commented Oct 14, 2026 •

Copy link
Copy Markdown
Author
Dash-1 Dash-2 Plan-1 Plan-2 Overview Charts Tariff Comparison Editor

= and others added 12 commits October 15, 2026 19:36
Show excluded EV charging estimates with a clock and explanatory tooltip. Switch navigation to the hamburger menu below 1080px and rebuild the frontend bundle.

Fixes #14
Fix Octopus charge-to-add requests being interpreted as absolute car SOC targets.
For charger-linked Intelligent Go accounts, retain the configured car SOC ceiling and follow Octopus dispatch energy. This prevents the car being incorrectly marked as fully charged when its SOC exceeds the requested percentage to add.
Detect charger mode automatically from Octopus Direct’s is_charger attribute, with an optional per-car octopus_charge_limit_is_additive override. Preserve existing behaviour for absolute vehicle targets.
Add documentation and regression tests for automatic detection, explicit overrides and repeated refreshes.
Validation: focused tests and changed-file checks pass. Full-suite validation was blocked by environment restrictions and unrelated repository checks.
Refs springfall2008#3034

This branch has not been deployed

No deployments
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