WattPlan can do more than forecast price, usage, and PV. You can also add extra controllable assets so the planner can produce actions and suggestions for them.
See entities-and-services.md for the full list of exposed entities and services, including battery target services.
The three extra asset types are:
- Batteries
- Comfort Loads
- Optional Loads
All of these are configured inside the WattPlan integration UI. WattPlan then exposes sensors that your own Home Assistant automations can read and translate into actions on your real devices.
Batteries model controllable storage. WattPlan exposes each battery's action as an inverter-control policy:
preserveself_consumegrid_charge
It also tracks battery targets and timing data so you can expose planned behavior in the UI and automations.
Use a battery when:
- You have a home battery or battery-backed inverter.
- Your inverter or control stack can be told to allow/block battery discharge and enable/disable scheduled grid charging.
- You want WattPlan to shift energy based on price, usage, and PV availability.
Configure batteries through the WattPlan integration UI:
- Open
Settings->Devices & Services - Open
WattPlan - Add a battery asset
- Fill in the battery parameters shown in the flow
- Save the configuration
This is a WattPlan UI flow. You do not configure batteries by editing YAML.
You may also set an optional battery availability source. Leave it empty for fixed batteries that should always be treated as available. When set, it must be a binary sensor whose on state means WattPlan may currently control charge or discharge for this battery. This is mostly meant for EV batteries or other storage that is not always plugged in or controllable, without adding device-specific states.
WattPlan exposes battery-related entities such as:
- A battery action sensor
- A battery target sensor
The battery action sensor is the key one for control. Your automation should read that action and then translate it into the command model your inverter understands.
If a battery is skipped for the current plan, its action and next-action sensors are unavailable. The target sensor remains available because it represents your requested intent, not the current optimizer output. A battery skipped because its availability source is off does not degrade status; missing/untrusted availability or unusable SoC does.
See Real Life Examples for a concrete Home Assistant automation pattern.
Typical Pattern:
- Create an automation that triggers when the WattPlan battery action entity changes.
- Read the action value from WattPlan.
- Map
preserve,self_consume, orgrid_chargeto your inverter's controls. - Call the real inverter service, script, switch, or helper sequence.
The battery action sensor exposes policy, not raw measured or forecast battery flow. A slot where the plan shows no modeled battery delta often still emits self_consume, because the inverter should normally be allowed to cover real load that differs from the forecast.
| Policy | Meaning |
|---|---|
preserve |
Save stored energy because the model shows that spending it now would make the plan worse or violate constraints. Your automation should prevent this battery from discharging. PV charging may still be allowed by your inverter setup. |
self_consume |
Normal battery operation. Allow this battery to cover real load. Do not request grid charging. This is the default policy when the plan has no positive reason to preserve or grid-charge. |
grid_charge |
Request or allow grid charging for this battery and prevent the battery from being spent while doing so. |
PV surplus handling is not a battery action state in this version. PV export is a site-level decision, especially with multiple batteries, and is deferred for a future site-level policy design. Treat PV charging as normal inverter behavior unless your own automation needs a different device-specific rule.
The exact translation depends on your inverter integration. WattPlan does not directly control every battery platform; it publishes the intended action and lets your automations bridge that to your actual system.
The examples below show how WattPlan policy entities can be translated into real Home Assistant device controls. They are starting points, not universal recipes. Check your inverter, load controller, and integration behavior before applying an automation to real hardware.
This example describes one practical setup: Home Assistant entities exposed by Solar Assistant over MQTT for a Deye-compatible inverter, such as a Deye SUN-12K. It is not universal. Other inverter brands may map the same three WattPlan policies to different entities or services.
In this style of setup, the inverter time-of-use schedule controls can be more reliable than direct mode controls. A time-of-use capacity point is used to allow or block battery discharge, and a grid charge point switch is used to enable scheduled grid charging.
Generic policy mapping:
| WattPlan policy | Discharge allowed | Grid charging | Battery charging from PV |
|---|---|---|---|
preserve |
No | Off | Allowed/normal |
self_consume |
Yes | Off | Allowed/normal |
grid_charge |
No | On | Allowed |
Example time-of-use mapping:
| WattPlan policy | Time-of-use capacity point | Grid charge point |
|---|---|---|
preserve |
High, for example 100%, to prevent discharge |
Off |
self_consume |
Normal minimum, for example 10% |
Off |
grid_charge |
High, for example 100%, to preserve while charging |
On |
Example automation
alias: Apply WattPlan battery policy
mode: single
triggers:
- trigger: state
entity_id: sensor.wattplan_house_battery_action
conditions:
- condition: template
value_template: "{{ trigger.to_state.state in ['preserve', 'self_consume', 'grid_charge'] }}"
actions:
- variables:
policy: "{{ trigger.to_state.state }}"
normal_minimum_soc: 10
preserve_soc: 100
- choose:
- alias: "preserve: block discharge, no grid charge"
conditions:
- condition: template
value_template: "{{ policy == 'preserve' }}"
sequence:
- action: switch.turn_off
target:
entity_id: switch.inverter_grid_charge_point_1
- action: number.set_value
target:
entity_id: number.inverter_tou_capacity_point_1
data:
value: "{{ preserve_soc }}"
- alias: "self_consume: allow discharge, no grid charge"
conditions:
- condition: template
value_template: "{{ policy == 'self_consume' }}"
sequence:
- action: switch.turn_off
target:
entity_id: switch.inverter_grid_charge_point_1
- action: number.set_value
target:
entity_id: number.inverter_tou_capacity_point_1
data:
value: "{{ normal_minimum_soc }}"
- alias: "grid_charge: block discharge, enable grid charge"
conditions:
- condition: template
value_template: "{{ policy == 'grid_charge' }}"
sequence:
- action: number.set_value
target:
entity_id: number.inverter_tou_capacity_point_1
data:
value: "{{ preserve_soc }}"
- action: switch.turn_on
target:
entity_id: switch.inverter_grid_charge_point_1Comfort loads are loads that must still run regularly but can be shifted. Typical examples include:
- Heating
- Hot water
- Circulation or utility pumps
WattPlan plans them as on/off decisions with comfort-related constraints.
Use a comfort load when:
- The device is important and cannot simply be skipped all day.
- You can defer it somewhat without losing the underlying function.
- You want WattPlan to help decide when it should be on or off.
Configure comfort loads through the WattPlan integration UI:
- Open
Settings->Devices & Services - Open
WattPlan - Add a comfort load
- Fill in the comfort timing and power-related fields in the flow
- Save the configuration
This is also a WattPlan UI flow.
WattPlan exposes a comfort action sensor for each configured comfort load.
Typical Pattern:
- Create an automation that triggers when the comfort action entity changes.
- Read the WattPlan action value.
- Translate
on/offinto the real device command. - Call the actual switch, climate entity, script, or helper that controls the load.
WattPlan decides when the load should be on or off. Your automation is what applies that recommendation to the real device.
Optional loads are flexible �nice to run� loads. Typical examples include:
- Dishwasher
- Washing machine
- Dryer
- EV charging sessions treated as optional runs
WattPlan does not force these into the main schedule. Instead, it returns one or more suggested start options.
Use an optional load when:
- The run can be delayed within a window.
- You want suggestions rather than a mandatory always-on/off decision.
- You want to pick from one or more candidate times.
Configure optional loads through the WattPlan integration UI:
- Open
Settings->Devices & Services - Open
WattPlan - Add an optional load
- Fill in duration, energy, run-within window, and option count
- Save the configuration
Again, this is all done in the WattPlan config flow.
WattPlan exposes optional-load sensors such as:
- Next suggested start
- Next suggested end
- One or more option start timestamps
Typical Pattern:
- Read the suggested start sensor.
- Decide whether to accept it automatically or present it to the user.
- Create an automation that starts the device at the selected suggested time.
Optional loads are recommendation-oriented. They are a good fit when you want WattPlan to suggest the best times without turning the device on immediately.
The general rule for all extras is:
- Configure the asset in WattPlan.
- Let WattPlan publish action or suggestion entities.
- Create your own Home Assistant automations that translate those entities into commands for the real device.
That separation is intentional:
- WattPlan focuses on planning.
- Your automations focus on device-specific control.
Usually no. WattPlan publishes the intended action or time suggestion. You connect that to your real hardware using Home Assistant automations, scripts, helpers, or service calls.
Use the WattPlan battery action entity as the planner output. Then create an automation that maps:
preserveself_consumegrid_chargeTo whatever your inverter integration actually supports.
That might be:
- A service call
- A helper value
- A select entity
- A script that applies a complete inverter mode change.
See Real Life Examples for one concrete mapping.
Yes. That is the recommended path:
- Get price and usage working.
- Add PV if needed.
- Only then add batteries, comfort loads, or optional loads.