I have created a helper (Binary sensor) to check if the Octopus agile electric rate is cheaper than running the oil boiler. Then created an automation to turn then immersions on when it is.
This automation is duplicated with one difference so it can work in conjunction with another Automation that charges the solar batteries.
It triggers every time the Octopus Agile rate changes and checks some conditions.
The bit I don’t get is there is a condition to check the binary sensor is ‘detected’ that is met, then when the automation turns the immersions on I have placed a ‘wait for trigger’ to look for the binary sensor to be ‘clear’ but this part is shows in logs as ‘null’ and the automation ends immediately.
Does anyone know why?
alias: Immersion - Elec vs Oil per/kwh - TOU On
description: ""
trigger:
- platform: state
entity_id:
- sensor.octopus_energy_current_rate
attribute: applicable_rates
for:
hours: 0
minutes: 1
seconds: 0
condition:
- condition: state
entity_id: binary_sensor.import_vs_oil_cost_per_kwh_live_0_02p
state: "on"
- condition: state
entity_id: binary_sensor.octopus_energy_target_5hr_lowest_import
state: "on"
- condition: state
entity_id: binary_sensor.octopus_energy_target_octopus_twelve_hour_min_target
state: "on"
action:
- service: notify.mobile_app_dan_s_phone
data:
message: Immersion Trigger - TOU On - Start
- type: turn_on
device_id: cd47a113b5f9c4c423beff1afa3b7a54
entity_id: 2eca3ce8a3fdd572334cf1955ab618cf
domain: switch
- type: turn_on
device_id: d3bbfaa16c0893c7d1bd00f91d301a65
entity_id: 0dd48a897da98abde869b31cf6116ff4
domain: switch
- delay:
hours: 0
minutes: 0
seconds: 5
milliseconds: 0
- wait_for_trigger:
- platform: state
entity_id:
- binary_sensor.import_vs_oil_cost_per_kwh_live_0_02p
to: "off"
from: "on"
continue_on_timeout: false
timeout:
hours: 0
minutes: 0
seconds: 0
milliseconds: 0
- type: turn_off
device_id: cd47a113b5f9c4c423beff1afa3b7a54
entity_id: 2eca3ce8a3fdd572334cf1955ab618cf
domain: switch
- type: turn_off
device_id: d3bbfaa16c0893c7d1bd00f91d301a65
entity_id: 0dd48a897da98abde869b31cf6116ff4
domain: switch
- service: notify.mobile_app_dan_s_phone
data:
message: Immersion Trigger - TOU On - End
mode: single
trace:
stored_traces: 48