Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Next release #1145

Merged
merged 24 commits into from
Jan 1, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
fb0f8e3
feat: Added sensor to show the current raw intelligent state (1 hour …
BottlecapDave Dec 20, 2024
b8fed00
chore: Merged main into develop
github-actions[bot] Dec 26, 2024
64f2007
Merge branch 'develop' into feat/intelligent-current-state
BottlecapDave Dec 26, 2024
52cc578
docs: Updated the docs
BottlecapDave Dec 26, 2024
083ed1d
feat: Added sensor to show the current raw intelligent state (1 hour …
BottlecapDave Dec 27, 2024
0d7f595
blueprint: Added blueprint to detect gas anomalies (e.g. potential ga…
BottlecapDave Dec 27, 2024
08dc4f6
docs: Updated intelligent migration docs to reference target and roll…
BottlecapDave Dec 29, 2024
52bb498
fix: Fixed intelligent charge target to not send invalid value to OE …
BottlecapDave Dec 29, 2024
7554228
feat: Added select sensor for intelligent target time to make it easi…
BottlecapDave Dec 29, 2024
654dd95
chore: Updated configuration headings
BottlecapDave Dec 30, 2024
5701e4d
fix: Updated cost tracker sensor configuration to update when underly…
BottlecapDave Dec 30, 2024
7c81ad9
Merge branch 'develop' of https://github.com/BottlecapDave/HomeAssist…
BottlecapDave Dec 30, 2024
6cdffb0
feat: Updated update target rate and rolling target rate services to …
BottlecapDave Dec 30, 2024
e2dc331
fix: Fixed guard against invalid data in home pro client
BottlecapDave Dec 30, 2024
c14e5a2
chore: Fixed intelligent current state
BottlecapDave Dec 30, 2024
7d59da8
feat: Added Cosy 6 Heat Pump support (10 hours 45 minutes dev time)
BottlecapDave Dec 30, 2024
37b69c8
feat: Added additional lifetime and live sensors for heat pumps (Than…
BottlecapDave Dec 31, 2024
dc3abab
Update __init__.py
reidjr2 Dec 31, 2024
6594c67
Fix update flow temperature service
lwis Dec 31, 2024
0bd38af
feat: Added manual reset mode to cost trackers (1.5 hours dev time)
BottlecapDave Jan 1, 2025
d3cf93b
fix: Fixed demand for Home Pro when divisor is not standard value (Th…
BottlecapDave Jan 1, 2025
0d67ee6
chore: Added comment
BottlecapDave Jan 1, 2025
e7ab8ff
Fix comment
lwis Jan 1, 2025
213a198
chore: Fix update flow temperature service
BottlecapDave Jan 1, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Below are the main features of the integration
* [Saving sessions support](https://bottlecapdave.github.io/HomeAssistant-OctopusEnergy/entities/octoplus/#saving-sessions)
* [Wheel of fortune support](https://bottlecapdave.github.io/HomeAssistant-OctopusEnergy/entities/wheel_of_fortune/)
* [Greener days support](https://bottlecapdave.github.io/HomeAssistant-OctopusEnergy/entities/greenness_forecast)
* [Heat Pump support](https://bottlecapdave.github.io/HomeAssistant-OctopusEnergy/entities/heat_pump)

## How to install

Expand Down
10 changes: 10 additions & 0 deletions _docs/blueprints.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,16 @@ This blueprint will raise a persistent notification within HA when a rate update

## Consumption

### Alert when gas anomaly detected

[Install blueprint](https://my.home-assistant.io/redirect/blueprint_import/?blueprint_url=https%3A%2F%2Fgithub.com%2FBottlecapDave%2FHomeAssistant-OctopusEnergy%2Fblob%2Fdevelop%2F_docs%2Fblueprints%2Foctopus_energy_gas_anomaly.yaml) | [Source](./blueprints/octopus_energy_gas_anomaly.yaml)

This blueprint will fire a configured action when the consumption has 24 hours worth of records and all thirty minute periods exceed the configured threshold. This can be used to alert you to _potential_ gas leaks.

!!! warning

Like everything else with this integration, this is provided _as is_ and should be used as a guide and early warning sign. It will only trigger if all data is available. If triggered, you should use your own judgment to determine if the warning is legitimate.

### Alert when consumption data is late

[Install blueprint](https://my.home-assistant.io/redirect/blueprint_import/?blueprint_url=https%3A%2F%2Fgithub.com%2FBottlecapDave%2FHomeAssistant-OctopusEnergy%2Fblob%2Fdevelop%2F_docs%2Fblueprints%octopus_energy_late_consumption_data.yml) | [Source](./blueprints/octopus_energy_late_consumption_data.yml)
Expand Down
56 changes: 56 additions & 0 deletions _docs/blueprints/octopus_energy_gas_anomaly.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
blueprint:
name: Octopus Energy - Gas Anomaly
description: Once all data is available for a day, detects if at least one 30 minute segment is equal or below the configured threshold. This is to try and detect potential gas leaks. If triggered, you should use your own judgment to determine if the warning is legitimate.
domain: automation
author: BottlecapDave
input:
consumption_entity:
name: Consumption entity
description: The entity which reports the previous accumulative consumption (e.g sensor.octopus_energy_electricity_{{METER_SERIAL_NUMBER}}_{{MPAN_NUMBER}}_previous_accumulative_consumption)
selector:
entity:
filter:
- domain:
- sensor
integration: octopus_energy
threshold:
name: Threshold
description: The threshold that at least one 30 minute segment must be equal or below
selector:
number:
mode: box
min: 0
actions:
name: Actions
description: Notifications or similar to be run. {{message}} is an example message
selector:
action: {}
trigger_variables:
consumption_entity: !input consumption_entity
threshold: !input threshold
variables:
message: 'All 30 minute periods have exceeded the threshold of {{ threshold }}, which is an indication of a potential gas leak. Please review your consumption data and make your own assessments.'
mode: queued
max: 4
trigger:
- platform: state
entity_id: !input consumption_entity
condition:
- condition: template
value_template: >
{% set consumptions = state_attr(consumption_entity, 'charges') %}
{% set unit_of_measurement = state_attr(consumption_entity, 'unit_of_measurement') %}
{% if consumptions != none and consumptions | length == 48 %}
{% set is_valid = namespace(value=True) %}
{% for consumption in consumptions %}
{% if (unit_of_measurement == "kWh" and consumption["consumption_kwh"] <= threshold) or (unit_of_measurement != "kWh" and consumption["consumption_m3"] <= threshold) %}
{% set is_valid.value = False %}
{% endif %}
{% endfor %}
{{ is_valid.value }}
{% else %}
{{ False }}
{% endif %}
action:
- choose: []
default: !input actions
15 changes: 15 additions & 0 deletions _docs/entities/diagnostics.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,21 @@ This sensor states when the standing charge data was last retrieved.

This sensor states when wheel of fortune data was last retrieved.

!!! note
This is [disabled by default](../faq.md#there-are-entities-that-are-disabled-why-are-they-disabled-and-how-do-i-enable-them).

| Attribute | Type | Description |
|-----------|------|-------------|
| `attempts` | `integer` | The number of attempts that have been made to retrieve the data |
| `next_refresh` | `datetime` | The timestamp of when the data will next be attempted to be retrieved |
| `last_error` | `string` | The error that was raised to cause the last retrieval attempt to fail |

## Heat Pump Data Last Retrieved

`sensor.octopus_energy_{{HEAT_PUMP_ID}}_heat_pump_data_last_retrieved`

This sensor states when heat pump data was last retrieved.

!!! note
This is [disabled by default](../faq.md#there-are-entities-that-are-disabled-why-are-they-disabled-and-how-do-i-enable-them).

Expand Down
85 changes: 85 additions & 0 deletions _docs/entities/heat_pump.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# Heat Pump

The following entities are available if you have a heat pump registered against your account. The following heat pumps are known to be compatible

* Cosy 6

## Humidity Sensor

`sensor.octopus_energy_heat_pump_{{HEAT_PUMP_ID}}_{{SENSOR_CODE}}_humidity`

This represents the humidity reported by a sensor (e.g. Cosy Pod) that is associated with a heat pump.

## Temperature Sensor

`sensor.octopus_energy_heat_pump_{{HEAT_PUMP_ID}}_{{SENSOR_CODE}}_temperature`

This represents the temperature reported by a sensor (e.g. Cosy Pod) that is associated with a heat pump.

## Zone

`climate.octopus_energy_heat_pump_{{HEAT_PUMP_ID}}_{{ZONE_CODE}}`

This can be used to control the target temperature and mode for a given zone (e.g. water or zone 1) linked to your heat pump. It will also display the current temperature linked to the primary sensor for the zone.

The following operation modes are available

* `Heat` - This represents as `on` in the app
* `Off` - This represents as `off` in the app
* `Auto` - This represents as `auto` in the app

In addition, there is the preset of `boost`, which activates boost mode for the zone for 1 hour. If you require boost to be on for a different amount of time, then you can use the [available service](../services.md#octopus_energyboost_heat_pump_zone).

## Lifetime Seasonal Coefficient of Performance

`sensor.octopus_energy_heat_pump_{{HEAT_PUMP_ID}}_lifetime_scop`

This represents the efficiency by the heat pump since commissioning or last reset.

## Lifetime Energy Input

`sensor.octopus_energy_heat_pump_{{HEAT_PUMP_ID}}_lifetime_energy_input`

This represents the energy/power drawn by the heat pump since commissioning or last reset in kWh.

## Lifetime Heat Output

`sensor.octopus_energy_heat_pump_{{HEAT_PUMP_ID}}_lifetime_heat_output`

This represents the energy/heat supplied by the heat pump since commissioning or last reset in kWh.

## Live Coefficient of Performance

`sensor.octopus_energy_heat_pump_{{HEAT_PUMP_ID}}_live_cop`

This represents the instantaneous efficiency of the heat pump.

!!! note
As this integration uses cloud polling this will inherently have a delay.

## Live Power Input

`sensor.octopus_energy_heat_pump_{{HEAT_PUMP_ID}}_live_power_input`

This represents the instantaneous energy/power being drawn by the heat pump in kWh.

!!! note
As this integration uses cloud polling this will inherently have a delay.

## Live Heat Output

`sensor.octopus_energy_heat_pump_{{HEAT_PUMP_ID}}_live_heat_output`

This represents the instantaneous energy/heat being supplied by heat pump in kWh.

!!! note
As the integration uses cloud polling this will inherently have a delay.

## Live Outdoor Temp

`sensor.octopus_energy_heat_pump_{{HEAT_PUMP_ID}}_live_outdoor_temperature`

This represents the current outdoor temperature as observed by the heat pump.

!!! note
As the integration uses cloud polling this will inherently have a delay.
29 changes: 27 additions & 2 deletions _docs/entities/intelligent.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,27 @@ Each item in `planned_dispatch` or `completed_dispatches` have the following att

You can use the [data_last_retrieved sensor](./diagnostics.md#intelligent-dispatches-data-last-retrieved) to determine when the underlying data was last retrieved from the OE servers.

### Current State

`sensor.octopus_energy_{{ACCOUNT_ID}}_intelligent_state`

This sensor displays the current state of your intelligent provider as told by the OE API. The value of this sensor can be one of the following

* `AUTHENTICATION_PENDING` - ready to start authentication and authorization, or auth is in progress.
* `AUTHENTICATION_FAILED` - failed to connect and ready to restart authentication and authorization.
* `AUTHENTICATION_COMPLETE`- ready to start test (if needed) or pending live where auth or telemetry is delayed.
* `TEST_CHARGE_IN_PROGRESS` - connection and smart control test has successfully started and is occurring.
* `TEST_CHARGE_FAILED` - connection or smart control test has failed or could not start, ready to retry test.
* `TEST_CHARGE_NOT_AVAILABLE` - not currently capable of smart control test (e.g. away from home or unplugged).
* `SETUP_COMPLETE` - test is complete (if needed) and device is live, but not ready for smart control.
* `SMART_CONTROL_CAPABLE` - live and ready for smart control (e.g. at home and plugged in) but none is scheduled.
* `SMART_CONTROL_IN_PROGRESS` - smart control (e.g. smart charging) is scheduled or is currently occurring.
* `BOOSTING` - user has overridden the schedule to immediately boost (e.g. bump charge now).
* `SMART_CONTROL_OFF` - smart control has been (temporarily) disabled (e.g. by the user with holiday mode).
* `SMART_CONTROL_NOT_AVAILABLE` - not currently capable of smart control (e.g. away from home or unplugged).
* `LOST_CONNECTION` - lost connection to the device, ready to re-auth (if not temporary / automatic fix).
* `RETIRED` - / de-authed (re-auth not possible, re-register device to onboard again).

### Bump Charge

`switch.octopus_energy_{{ACCOUNT_ID}}_intelligent_bump_charge`
Expand Down Expand Up @@ -102,7 +123,7 @@ This sensor is used to see and set the charge target for your future intelligent

### Target Time

`time.octopus_energy_{{ACCOUNT_ID}}_intelligent_target_time`
`select.octopus_energy_{{ACCOUNT_ID}}_intelligent_target_time`

This sensor is used to see and set the target time for your future intelligent charges.

Expand All @@ -116,13 +137,17 @@ This sensor is used to see and set the target time for your future intelligent c

You can use the [data_last_retrieved sensor](./diagnostics.md#intelligent-settings-data-last-retrieved) to determine when the underlying data was last retrieved from the OE servers.

!!! warning

There is a time based sensor called `select.octopus_energy_{{ACCOUNT_ID}}_intelligent_target_time` which represents this functionality. This is a legacy sensor which will be removed in the future.

## Migrating from megakid/ha_octopus_intelligent?

If you're moving to this integration from [megakid/ha_octopus_intelligent](https://github.com/megakid/ha_octopus_intelligent), below is a quick guide on what entities you should use

* `binary_sensor.octopus_intelligent_slot` - Use the [is dispatching sensor](#is-dispatching)
* `binary_sensor.octopus_intelligent_planned_dispatch_slot` - There is no alternative for this.
* `binary_sensor.octopus_intelligent_slot_next_1_hour`, `binary_sensor.octopus_intelligent_slot_next_2_hours` and `binary_sensor.octopus_intelligent_slot_next_3_hours` - These sensors felt like they would always fall short of peoples requirements as everyone has different time periods they wish to know about. The [is dispatching sensor](#is-dispatching) exposes the current and next start/end times which could be used in a template sensor to determine how long the rate is cheap for when on.
* `binary_sensor.octopus_intelligent_slot_next_1_hour`, `binary_sensor.octopus_intelligent_slot_next_2_hours` and `binary_sensor.octopus_intelligent_slot_next_3_hours` - These sensors felt like they would always fall short of peoples requirements as everyone has different time periods they wish to know about. The [is dispatching sensor](#is-dispatching) exposes the current and next start/end times which could be used in a template sensor to determine how long the rate is cheap for when on. Or the [target rate](../setup/target_rate.md) or [rolling target rate](../setup/rolling_target_rate.md) might help for what you need.
* `sensor.octopus_intelligent_next_offpeak_start` - The default off peak start date/time can be found as an attribute on the [off peak sensor](./electricity.md#off-peak). This can be extracted using a [template sensor](https://www.home-assistant.io/integrations/template/).
* `sensor.octopus_intelligent_offpeak_end` - The default off peak end date/time can be found as an attribute on the [off peak sensor](./electricity.md#off-peak). This can be extracted using a [template sensor](https://www.home-assistant.io/integrations/template/).
* `switch.octopus_intelligent_bump_charge` - Use the [bump charge sensor](#bump-charge)
Expand Down
7 changes: 6 additions & 1 deletion _docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Below are the main features of the integration
* [Saving sessions support](#octoplus)
* [Wheel of fortune support](#wheel-of-fortune)
* [Greener days support](#greenness-forecast)
* [Heat Pump support](#heat-pumps)

## How to install

Expand Down Expand Up @@ -92,7 +93,7 @@ To support the wheel of fortune that is awarded every month to customers. [Full

### Greenness Forecast

To support Octopus Energy's [greener days](https://octopus.energy/smart/greener-days/). [Full list of greenness forecast entites](./entities/greenness_forecast.md).
To support Octopus Energy's [greener days](https://octopus.energy/smart/greener-days/). [Full list of greenness forecast entities](./entities/greenness_forecast.md).

## Target Rate Sensors

Expand All @@ -114,6 +115,10 @@ These sensors compare the cost of the previous consumption to another tariff to

Please follow the [setup guide](./setup/tariff_comparison.md).

### Heat Pumps

To support heat pumps connected to Octopus Energy, like the [Cosy 6](https://octopus.energy/cosy-heat-pump/). [Full list of heat pump entities](./entities/heat_pump.md).

## Events

This integration raises several events, which can be used for various tasks like automations. For more information, please see the [events docs](./events.md).
Expand Down
31 changes: 30 additions & 1 deletion _docs/services.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ For updating a given [target rate's](./setup/target_rate.md) config. This allows
| `data.target_minimum_rate` | `yes` | The optional minimum rate the selected rates should not go below. |
| `data.target_maximum_rate` | `yes` | The optional maximum rate the selected rates should not go above. |
| `data.target_weighting` | `yes` | The optional weighting that should be applied to the selected rates. |
| `data.persist_changes` | `yes` | Determines if the changes should be persisted to the original configuration or should be temporary and reset upon integration reload. If not supplied, then the changes are temporary |

### Automation Example

Expand Down Expand Up @@ -103,6 +104,7 @@ For updating a given [rolling target rate's](./setup/rolling_target_rate.md) con
| `data.target_minimum_rate` | `yes` | The optional minimum rate the selected rates should not go below. |
| `data.target_maximum_rate` | `yes` | The optional maximum rate the selected rates should not go above. |
| `data.target_weighting` | `yes` | The optional weighting that should be applied to the selected rates. |
| `data.persist_changes` | `yes` | Determines if the changes should be persisted to the original configuration or should be temporary and reset upon integration reload. If not supplied, then the changes are temporary |

### Automation Example

Expand Down Expand Up @@ -267,4 +269,31 @@ This automation adds weightings based on the national grids carbon intensity, as
{% set ns = namespace(list = []) %} {%- for a in forecast -%}
{%- set ns.list = ns.list + [{ "start": a.from.strftime('%Y-%m-%dT%H:%M:%SZ'), "end": a.to.strftime('%Y-%m-%dT%H:%M:%SZ'), "weighting": a.intensity_forecast | float }] -%}
{%- endfor -%} {{ ns.list }}
```
```

## octopus_energy.boost_heat_pump_zone

Allows you to boost a given heat pump zone for a set amount of time.

| Attribute | Optional | Description |
| ------------------------ | -------- | --------------------------------------------------------------------------------------------------------------------- |
| `target.entity_id` | `no` | The name of the heat pump zone boost mode should be applied to (e.g. `climate.octopus_energy_heat_pump_{{HEAT_PUMP_ID}}_{{ZONE_CODE}}`). |
| `data.hours` | `no` | The number of hours to turn boost mode on for. This can be between 0 and 12. |
| `data.minutes` | `no` | The number of minutes to turn boost mode on for. This can be 0, 15, or 45. |
| `data.target_temperature` | `yes` | The optional target temperature to boost to. If not supplied, then the current target temperature will be used. |


## octopus_energy.set_heat_pump_flow_temp_config

Allows you to set the heat pump configuration for fixed and weather compensated flow temperatures, with the option to select which is active.

!!! warning
Changing this configuration without a good understanding of heat loss and emitter output can cause cycling, defrosting, or incorrect heat delivery.

| Attribute | Optional | Description |
| ------------------------ | -------- | --------------------------------------------------------------------------------------------------------------------- |
| `target.entity_id` | `no` | Any climate entity belonging to the heat pump which the configuration should be applied to (e.g. `climate.octopus_energy_heat_pump_{{HEAT_PUMP_ID}}_{{ZONE_CODE}}`). |
| `data.weather_comp_enabled` | `no` | Switches weather compensation on or off. |
| `data.weather_comp_min_temperature` | `no` | Minimum allowable temperature for weather compensation, typically no lower than 30. |
| `data.weather_comp_max_temperature` | `no` | Maximum allowable temperature for weather compensation, typically no higher than 70. |
| `data.fixed_flow_temperature` | `no` | If a fixed flow temperature is enabled this value will be used, typically between 30 and 70. |
Loading
Loading