Automation TURN OFF the light if the temperature is above 27

Hi I’m new user and I’m looking for some help I wouldlike to TURN OFF lights for all my fish tanks when the temperature is above 29° FROM 11h to 20h30 because with the light on the temperature reached 32 °C and it’s to much

and I woudlike TURN it ON if the temperature is below 29°C

  • alias: Eteindre L’eclairage Du Grand Aquarium Si Sa Temperature Est Supérieure à 29° Entre 11h et 20h30
    initial_state: ‘off’
    condition:
    condition: and
    conditions:

    • condition: numeric_state
      entity_id: sensor.temperature_du_grand_aquarium
      below: 27
    • condition: time
      after: ‘11:00:00’
      before: ‘20:30:00’
      trigger:
    • platform: time
      minutes: ‘/1’
      seconds: 00
      action:
      service: switch.turn_off
      entity_id: switch.eclairage_du_grand_aquarium
  • alias: Rallumer L’eclairage Du Grand Aquarium Si Sa Temperature Est Inferieure à 27° Entre 11h et 20h30
    initial_state: ‘off’
    trigger:
    trigger: and
    triggers:

    • trigger:
      platform: time numeric_state
      entity_id: sensor.temperature_du_grand_aquarium
      below: 27
    • trigger: time
      platform: time
      after: ‘11:00:00’
      before: ‘20:30:00’
      action:
      service: switch.turn_on
      entity_id: switch.eclairage_du_grand_aquarium

But this configuration do not work.

Could someone help me please!

Can you edit your post and format it correctly - as detailed in the big blue box at the top. Automations, etc, need to be marked as preformatted with the </> button

can’t tell about the rest of your automation because of the format problem, but because you have the line

initial_state: 'off'

you are disabling this automation. You probably want to remove that line from your config and try it.