Automation not firing for Tuya

Hello

I hope you are well. I have setup an automation. However it does not fire. If I run the task manually it does turn on my Tuya circuit breaker. Can anyone see why this is not firing. What have I missed?

`
alias: Turn on Eskom Grid Supply (No PV Supplied)
description: ‘’
trigger:

  • platform: state
    entity_id: sensor.emoncms_soc
    from: ‘10’
    to: ‘30’
    for:
    hours: 0
    minutes: 0
    seconds: 0
    milliseconds: 0
    condition:
  • condition: state
    entity_id: sensor.emoncms_pvwatts
    state: ‘0’
  • condition: time
    after: ‘20:00:00’
    before: ‘06:00:00’
    action:
  • type: turn_on
    device_id: 929a94bb8ca0625d393b0264a922e54e
    entity_id: switch.eskom_circuit_breaker_socket_1
    domain: switch
  • service: notify.notify
    data:
    message: Eskom Circuit Breaker has been turned on
    title: Eskom Circuit Breaker
    mode: single
    `

Please format the code so it’s readable with the code block button or three back tics.

But it requires the sensor to change from 10 to 30 in one step as you have it set up now.

Do you mean you want a range of 10-30?

Apologies. I will format the code next time. Yes I am looking for a range from 10 to 30.

Should I use a Numeric State rather?

Yes I believe that could work.
But is the intention that the action should trigger each state change between 10 and 30 or only once in that range?

This is my current automation. I hope I formatted the code correctly this time. I would like it to fire as soon as it drops below 30% of the battery. At 3am this morning it said that it fired. Yet no notification was sent and the electrical circuit was not turned on. I have now called the service instead hoping it will work.

alias: Turn on Eskom Grid Supply (No PV Supplied - Night)
description: ''
trigger:
  - platform: numeric_state
    entity_id: sensor.emoncms_soc
    above: '0'
    below: '30'
condition:
  - condition: time
    after: '20:00:00'
    before: '07:00:00'
action:
  - service: switch.turn_on
    target:
      device_id: 929a94bb8ca0625d393b0264a922e54e
  - service: notify.notify
    data:
      message: Eskom Circuit Breaker has been turned on
      title: Eskom Circuit Breaker
mode: single

What is sensor.emoncms_soc?