Skip to content

Commit 073e05f

Browse files
Next release (#1222)
2 parents b841919 + 5196b23 commit 073e05f

File tree

12 files changed

+408
-86
lines changed

12 files changed

+408
-86
lines changed

.cz-config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ module.exports = {
4545
confirmCommit: 'Are you sure you want to proceed with the commit above?',
4646
},
4747

48-
allowCustomScopes: false,
48+
allowCustomScopes: true,
4949
allowBreakingChanges: ['feat', 'fix'],
5050
// skip any questions you want
5151
skipQuestions: ['body'],

_docs/blueprints/octopus_energy_octoplus_join_saving_session.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,28 @@ blueprint:
1414
- event
1515
integration: octopus_energy
1616
multiple: false
17+
minimum_awarded_points:
18+
name: Minimum awarded points
19+
description: The minimum number of points that should be awarded by the event per kWh in order to join the event
20+
default: 0
21+
selector:
22+
number:
23+
mode: box
24+
step: 1.0
1725
mode: single
1826
variables:
1927
saving_session_event_entity: !input saving_session_event_entity
28+
minimum_awarded_points: !input minimum_awarded_points
2029
trigger:
2130
- platform: state
2231
entity_id: !input saving_session_event_entity
2332
condition:
2433
- condition: template
2534
value_template: "{{ state_attr(saving_session_event_entity, 'available_events') != None and state_attr(saving_session_event_entity, 'available_events') | length > 0 }}"
35+
- condition: template
36+
value_template: >
37+
{% set available_events = state_attr(saving_session_event_entity, 'available_events') %}
38+
{{ available_events != None and available_events | length > 0 and available_events[0]['octopoints_per_kwh'] >= minimum_awarded_points }}
2639
action:
2740
- service: octopus_energy.join_octoplus_saving_session_event
2841
data:

_docs/blueprints/octopus_energy_octoplus_join_saving_session_custom_action.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,18 @@ blueprint:
1919
description: Notifications or similar to be run. {{message}} is an example message
2020
selector:
2121
action: {}
22+
minimum_awarded_points:
23+
name: Minimum awarded points
24+
description: The minimum number of points that should be awarded by the event per kWh in order to join the event
25+
default: 0
26+
selector:
27+
number:
28+
mode: box
29+
step: 1.0
2230
mode: single
2331
variables:
2432
saving_session_event_entity: !input saving_session_event_entity
33+
minimum_awarded_points: !input minimum_awarded_points
2534
message: >
2635
{% if state_attr(saving_session_event_entity, 'available_events') != None and state_attr(saving_session_event_entity, 'available_events') | length > 0 %}
2736
{% set event = state_attr(saving_session_event_entity, 'available_events')[0] %}
@@ -34,6 +43,10 @@ trigger:
3443
condition:
3544
- condition: template
3645
value_template: "{{ state_attr(saving_session_event_entity, 'available_events') != None and state_attr(saving_session_event_entity, 'available_events') | length > 0 }}"
46+
- condition: template
47+
value_template: >
48+
{% set available_events = state_attr(saving_session_event_entity, 'available_events') %}
49+
{{ available_events != None and available_events | length > 0 and available_events[0]['octopoints_per_kwh'] >= minimum_awarded_points }}
3750
action:
3851
- service: octopus_energy.join_octoplus_saving_session_event
3952
data:

_docs/events.md

Lines changed: 34 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
The following events are raised by the integration. These events power various entities and can also be used within automations.
44

5-
## Electricity Current Day Rates
5+
## Rates
6+
7+
### Electricity Current Day Rates
68

79
`octopus_energy_electricity_current_day_rates`
810

@@ -18,7 +20,7 @@ This is fired when the current day rates are updated.
1820
| `max_rate` | `float` | The maximum/highest rate in the discovered rates collection |
1921
| `average_rate` | `float` | The average rate in the discovered rates collection |
2022

21-
### Automation Example
23+
#### Automation Example
2224

2325
```yaml
2426
- trigger:
@@ -33,7 +35,7 @@ This is fired when the current day rates are updated.
3335
New rates available for {{ trigger.event.data.mpan }}. Starting value is {{ trigger.event.data.rates[0]["value_inc_vat"] }}
3436
```
3537
36-
## Electricity Previous Day Rates
38+
### Electricity Previous Day Rates
3739
3840
`octopus_energy_electricity_previous_day_rates`
3941

@@ -49,7 +51,7 @@ This is fired when the previous day rates are updated.
4951
| `max_rate` | `float` | The maximum/highest rate in the discovered rates collection |
5052
| `average_rate` | `float` | The average rate in the discovered rates collection |
5153

52-
### Automation Example
54+
#### Automation Example
5355

5456
```yaml
5557
- trigger:
@@ -64,7 +66,7 @@ This is fired when the previous day rates are updated.
6466
New rates available for {{ trigger.event.data.mpan }}. Starting value is {{ trigger.event.data.rates[0]["value_inc_vat"] }}
6567
```
6668

67-
## Electricity Next Day Rates
69+
### Electricity Next Day Rates
6870

6971
`octopus_energy_electricity_next_day_rates`
7072

@@ -80,7 +82,7 @@ This is fired when the next day rates are updated.
8082
| `max_rate` | `float` | The maximum/highest rate in the discovered rates collection |
8183
| `average_rate` | `float` | The average rate in the discovered rates collection |
8284

83-
### Automation Example
85+
#### Automation Example
8486

8587
```yaml
8688
- trigger:
@@ -95,7 +97,7 @@ This is fired when the next day rates are updated.
9597
New rates available for {{ trigger.event.data.mpan }}. Starting value is {{ trigger.event.data.rates[0]["value_inc_vat"] }}
9698
```
9799

98-
## Electricity Previous Consumption Rates
100+
### Electricity Previous Consumption Rates
99101

100102
`octopus_energy_electricity_previous_consumption_rates`
101103

@@ -111,7 +113,7 @@ This is fired when the [previous consumption's](./entities/electricity.md#previo
111113
| `max_rate` | `float` | The maximum/highest rate in the discovered rates collection |
112114
| `average_rate` | `float` | The average rate in the discovered rates collection |
113115

114-
### Automation Example
116+
#### Automation Example
115117

116118
```yaml
117119
- trigger:
@@ -126,7 +128,7 @@ This is fired when the [previous consumption's](./entities/electricity.md#previo
126128
New rates available for {{ trigger.event.data.mpan }}. Starting value is {{ trigger.event.data.rates[0]["value_inc_vat"] }}
127129
```
128130

129-
## Gas Current Day Rates
131+
### Gas Current Day Rates
130132

131133
`octopus_energy_gas_current_day_rates`
132134

@@ -142,7 +144,7 @@ This is fired when the current day rates are updated.
142144
| `max_rate` | `float` | The maximum/highest rate in the discovered rates collection |
143145
| `average_rate` | `float` | The average rate in the discovered rates collection |
144146

145-
### Automation Example
147+
#### Automation Example
146148

147149
```yaml
148150
- trigger:
@@ -157,7 +159,7 @@ This is fired when the current day rates are updated.
157159
New rates available for {{ trigger.event.data.mprn }}. Starting value is {{ trigger.event.data.rates[0]["value_inc_vat"] }}
158160
```
159161

160-
## Gas Previous Day Rates
162+
### Gas Previous Day Rates
161163

162164
`octopus_energy_gas_previous_day_rates`
163165

@@ -173,7 +175,7 @@ This is fired when the previous day rates are updated.
173175
| `max_rate` | `float` | The maximum/highest rate in the discovered rates collection |
174176
| `average_rate` | `float` | The average rate in the discovered rates collection |
175177

176-
### Automation Example
178+
#### Automation Example
177179

178180
```yaml
179181
- trigger:
@@ -188,7 +190,7 @@ This is fired when the previous day rates are updated.
188190
New rates available for {{ trigger.event.data.mprn }}. Starting value is {{ trigger.event.data.rates[0]["value_inc_vat"] }}
189191
```
190192

191-
## Gas Next Day Rates
193+
### Gas Next Day Rates
192194

193195
`octopus_energy_gas_next_day_rates`
194196

@@ -204,7 +206,7 @@ This is fired when the next day rates are updated.
204206
| `max_rate` | `float` | The maximum/highest rate in the discovered rates collection |
205207
| `average_rate` | `float` | The average rate in the discovered rates collection |
206208

207-
### Automation Example
209+
#### Automation Example
208210

209211
```yaml
210212
- trigger:
@@ -219,7 +221,7 @@ This is fired when the next day rates are updated.
219221
New rates available for {{ trigger.event.data.mprn }}. Starting value is {{ trigger.event.data.rates[0]["value_inc_vat"] }}
220222
```
221223

222-
## Gas Previous Consumption Rates
224+
### Gas Previous Consumption Rates
223225

224226
`octopus_energy_gas_previous_consumption_rates`
225227

@@ -235,7 +237,7 @@ This is fired when the [previous consumption's](./entities/gas.md#previous-accum
235237
| `max_rate` | `float` | The maximum/highest rate in the discovered rates collection |
236238
| `average_rate` | `float` | The average rate in the discovered rates collection |
237239

238-
### Automation Example
240+
#### Automation Example
239241

240242
```yaml
241243
- trigger:
@@ -250,7 +252,9 @@ This is fired when the [previous consumption's](./entities/gas.md#previous-accum
250252
New rates available for {{ trigger.event.data.mprn }}. Starting value is {{ trigger.event.data.rates[0]["value_inc_vat"] }}
251253
```
252254

253-
## New Saving Session
255+
## Octoplus
256+
257+
### New Saving Session
254258

255259
`octopus_energy_new_octoplus_saving_session`
256260

@@ -266,7 +270,7 @@ This event is raised when a new saving session is discovered.
266270
| `event_duration_in_minutes` | `integer` | The duration of the event in minutes |
267271
| `event_octopoints_per_kwh` | `integer` | The number of octopoints that are awarded per kwh saved during the event |
268272

269-
### Automation Example
273+
#### Automation Example
270274

271275
```yaml
272276
- trigger:
@@ -281,7 +285,7 @@ This event is raised when a new saving session is discovered.
281285
New Octopus Energy saving session available. It starts at {{ trigger.event.data["event_start"].strftime('%H:%M') }} on {{ trigger.event.data["event_start"].day }}/{{ trigger.event.data["event_start"].month }} for {{ trigger.event.data["event_duration_in_minutes"] | int }} minutes.
282286
```
283287

284-
## All Saving Sessions
288+
### All Saving Sessions
285289

286290
`octopus_energy_all_octoplus_saving_sessions`
287291

@@ -315,7 +319,7 @@ Each joined event item will include the following attributes
315319
| `octopoints_per_kwh` | `integer` | The number of octopoints that are awarded per kwh saved during the event |
316320
| `rewarded_octopoints` | `integer` | The total number of octopoints that were awarded (if any or known) |
317321

318-
### Automation Example
322+
#### Automation Example
319323

320324
```yaml
321325
- trigger:
@@ -330,7 +334,7 @@ Each joined event item will include the following attributes
330334
Saving session events updated. The latest joined event awarded {{ trigger.event.data.joined_events[0]["rewarded_octopoints"] }}
331335
```
332336

333-
## New Free Electricity Session
337+
### New Free Electricity Session
334338

335339
`octopus_energy_new_octoplus_free_electricity_session`
336340

@@ -344,7 +348,7 @@ This event is raised when a new free electricity session is discovered.
344348
| `event_end` | `datetime` | The date/time the event ends |
345349
| `event_duration_in_minutes` | `integer` | The duration of the event in minutes |
346350

347-
### Automation Example
351+
#### Automation Example
348352

349353
```yaml
350354
- trigger:
@@ -359,7 +363,7 @@ This event is raised when a new free electricity session is discovered.
359363
New Octopus Energy free electricity session available. It starts at {{ trigger.event.data["event_start"].strftime('%H:%M') }} on {{ trigger.event.data["event_start"].day }}/{{ trigger.event.data["event_start"].month }} for {{ trigger.event.data["event_duration_in_minutes"] | int }} minutes.
360364
```
361365

362-
## All Free Electricity Sessions
366+
### All Free Electricity Sessions
363367

364368
`octopus_energy_all_octoplus_free_electricity_sessions`
365369

@@ -379,7 +383,7 @@ Each event item will include the following attributes
379383
| `end` | `datetime` | The date/time the event starts |
380384
| `duration_in_minutes` | `integer` | The duration of the event in minutes |
381385

382-
### Automation Example
386+
#### Automation Example
383387

384388
```yaml
385389
- trigger:
@@ -394,7 +398,9 @@ Each event item will include the following attributes
394398
Free electricity session events updated. The latest event is at {{ trigger.event.data.events[-1]["start"] }}
395399
```
396400

397-
## Electricity Previous Consumption Tariff Comparison Rates
401+
## Tariff Comparisons
402+
403+
### Electricity Previous Consumption Tariff Comparison Rates
398404

399405
`octopus_energy_elec_previous_consumption_tariff_comparison_rates`
400406

@@ -408,7 +414,7 @@ This is fired when the [tariff comparison](./setup/tariff_comparison.md) rates a
408414
| `mprn` | `string` | The mprn of the meter associated with these rates |
409415
| `serial_number` | `string` | The serial number of the meter associated with these rates |
410416

411-
### Automation Example
417+
#### Automation Example
412418

413419
```yaml
414420
- trigger:
@@ -423,7 +429,7 @@ This is fired when the [tariff comparison](./setup/tariff_comparison.md) rates a
423429
New rates available for {{ trigger.event.data.mprn }}. Starting value is {{ trigger.event.data.rates[0]["value_inc_vat"] }}
424430
```
425431

426-
## Gas Previous Consumption Tariff Comparison Rates
432+
### Gas Previous Consumption Tariff Comparison Rates
427433

428434
`octopus_energy_gas_previous_consumption_tariff_comparison_rates`
429435

@@ -437,7 +443,7 @@ This is fired when the [tariff comparison](./setup/tariff_comparison.md) rates a
437443
| `mprn` | `string` | The mprn of the meter associated with these rates |
438444
| `serial_number` | `string` | The serial number of the meter associated with these rates |
439445

440-
### Automation Example
446+
#### Automation Example
441447

442448
```yaml
443449
- trigger:

_docs/services.md

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -292,7 +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
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).
296296

297297
!!! warn
298298

@@ -302,20 +302,22 @@ The below example is how you might refresh the dispatches when you car is plugge
302302
mode: single
303303
alias: Refresh intelligent dispatches
304304
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"
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
311311
conditions:
312-
- condition: state
313-
entity_id: binary_sensor.car_is_plugged_in
314-
state: 'on'
312+
- condition: state
313+
entity_id: binary_sensor.car_is_plugged_in
314+
state: on
315315
actions:
316-
- action: octopus_energy.refresh_intelligent_dispatches
317-
target:
318-
entity_id: binary_sensor.octopus_energy_{{ACCOUNT_ID}}_intelligent_dispatching
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
319321
```
320322

321323
## Miscellaneous
@@ -363,4 +365,4 @@ This automation adds weightings based on the national grids carbon intensity, as
363365
{% set ns = namespace(list = []) %} {%- for a in forecast -%}
364366
{%- 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 }] -%}
365367
{%- endfor -%} {{ ns.list }}
366-
```
368+
```

_docs/setup/tariff_comparison.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,19 @@ The tariff comparison allows you to elect a new tariff which will generate some
66

77
After you've configured your [account](./account.md), you'll be able to configure tariff comparison sensors. These are configured by adding subsequent instances of the integration going through the [normal flow](https://my.home-assistant.io/redirect/config_flow_start/?domain=octopus_energy), and selecting `Tariff Comparison` in the provided menu.
88

9+
!!! note
10+
11+
This will only look and provide data inline with previous consumption data. There are no plans to provide data for any other time frame (e.g. "today"). This is for two reasons.
12+
13+
1. I personally don't see the point of tracking this information against the current consumption as the value of the data will be larger in scope to just today (e.g. you're probably not going to switch tariffs because this morning is cheaper on another tariff) and while a tariff might be cheaper at one point during the day, it might be more expensive at another point. The value, to me, is in the historic trend of the data and knowing this a few hours early isn't going to save much.
14+
15+
2. I only want the integration to retrieve data that is required for functionality to stay in the good books with OE
16+
917
!!! info
1018

1119
When updating the tariff depending on what previous consumption data is available, it can take up to 24 hours to update the cost. This will be improved in the future.
1220

21+
1322
## Setup
1423

1524
### Meter

0 commit comments

Comments
 (0)