Home Assistant: Automation doesn't run Rest service automatically

Hello all, I’ve been trying to solve a problem for a few days. My automation doesn’t start a rest service automatically but I can launch it manually.

Sensor :

 
# Templates Sensors
template:
  - sensor:
      - name: "Heater Remote Control"
        state: >
          {% if states("sensor.thermometre_sdb") | float < 25.0 %}
            True
          {% else %}
            False
          {% endif %}

Rest Command :

# Commande REST pour contrôle des Switchbot devices
rest_command:
  switchbot_batchroom_heater_remote_control:
    url: !secret switchbot_hub_remote_heater_url
    method: POST
    headers:
      authorization: !secret switchbot_api_key
      accept: "application/json, text/html"
      user-agent: "Mozilla/5.0 {{ useragent }}"
    payload: '{"command": "Power","parameter": "default","commandType": "customize"}'
    content_type: "application/json; charset=utf-8"
    verify_ssl: true
type or paste code here

Automation :

- id: set_heater_on
  alias: Set Heater On
  trigger:
  - platform: state
    entity_id: automation.set_heater_on
    to: 'True'
  condition: []
  action:
  - service: rest_command.switchbot_batchroom_heater_remote_control
  mode: single

Can you help me please ?

Thanks

What should be the trigger of your automation?
The automation itself?

Sorry, it was an inadvertent mistake to copy/paste.

Here is the updated code :

- id: set_heater_on
  alias: Set Heater On
  trigger:
  - platform: state
    entity_id: sensor.heater_remote_control
    to: 'True'
  condition: []
  action:
  - service: rest_command.switchbot_batchroom_heater_remote_control
  mode: single

check in the developer tools if the state of the sensor is true or True. it is case sensetive

template:
  - sensor:
      - name: "Heater Remote Control"
        state: >
          {% if states("sensor.thermometre_sdb") | float < 25.0 %}
            True
          {% else %}
            False
          {% endif %}

I fix the status at True in the template. See that :

can you see the trace of the automation when the state of the sensor changes to “True”
the code looks fine.

OK, if the state of sensor changes to “True”, it’s work.

But in my case, the condition is ok at the starting of Home assistant and it’s doesn’t work at all

What do you want to achieve?
Your automation will on start when the state of your sensor is changing to True