TARIFF-30: hold out a failed leg while the trade winds down; docs, text, pins
checks / unit (pull_request) Failing after 58m14s
infra-pin / fresh (pull_request) Successful in 2s

The loop gives up a trade's last target at its slew, so a unit whose own leg failed stays at 0 W charge for that tail (120 s at most). Option and status texts follow STYLE.md. DOCS and CHANGELOG. The per-entry schema pins in test_inverter and test_translations count the new key.

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Claude (dev)
2026-12-05 17:11:07 +01:00
parent 6881748660
commit 9ba3008eb8
11 changed files with 37 additions and 20 deletions
+3 -1
View File
@@ -183,6 +183,7 @@ The label and description each setting shows on the Configuration tab, in tab or
| Hardware · Inverter list | Battery power entity (W) (optional) | `inverters.batt_entity` | This inverter's own battery power sensor. Leave it empty if it has none. |
| Hardware · Inverter list | Battery power sign is reversed (optional) | `inverters.batt_invert` | Switch this on if this inverter's sensor shows giving power as a negative number. |
| Hardware · Inverter list | Usable battery capacity (kWh) (optional) | `inverters.capacity_kwh` | This battery's usable capacity from its datasheet. Fill it in on every inverter or on none. The add-on then shares the work by the energy each battery has left. |
| Hardware · Inverter list | Round-trip efficiency (0.5 to 1) (optional) | `inverters.round_trip_eff` | The share of energy this battery gives back, for example 0.86. Leave it empty if unknown. If you set round-trip efficiency, lower the cycle cost to wear only. |
| Hardware | RS485 emergency stop is fitted | `estop_fitted` | Switch this on if the emergency stop is installed. It only changes a warning on the status page. |
| Hardware | Battery modes | `battery_modes_enabled` | Give each battery an on and off switch and a mode, set on the Batteries screen. |
| Hardware | Solar forecast, today (kWh) | `pv_forecast_entity` | Optional. A forecast sensor with today's remaining solar energy, such as Forecast.Solar or Solcast. A battery then buys only what the sun will not give. |
@@ -229,7 +230,7 @@ The label and description each setting shows on the Configuration tab, in tab or
| Tariff | Current price entity (older) | `price_now_entity` | The older way to get a price, used only to charge in a cheap window during maintenance. Do not combine it with a dynamic price source. |
| Tariff | Average price entity (older) | `price_avg_entity` | The average the current price is compared with. Use it only with the current price entity, not with a dynamic price source. |
| Tariff | Trade on the price spread | `arbitrage_enabled` | Charge in the cheapest hour and draw the battery down in the dearest, when the spread covers the cost. Turning it off does not turn the price feed off. |
| Tariff | Battery cycle cost (EUR/kWh) | `cycle_cost_threshold_eur` | What one full battery cycle costs per kWh. A smaller price spread is not traded, and the value is a product choice, not a measured one. |
| Tariff | Battery cycle cost (EUR/kWh) | `cycle_cost_threshold_eur` | Cost of one cycle per kWh. Smaller gaps are not traded. A product choice, not a measured one. If you set round-trip efficiency, lower the cycle cost to wear only. |
| Tariff | Trading keeps at least (%) | `arbitrage_soc_floor` | Price trading will not draw the battery below this level. It is separate from the maintenance settings. |
| Tariff | Trading charges at most (%) | `arbitrage_soc_ceiling` | Price trading will not charge the battery above this level. |
| Maintenance | Run the monthly battery cycle | `maintenance_enabled` | Once a month, empty the battery deeply, charge it full and hold it there, so its level reading stays accurate. Off by default. |
@@ -283,6 +284,7 @@ When the add-on refuses to start, each reason names the setting by its label and
- **Battery power entity** (`batt_entity`): on the reference installation this is holding register 0x0518, read by the control board. The wrong-direction checks and the opposing-inverters alarm both grade each inverter against it.
- **Inverter list** (`inverters`): empty means the single-inverter settings describe the one inverter you have. Filled in, the list replaces them and nothing is inherited: each entry names its own setpoint entity, rating and cut-out level, so no inverter is judged by another's numbers. “Inverter setpoint entity” must then be empty, and the add-on refuses to start when both are set. Each entry's name keys its own safety stop and records in the add-on's state, so two entries may not share one.
- **Usable battery capacity** (`inverters.capacity_kwh`): read only to share the site target by the energy each battery has left rather than by its rating. The reference batteries are 5000 W with 15.36 kWh and 4600 W with 20.48 kWh, so the two ways of sharing give the work to different batteries. Stated on some entries and not others, the add-on refuses to start.
- **Round-trip efficiency** (`inverters.round_trip_eff`, 0.5 to 1, optional per entry): the share of the energy a battery gives back after it took it in, measured by you (for example 0.86 and 0.75 on two batteries). Set, the cheap hour for that battery counts at its price divided by this number, and it is charged from the grid only when the price gap still covers that and the cycle cost. Not set, nothing changes. A battery can have it while another does not. The day plan then uses the square root of it for each way in and out. **Settings impact:** *Battery cycle cost* then means wear only, so lower it when you set this; the add-on never changes your cycle cost by itself. Taking the key out again leaves the add-on as it was; nothing is stored. The status page shows each battery's value, or "not set". How the work is split between the batteries when giving power does not depend on it.
- **Solar production entities** (`pv_entity`, `pv_entities`, `pv_invert_entities`): measurement only, no control behaviour changes. The unit is read off each entity, so a sensor without one is refused rather than guessed. With several entities, one that stops reporting gives no site total at all, because a partial sum looks like a real one. Setting `pv_entities` ignores `pv_entity`.
- **Where the meter reading comes from** (`meter_source`): 'off' keeps “Grid power entity”. ha_dsmr follows the DSMR integration, mqtt_p1 reads an MQTT topic, ha_signed reads one signed entity (what a HomeWizard P1 publishes), and homewizard_local polls the meter's own local API. Only homewizard_local can tell "the meter did not answer" from "the value did not change", so the stuck-meter alarm only means something there.
- **Grid import and export entities** (`p1_import_entity`, `p1_export_entity`, `p1_net_entity`): the add-on computes net power itself, so the sign convention lives in tested code rather than in a template sensor.