Start EV Charger When Electricity Rate Is Below Specified Rate

Hi

I’m trying to create an automation where my EV Charger Unlocks When Octopus Agile Electricity Tariff drops below a specified rate of 10p (Octopus Agile rate changes every 30 mins btw). Home Assistant can see my Octopus Agile rates and it can see my EV charger.

I also have a second automation, akin to the above, but to lock my EV charger when Octopus Agile rates are above 11p.

Neither of automations ever trigger automatically though, so I’m not sure what I’m doing wrong. Can anyone help please?

alias: EV Agile Unlock Charger Test
description: ""
trigger:
  - platform: numeric_state
    entity_id: sensor.octopus_energy_electricity_MYSERIALNUMBER_current_rate
    below: 0.1
condition: []
action:
  - service: switch.turn_off
    data: {}
    target:
      entity_id: switch.hypervolt_lock_state
mode: single
alias: EV Agile Lock Charger Test
description: ""
trigger:
  - platform: numeric_state
    entity_id: sensor.octopus_energy_electricity_MYSERIALNUMBER_current_rate
    above: 0.11
condition: []
action:
  - service: switch.turn_on
    data: {}
    target:
      entity_id: switch.hypervolt_lock_state
mode: single

Have you checked the ^^ sensor in developer tools to make sure it is giving you an integer and not something else?

Your automation looks identical to mine, but I recall having a problem and using a template to get it to a raw number.
I am on mobile at the moment so do not have access to the raw code, but the template isn’t very complex and also puts the number tontwondigits without interfering with the original integration.

Actually I posted about this before.

I’m not sure what you mean sorry? I’m still learning Home Assistant

Thanks for sharing link. I did reply to you in that thread with a query, but think you missed my query.

Have you managed to get this automation to work?

Sadly not sorry.