Skip to content

Commit f58c4c6

Browse files
Next release (#1252)
2 parents a8cde44 + 964867e commit f58c4c6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+1632
-363
lines changed

.github/ISSUE_TEMPLATE/unknown_intelligent_provider.yml

Lines changed: 35 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,45 @@ labels: ["enhancement"]
44
assignees:
55
- BottlecapDave
66
body:
7-
- type: textarea
7+
- type: input
88
id: provider
99
attributes:
1010
label: Provider name
1111
description: Please provide the name of the provider as presented in the raised repair notice
1212
validations:
1313
required: true
14-
- type: checkboxes
15-
id: features
14+
- type: textarea
15+
id: bump_charge
16+
attributes:
17+
label: Ability to bump charge
18+
description: Please provide a screenshot of the feature within the app or type "Not available"
19+
validations:
20+
required: true
21+
- type: textarea
22+
id: target_charge
23+
attributes:
24+
label: Ability to set the charge limit/target
25+
description: Please provide a screenshot of the feature within the app or type "Not available"
26+
validations:
27+
required: true
28+
- type: textarea
29+
id: target_time
30+
attributes:
31+
label: Ability to set the time the charge will be at its target for
32+
description: Please provide a screenshot of the feature within the app or type "Not available"
33+
validations:
34+
required: true
35+
- type: textarea
36+
id: smart_charge
37+
attributes:
38+
label: Ability to turn smart charge on/off
39+
description: Please provide a screenshot of the feature within the app or type "Not available"
40+
validations:
41+
required: true
42+
- type: textarea
43+
id: planned_dispatches
1644
attributes:
17-
label: Features
18-
description: Please specify the features that are available within the Octopus Energy app for your provider
19-
options:
20-
- label: Ability to bump charge
21-
- label: Ability to set the charge limit/target
22-
- label: Ability to set the time the charge will be at its target for
23-
- label: Ability to turn smart charge on/off
24-
- label: Ability to see planned dispatches
45+
label: Ability to see planned dispatches
46+
description: Please provide a screenshot of the feature within the app or type "Not available"
47+
validations:
48+
required: true

.github/workflows/issues.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,15 @@ name: Close inactive issues
22
on:
33
schedule:
44
- cron: "30 1 * * *"
5+
workflow_dispatch:
56
jobs:
67
close-issues:
78
if: ${{ github.repository_owner == 'BottlecapDave' }}
89
runs-on: ubuntu-latest
910
permissions:
1011
issues: write
1112
pull-requests: write
13+
discussions: write
1214
steps:
1315
- uses: actions/stale@v9
1416
with:
@@ -21,3 +23,10 @@ jobs:
2123
days-before-pr-close: -1
2224
exempt-issue-labels: enhancement
2325
repo-token: ${{ secrets.GITHUB_TOKEN }}
26+
- uses: dessant/lock-threads@v5
27+
with:
28+
issue-inactive-days: '30'
29+
issue-comment: 'This issue has been automatically locked due to inactivity for more than 30 days. This is to reduce noise for original parties. Please open a new issue for related bugs.'
30+
pr-inactive-days: '30'
31+
discussion-inactive-days: '30'
32+
log-output: true

_docs/blueprints.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,18 @@ This blueprint will fire a configured action when the consumption for the curren
7070

7171
This blueprint requires sensors provided by Octopus Energy Home Mini
7272

73+
## Intelligent
74+
75+
## Manual Intelligent Dispatch Refreshes
76+
77+
[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_manual_intelligent_refresh.yaml) | [Source](./blueprints/octopus_energy_manual_intelligent_refresh.yaml)
78+
79+
This blueprint will fire the [intelligent dispatches service](./services.md#octopus_energyrefresh_intelligent_dispatches) either when a sensor from another integration determines the car has been plugged in (e.g. the plug status from the [MyEnergi integration](https://github.com/CJNE/ha-myenergi)) or when the data is stale and overdue a refresh (in case the dispatch information has changed).
80+
81+
!!! warning
82+
83+
This blueprint requires you to be on an intelligent tariff and a way to determine that your car is plugged in from another integration.
84+
7385
## Wheel of Fortune
7486

7587
### Automatically spin wheel of fortune (single)
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
blueprint:
2+
name: Octopus Energy - Manual Intelligent Refresh
3+
description: Handle the refresh of intelligent dispatches automatically, while refreshing when an external car sensor is plugged in. When automatic, will use normal backoff methods in event of failure.
4+
domain: automation
5+
author: BottlecapDave
6+
7+
input:
8+
intelligent_dispatches_data_last_retrieved_sensor:
9+
name: Intelligent dispatches data last retrieved
10+
description: "The sensor that determines when intelligent dispatches data was last retrieved (e.g. sensor.octopus_energy_{{ACCOUNT_ID}}_intelligent_dispatches_data_last_retrieved). More information can be found at https://bottlecapdave.github.io/HomeAssistant-OctopusEnergy/entities/diagnostics/#intelligent-dispatches-data-last-retrieved"
11+
selector:
12+
entity:
13+
filter:
14+
domain: sensor
15+
integration: octopus_energy
16+
17+
intelligent_dispatches_sensor:
18+
name: Intelligent dispatches
19+
description: "The sensor that determines if intelligent dispatches is active (e.g. binary_sensor.octopus_energy_{{ACCOUNT_ID}}_intelligent_dispatching)"
20+
selector:
21+
entity:
22+
filter:
23+
domain: binary_sensor
24+
integration: octopus_energy
25+
26+
car_plugged_in_sensor:
27+
name: Car plugged in sensor (external)
28+
description: "The external sensor that determines if the car has been plugged in (e.g. binary_sensor.car_is_plugged_in). This sensor is provided by an integration outside of the Octopus Energy integration."
29+
selector:
30+
entity:
31+
filter:
32+
domain:
33+
- binary_sensor
34+
- sensor
35+
- input_boolean
36+
37+
car_plugged_in_sensor_state:
38+
name: Car plugged in sensor expected state
39+
description: "The expected state of the external sensor that determines if the car has been plugged in (e.g. 'on')."
40+
selector:
41+
text:
42+
43+
actions:
44+
name: Actions
45+
description: Additional actions to run after refresh
46+
default: []
47+
selector:
48+
action: {}
49+
50+
variables:
51+
intelligent_dispatches_sensor: !input intelligent_dispatches_sensor
52+
car_plugged_in_sensor: !input car_plugged_in_sensor
53+
54+
mode: queued
55+
max: 4
56+
trigger_variables:
57+
intelligent_dispatches_data_last_retrieved_sensor: !input intelligent_dispatches_data_last_retrieved_sensor
58+
triggers:
59+
- trigger: state
60+
entity_id: !input car_plugged_in_sensor
61+
to: !input car_plugged_in_sensor_state
62+
- trigger: template
63+
value_template: >
64+
{{ state_attr(intelligent_dispatches_data_last_retrieved_sensor, 'next_refresh') | as_datetime | as_local < now() }}
65+
conditions:
66+
- condition: state
67+
entity_id: !input car_plugged_in_sensor
68+
state: !input car_plugged_in_sensor_state
69+
actions:
70+
# Wait 30 seconds to give OE a chance to update the dispatches
71+
- delay: 00:00:30
72+
- action: octopus_energy.refresh_intelligent_dispatches
73+
target:
74+
entity_id: !input intelligent_dispatches_sensor
75+
- choose: []
76+
default: !input actions

_docs/entities/electricity.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,8 @@ If you are wishing to use these sensors with the Energy Dashboard, then you can
175175

176176
The total consumption reported by the meter (not other devices e.g. Home Mini) for the previous available full day. If for example data is available up to `01:00` of `2024-09-02`, then this sensor will report the cost between `2024-09-01T00:00:00Z` and `2024-09-02T00:00:00Z`.
177177

178+
Due to limitation of HA entities, the data will be updated as a single record, which means the history of the sensor will not be broken down further than once a day. If you want the cost broken down into hourly chunks, you can use the statistic entities used for the [energy dashboard](../setup/energy_dashboard.md#previous-day-consumption).
179+
178180
!!! info
179181

180182
This retrieves the data reported directly by the meter which is used to calculate your bill. If you have an Octopus Home Mini (or similar), then data reported by this device will not be exposed in this sensor. This is to avoid confusion when comparing the data against your bill and to provide consistency between users with and without an Octopus Home Mini.
@@ -259,7 +261,9 @@ The total consumption reported by the meter for the previous available full day
259261

260262
`sensor.octopus_energy_electricity_{{METER_SERIAL_NUMBER}}_{{MPAN_NUMBER}}_previous_accumulative_cost`
261263

262-
The total cost for the previous available full day, including the standing charge. If for example data is available up to `01:00` of `2024-09-02`, then this sensor will report the cost between `2024-09-01T00:00:00Z` and `2024-09-02T00:00:00Z`.
264+
The total cost for the previous available full day, including the standing charge. If for example data is available up to `01:00` of `2024-09-02`, then this sensor will report the cost between `2024-09-01T00:00:00Z` and `2024-09-02T00:00:00Z`.
265+
266+
Due to limitation of HA entities, the data will be updated as a single record, which means the history of the sensor will not be broken down further than once a day. If you want the cost broken down into hourly chunks, you can use the statistic entities used for the [energy dashboard](../setup/energy_dashboard.md#previous-day-consumption).
263267

264268
!!! info
265269

_docs/entities/gas.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,8 @@ The total consumption reported by the meter for the previous available full day
163163

164164
If your meter reports in kwh, then this will be an accurate value reported by Octopus, otherwise it will be a calculated/estimated value.
165165

166+
Due to limitation of HA entities, the data will be updated as a single record, which means the history of the sensor will not be broken down further than once a day. If you want the cost broken down into hourly chunks, you can use the statistic entities used for the [energy dashboard](../setup/energy_dashboard.md#previous-day-consumption).
167+
166168
!!! info
167169

168170
This retrieves the data reported directly by the meter which is used to calculate your bill. If you have an Octopus Home Mini (or similar), then data reported by this device will not be exposed in this sensor. This is to avoid confusion when comparing the data against your bill and to provide consistency between users with and without an Octopus Home Mini.
@@ -197,7 +199,9 @@ Each charge item has the following attributes
197199

198200
`sensor.octopus_energy_gas_{{METER_SERIAL_NUMBER}}_{{MPRN_NUMBER}}_previous_accumulative_cost`
199201

200-
The total cost for the previous available full day, including the standing charge.
202+
The total cost for the previous available full day, including the standing charge. If for example data is available up to `01:00` of `2024-09-02`, then this sensor will report the cost between `2024-09-01T00:00:00Z` and `2024-09-02T00:00:00Z`.
203+
204+
Due to limitation of HA entities, the data will be updated as a single record, which means the history of the sensor will not be broken down further than once a day. If you want the cost broken down into hourly chunks, you can use the statistic entities used for the [energy dashboard](../setup/energy_dashboard.md#previous-day-consumption).
201205

202206
!!! info
203207

_docs/entities/intelligent.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ This sensor is used to determine if you're currently in a planned dispatch perio
3030
|-----------|------|-------------|
3131
| `planned_dispatches` | `array` | An array of the dispatches that are currently planned by Octopus Energy. |
3232
| `completed_dispatches` | `array` | An array of the dispatches that have been completed by Octopus Energy. This will only store up to the last 3 days worth of completed dispatches. |
33+
| `started_dispatches` | `array` | An array of the dispatches that have been planned by Octopus Energy and upon API refresh are still planned when the current 30 minute period started and is not in a boosting state. A planned dispatch will be added one 30 minute period at a time. This will only store up to the last 3 days worth of started dispatches. This is used to determine historic off peak rates. For example if you have a planned dispatch of `2025-04-01T10:00:00`-`2025-04-01T11:00:00`, at `2025-04-01T10:01:00` if the planned dispatch is still available the period of `2025-04-01T10:00:00`-`2025-04-01T10:30:00` will be added. |
3334
| `provider` | `string` | The provider of the intelligent features |
3435
| `vehicle_battery_size_in_kwh` | `float` | The size of the target vehicle battery in kWh. |
3536
| `charge_point_power_in_kw` | `float` | The power of the charge point battery in kW. |
@@ -45,9 +46,16 @@ Each item in `planned_dispatch` or `completed_dispatches` have the following att
4546
| `start` | `datetime` | The start date/time of the dispatch |
4647
| `end` | `datetime` | The end date/time of the dispatch |
4748
| `charge_in_kwh` | `float` | The amount to be charged within the dispatch period. |
48-
| `source` | `string` | Determines what has caused the dispatch to be generated. Will be `smart-charge` or `bump-charge`. |
49+
| `source` | `string` | Determines what has caused the dispatch to be generated. Will be `smart-charge`, `bump-charge` or None. |
4950
| `location` | `string` | The location of the smart charge |
5051

52+
Each item in `started_dispatch` have the following attributes
53+
54+
| Attribute | Type | Description |
55+
|-----------|------|-------------|
56+
| `start` | `datetime` | The start date/time of the dispatch |
57+
| `end` | `datetime` | The end date/time of the dispatch |
58+
5159
!!! info
5260

5361
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.

_docs/faq.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,12 @@ The first thing to do is make sure the correct tariff has been picked up. This c
176176

177177
If the correct tariff is present, it might be that you're on a tariff that has different rates depending on if you pay by direct debit or not. This can be configured via your [account configuration](./setup/account.md#favour-direct-debit-rates).
178178

179+
## How are costs sensors calculated?
180+
181+
Cost sensors are calculated by multiplying the consumption by the rate for each half hour block, which are then all added together.
182+
183+
Each half hour block has it's consumption rounded to the nearest 0.01kwh before multiplying by the rate, which is rounded to the nearest penny. The rounding method used is rounding half to even, where numbers ending in 5 are rounded up or down, towards the nearest even hundredth decimal place. As a result, 0.015 would be rounded up to 0.02, while 0.025 is rounded down to 0.02. This is based on [Octopus Energy API documentation](https://developer.octopus.energy/rest/guides/endpoints)
184+
179185
## Do you support older versions of the integration?
180186

181187
Due to time constraints, I will only ever support the latest version of the integration. If you have an issue with an older version of the integration, my initial answer will always be to update to the latest version. This might be different to what HACS is reporting if you are not on the minimum supported Home Assistant version (which is highlighted in each release's changelog).

_docs/repairs/no_active_tariff.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Repairs - No active tariff
2+
3+
If you receive this repair notice it means that no active tariff was found for one or more of your meters. There are a few reasons why this might be the case.
4+
5+
1. You are in the middle of switching tariffs. There can sometimes be a gap in your tariff information coming through when your existing tariff ends and your new tariff begins.
6+
2. You are new to OE and your tariff hasn't begun yet. Once your tariff starts, the integration will pick it up and should start working.
7+
3. There is a configuration issue with your account. In this scenario, you'll need to contact Octopus Energy support to get this rectified.
8+
9+
All of the above scenarios can be confirmed within your [diagnostic data](../faq.md#ive-been-asked-for-my-meter-information-in-a-bug-request-how-do-i-obtain-this). This will contain your account data including your meters. Under each of your meters, you'll have a list of tariff agreements. For each meter, you should have an agreement with a start date in the past and an end date either in the future or with no end date.

_docs/services.md

Lines changed: 9 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -292,33 +292,7 @@ Refreshes intelligent dispatches for a given account.
292292

293293
#### Automation Example
294294

295-
The below example is how you might refresh the dispatches when you car is plugged in, or every 3 minutes when your car is plugged in. Please note that the entity `binary_sensor.car_is_plugged_in` is not provided by the integration and should be replaced by an external source (e.g. the plug status from the [MyEnergi integration](https://github.com/CJNE/ha-myenergi) or a manual input switch that you switch on manually when you plug in your car).
296-
297-
!!! warn
298-
299-
There is a chance that the automation may fail due to the service call limit when the car is plugged in
300-
301-
```yaml
302-
mode: single
303-
alias: Refresh intelligent dispatches
304-
triggers:
305-
- trigger: state
306-
entity_id: binary_sensor.car_is_plugged_in
307-
to: on
308-
# Refresh every 3 minutes in case the schedule has changed
309-
- trigger: time_pattern
310-
minutes: /3
311-
conditions:
312-
- condition: state
313-
entity_id: binary_sensor.car_is_plugged_in
314-
state: on
315-
actions:
316-
# Wait 30 seconds to give OE a chance to update the dispatches
317-
- delay: 00:00:30
318-
- action: octopus_energy.refresh_intelligent_dispatches
319-
target:
320-
entity_id: binary_sensor.octopus_energy_{{ACCOUNT_ID}}_intelligent_dispatching
321-
```
295+
For an automation example, please refer to the available [blueprint](./blueprints.md#manual-intelligent-dispatch-refreshes).
322296

323297
## Miscellaneous
324298

@@ -335,6 +309,14 @@ This service is only available for the following sensors
335309
- `sensor.octopus_energy_electricity_{{METER_SERIAL_NUMBER}}_{{MPAN_NUMBER}}_previous_accumulative_consumption` (this will populate both consumption and cost)
336310
- `sensor.octopus_energy_gas_{{METER_SERIAL_NUMBER}}_{{MPRN_NUMBER}}_previous_accumulative_consumption_m3` (this will populate both consumption and cost for both m3 and kwh)
337311

312+
!!! information
313+
314+
Due to limitations with Home Assistant entities, this service will only refresh data for the associated statistic ids used for the recommended approach in the [energy dashboard](./setup/energy_dashboard.md#previous-day-consumption). This will not update the history of the entities themselves.
315+
316+
!!! warn
317+
318+
If you are on intelligent, the cost data will not be correct for charges outside of the normal off peak times. This is because this data isn't available.
319+
338320
### octopus_energy.register_rate_weightings
339321

340322
Allows you to configure weightings against rates at given times using factors external to the integration. These are applied when calculating [target rates](./setup/target_rate.md#external-rate-weightings) or [rolling target rates](./setup/rolling_target_rate.md#external-rate-weightings).

0 commit comments

Comments
 (0)