Automation to turn socket on/off with Octopus Agile pricing

Hello!

Please help, I feel like this should be easy and I’m missing something.

But I want a socket to turn off when the price is above a certain amount but turn on the rest of the time.

I have tried, and came up with this-

I’ve created this in Template;

sensor:
  - platform: template
    sensors:
      octopus_current_rate_pence:
        friendly_name: "Octopus Current Rate in Pence"
        unit_of_measurement: "p/kWh"
        value_template: "{{ (states('sensor.octopus_energy_electricity_22m0253###_2341763759###_current_rate') | float * 100) | round(2) }}"

And in Automations I have this YAML-

alias: Turn on Dehumidifier with Dual Pricing Structure
description: Turn on if price drops below 14p (00:00-08:00) or below 11p (08:00-00:00)
trigger:
  - platform: time_pattern
    minutes: /3
condition:
  - condition: or
    conditions:
      - condition: and
        conditions:
          - condition: time
            after: "00:00:00"
            before: "08:00:00"
          - condition: numeric_state
            entity_id: sensor.octopus_current_rate
            below: 16
      - condition: and
        conditions:
          - condition: time
            after: "08:00:00"
            before: "00:00:00"
          - condition: numeric_state
            entity_id: sensor.octopus_current_rate
            below: 11
action:
  - type: turn_on
    device_id: <MY DEVICE ID
    entity_id: <MY ENTITY ID>
    domain: switch
mode: single

I’ve tried following some other example and really confused about the entities & attributes.
e.g. should I really just be using;
“sensor.octopus_energy_electricity_22m0253###_2341763759###_current_rate” instead?

Because unless I’m reading it wrong this doesn’t actually show the current rate in the attributes?

state_class: total
mpan: 2341763759###
serial_number: 22M0253###
is_export: false
is_smart_meter: true
tariff: E-1R-AGILE-FLEX-22-11-25-M
start: 2024-01-27T17:00:00+00:00
end: 2024-01-27T18:00:00+00:00
is_capped: false
is_intelligent_adjusted: false
current_day_min_rate: 0.0924
current_day_max_rate: 0.31668
current_day_average_rate: 0.145064
data_last_retrieved: 2024-01-27T17:00:23.100668+00:00
last_evaluated: 2024-01-27T17:04:23.099450+00:00
unit_of_measurement: GBP/kWh
device_class: monetary
icon: mdi:currency-gbp
friendly_name: Octopus Agile current rate"

Thanks in advance!!