diff --git a/docs/apps-yaml.md b/docs/apps-yaml.md index c87acc0cf..4c2e96b85 100644 --- a/docs/apps-yaml.md +++ b/docs/apps-yaml.md @@ -2146,7 +2146,7 @@ no hub, use the serial of the device acting as one, which is the Zappi or Eddi t - **myenergi_token_hash** - OAuth refresh token hash, used to refresh `myenergi_key` automatically - at least one of `myenergi_key` or `myenergi_token_hash` is required when `myenergi_auth_method` is `oauth` - **myenergi_token_expires_at** - OAuth access token expiry, used to trigger a refresh - **myenergi_automatic** - Set to `false` to stop Predbat wiring the device sensors into **car_charging_energy**, **car_charging_planned** and **iboost_energy_today** automatically (default: `true`) -- **myenergi_automatic_zappi** - Set to `false` to wire only the Eddi half of the automatic configuration, leaving your Zappis out of **car_charging_energy**, **car_charging_planned** and **car_charging_power** (default: `true`). This is what to use if you have an Eddi but charge your car with a different make of charger - turning **myenergi_automatic** off instead would drop the **iboost_energy_today** wiring too +- **myenergi_automatic_zappi** - Set to `false` to wire only the Eddi half of the automatic configuration, leaving your Zappis out of **car_charging_energy**, **car_charging_planned**, **car_charging_power** and **car_charging_now** (default: `true`). This is what to use if you have an Eddi but charge your car with a different make of charger - turning **myenergi_automatic** off instead would drop the **iboost_energy_today** wiring too - **myenergi_automatic_eddi** - Set to `false` to wire only the Zappi half of the automatic configuration, leaving your Eddi out of **iboost_energy_today** (default: `true`). This is what to use if your hot water diversion is handled elsewhere but you still want your Zappis wired as cars - **myenergi_enable_controls** - Set to `false` for monitor-only operation (default: `true`) - **myenergi_poll_seconds** - Poll interval in seconds, rounded to the nearest whole multiple of 60, minimum 60 and maximum 1800 (default: `60`) diff --git a/docs/car-charging.md b/docs/car-charging.md index acbc0bf2e..2118c1152 100644 --- a/docs/car-charging.md +++ b/docs/car-charging.md @@ -105,7 +105,7 @@ Like car_charging_energy it can be a list of sensors, one per line per car charg If you have multiple cars sharing one charger, then only include a single entry for the charger. If your car charger has no live power sensor, leave **car_charging_power** commented out in `apps.yaml`; the power flow diagram then shows the same four items it always has, and no **predbat.car_charging_power** sensor is published.
-If you use one of the supported charger integrations (Ohme, myenergi Zappi, Wallbox, GivEnergy EV charger, AlphaESS EV charger or the Predbat gateway) then this is configured automatically and you do not need an `apps.yaml` entry of your own. +If you use one of the supported charger integrations (Ohme, myenergi Zappi, Wallbox, GivEnergy EV charger, AlphaESS EV charger or the Predbat gateway with `gateway_evc_automatic`) then this is configured automatically and you do not need an `apps.yaml` entry of your own. If you do not have a suitable car charging energy kWh sensor in Home Assistant then comment the **car_charging_energy** line out of `apps.yaml` and configure **input_number.predbat_car_charging_threshold** @@ -208,7 +208,7 @@ So it does not turn on **binary_sensor.predbat_car_charging_slot**, and an autom With Octopus Intelligent charging a charge outside a dispatch does not get the cheap rate either.
A car charging outside any charging slot is also modelled in the plan at **input_number.predbat_car_charging_rate** until the end of the current plan slot (**plan_interval_minutes**, 30 minutes by default), so no export is planned over it. With **switch.predbat_metric_dynamic_load_adjust** On its load is also taken out of the recent-load estimate, so it is not counted twice - see [Dynamic Load Adjust](customisation.md#scaling-and-weight-options).
Leave it commented out if you have no sensor that reports the car actually drawing power. -The Ohme (`ohme_automatic`), myenergi Zappi (`myenergi_automatic`), Wallbox (`wallbox_automatic`) and Predbat gateway integrations set it for you, unless you have set it yourself in `apps.yaml`. +The Ohme (`ohme_automatic`), myenergi Zappi (`myenergi_automatic`) and Wallbox (`wallbox_automatic`) integrations set it for you, unless you have set it yourself in `apps.yaml`. The [GivEnergy Gateway](#givenergy-gateway-ocpp-ev-charger) integration (`gateway_evc_automatic`) sets it too, replacing any value of your own. - **car_charging_now_response** - Set to the range of positive responses for car_charging_now to indicate that the car is charging. Useful if you have a sensor for your car charger that isn't binary. The sensor's state must match one of these exactly (ignoring case). If unset it defaults to `yes`, `on`, `enable`, `true` and `charging`, which covers on/off sensors and chargers whose status reads `Charging`, such as a myenergi Zappi's plug status. @@ -256,11 +256,63 @@ If you have [multiple electric cars](#multiple-electric-cars) then car_charging_ Multiple cars can be planned with Predbat, in which case you should set **num_cars** in `apps.yaml` to the number of cars you want to plan. -- **car_charging_limit**, **car_charging_planned**, **car_charging_battery_size** and **car_charging_soc** must then be a list of values (i.e. 2 entries for 2 cars) +- **car_charging_limit**, **car_charging_planned**, **car_charging_battery_size** and **car_charging_soc** must then be a list of values (i.e. 2 entries for 2 cars), and so should **car_charging_now** if you set it - Each car will have its own Home Assistant slot sensor created e.g. **binary_sensor.predbat_car_charging_slot_1**, SoC planning sensor e.g **predbat.car_soc_1** and **predbat.car_soc_best_1** for car 1 +#### One charger shared by more than one car + +A single charger sensor listed for both cars shows both cars as plugged in (in **car_charging_planned**) or charging (in **car_charging_now**) whenever either one is. +With **car_charging_exclusive** set to `true` Predbat then plans only one of them, but it goes through the cars in order, so it plans car 0 whenever car 0 has charging to plan, whichever car is actually on the charger. + +This applies to a charger whose car settings you set yourself in `apps.yaml` - not one set up by Predbat's own charger integrations (Ohme, myenergi, Wallbox, GivEnergy Gateway or GivEnergy Cloud EV charger), whose automatic setup and charger control assume one car per charger. +To use it with a Zappi on Predbat's own myenergi integration, set **myenergi_automatic_zappi** to `false` so the integration leaves your Zappi's car settings to you. That includes **car_charging_energy** (and **car_charging_power**), which you then set yourself to the Zappi's `sensor.predbat_myenergi_zappi__session_energy` (still published) so its energy is still taken out of your house load. Zappi charger control then stays off, as it needs that setting on. + +To fix it, tell Predbat which car is on the charger, and give each car its own sensors that follow the charger only while that car is the one on it (keep **car_charging_exclusive** set to `true` as well). +For example, with an `input_select` helper of your own, with options `Car 0`, `Car 1` and `None`, which you or an automation set to the car on the charger: + +```yaml +template: + - sensor: + # Use the same unit as your charger's power sensor: "kW" if it is in kW, which Predbat converts + - name: "Car 0 charging power" + unit_of_measurement: "W" + device_class: power + availability: "{{ has_value('input_select.car_on_charger') and (not is_state('input_select.car_on_charger', 'Car 0') or has_value('sensor.your_charger_power')) }}" + state: "{{ states('sensor.your_charger_power') if is_state('input_select.car_on_charger', 'Car 0') else 0 }}" + - name: "Car 1 charging power" + unit_of_measurement: "W" + device_class: power + availability: "{{ has_value('input_select.car_on_charger') and (not is_state('input_select.car_on_charger', 'Car 1') or has_value('sensor.your_charger_power')) }}" + state: "{{ states('sensor.your_charger_power') if is_state('input_select.car_on_charger', 'Car 1') else 0 }}" + - binary_sensor: + # Use your charger's plugged-in sensor; with a status sensor instead, test for its exact "no car" state, + # e.g. for a Zappi's plug status: has_value('sensor.your_charger_status') and not is_state('sensor.your_charger_status', 'EV Disconnected') + - name: "Car 0 plugged in" + state: "{{ is_state('input_select.car_on_charger', 'Car 0') and is_state('binary_sensor.your_charger_plugged_in', 'on') }}" + - name: "Car 1 plugged in" + state: "{{ is_state('input_select.car_on_charger', 'Car 1') and is_state('binary_sensor.your_charger_plugged_in', 'on') }}" +``` + +```yaml + car_charging_now: + - sensor.car_0_charging_power + - sensor.car_1_charging_power + car_charging_planned: + - binary_sensor.car_0_plugged_in + - binary_sensor.car_1_plugged_in + car_charging_exclusive: + - true + - true +``` + +The `availability` lines matter with Octopus Intelligent: the [dispatch check](#checking-intelligent-dispatches-against-the-car) treats an unavailable sensor as no evidence, but a definite 0W as the car not charging. + +With Octopus Intelligent, this works when each car is enrolled separately with its own **octopus_intelligent_slot** entry, and **octopus_intelligent_planned_slot** entry if you use one (see [below](#multiple-cars-with-octopus-intelligent-go-iog)). +With **octopus_automatic**, suspending or removing a car can move the other car to a different index (see [how Predbat picks which car goes in which slot](#how-predbat-picks-which-car-goes-in-which-slot-octopus_automatic)), so check that your `input_select` options still name the right car afterwards. +When only the charger is enrolled, its dispatches belong to the car whose **octopus_intelligent_slot** entry it is, normally car 0. While the other car is selected, the enrolled car reads 0W, so Predbat can cancel the dispatch - and with **switch.predbat_octopus_intelligent_ignore_unplugged** On it also reads as unplugged, so the dispatch is ignored. This recipe does not suit that setup. + ### Multiple cars with Octopus Intelligent Go (IOG) If you have **two or more EVs enrolled in Octopus Intelligent Go**, Predbat can track the scheduled dispatch slots for each car independently. @@ -576,7 +628,7 @@ It only applies to Octopus Intelligent charging (**switch.predbat_octopus_intell **Setting it up** Point **car_charging_now** in `apps.yaml` at a sensor that shows the car charging. -If you use `ohme_automatic`, `myenergi_automatic`, `wallbox_automatic` or the Predbat gateway this is already done for you. +If you use `ohme_automatic`, `myenergi_automatic`, `wallbox_automatic` or the Predbat gateway with `gateway_evc_automatic`, this is already done for you. It can be an on/off sensor (matched against **car_charging_now_response**), or a charging power sensor in W or kW, where 200W or more counts as charging - useful for chargers such as Wallbox that have no "charging" sensor: ```yaml diff --git a/docs/devices.md b/docs/devices.md index eb922954a..60b58b52f 100644 --- a/docs/devices.md +++ b/docs/devices.md @@ -2,6 +2,16 @@ This section of the documentation describes the configuration required for different 3rd party devices/integrations, typically EV chargers. If you have a device not listed then please raise a GitHub ticket with your configuration. +## Telling Predbat the car is charging now + +Where a charger below has a **car_charging_now** example, it tells Predbat when the car is actually drawing power, so Predbat can hold the house battery for the car while it charges, including a charge you start by hand. +See [car_charging_now](car-charging.md#planned-car-charging) for the kinds of sensor it accepts (on/off, a charger status, or a charging power) and when the hold applies. +If your charger is not listed, look on its device page in Home Assistant for one of these, and check its history while the car charges. + +**car_charging_now_response** and **car_charging_planned_response** are each one list for every car. Predbat uses its built-in default only when you have not set a list. If an example below sets one, merge that example's values into your list (or, if you have none, into the default: `yes`, `on`, `enable`, `true` and `charging` for **car_charging_now_response**, the same without `charging` for **car_charging_planned_response**) rather than replacing it, so your other cars' sensors still match. + +If more than one car uses the same charger, see [One charger shared by more than one car](car-charging.md#one-charger-shared-by-more-than-one-car). + ## Hypervolt @@ -105,6 +115,17 @@ Home Assistant 2026.8.0 removed the Ohme integration's `energy` sensor entirely - "pending_approval" ``` +**Determine if the car is charging now** + +The status sensor reads `charging` while the car draws power, which the default **car_charging_now_response** accepts: + +```yaml + car_charging_now: + - "sensor.ohme_{ohme_name}_status" +``` + +If you use [Ohme Direct](car-charging.md#ohme-car-charger-direct-integration) instead (`ohme_automatic`), leave this entry out: Predbat then uses its own Ohme power sensor, but an entry you have set yourself takes its place. + **Octopus Intelligent GO** Replace XXX with your device ID which can be found by going to 'Settings' / 'Developer Tools' / 'Actions' then selecting 'Ohme: List Charge Slots' @@ -295,9 +316,16 @@ Can be used both for the Car Charging Hold feature (to filter out previous car c ```yaml car_charging_energy: 're:sensor.myenergi_zappi_[0-9a-z]+_charge_added_session' car_charging_planned: - - 're:sensor.myenergi_zappi_[0-9a-z]+_plug_status)' + - 're:(sensor.myenergi_zappi_[0-9a-z]+_plug_status)' + car_charging_now: + - 're:(sensor.myenergi_zappi_[0-9a-z]+_plug_status)' ``` +The plug status reads `Charging` while the car draws power, which the default **car_charging_now_response** accepts. (Predbat's own myenergi integration uses the Zappi's charging power instead, where 200W or more counts as charging.) +Make sure your **car_charging_planned_response** list includes `ev ready to charge` (plugged in but paused): most inverter templates list it, but the default `apps.yaml` does not. +A `re:` expression resolves to a single matching entity, and which one is not predictable, so with more than one Zappi give each car the full entity name of its own Zappi's sensor instead, and list every Zappi's session sensor under **car_charging_energy** (their energy is added together). +If you use Predbat's own [myenergi integration](components.md#myenergi-myenergi) with `myenergi_automatic` on (the default), it sets these for you, so remove these lines - a **car_charging_now** you leave set is used in place of the integration's own power sensor. + _TIP:_ The Zappi must be set to Eco+ mode for IOG to control it. If Predbat starts exporting your battery (e.g. prior to the IOG cheap overnight period) then the Zappi can treat the exported energy as excess solar and start charging the EV battery with it!
To prevent this happening, in the Zappi configuration set the Export Margin to 8000W so that the Zappi will only charge the EV from excess solar when more than 8000W is being exported (which should never happen).