Raspberry Pi CPU Fan Automation

Hello, please help me, i can’t make this to work, I am very new to home assitant and i don’t understand a lot.
I copy paste the code but i get the next error:

Invalid config for [switch.command_line]: [name] is an invalid option for [switch.command_line]. Check: switch.command_line->name. (See ?, line ?).
Platform error switch.numeric_state - Integration 'numeric_state' not found.
Platform error switch.numeric_state - Integration 'numeric_state' not found.

this is the yaml config:

# Raspberry Pi Cooling Fan
switch:
  - platform: rpi_gpio
    ports:
      4: RPI Cooling Fan

  - platform: command_line
    name: CPU Temp
    command: "/bin/cat /sys/class/thermal/thermal_zone0/temp"
    unit_of_measurement: "°C"
    value_template: '{{ (value | int / 1000) | int }}'
  
  - alias: 'RPI Cooling Fan einschalten'
    trigger:
    platform: numeric_state
    entity_id: sensor.cpu_temp
    above: 55
    action:
      service: switch.turn_on
      entity_id: switch.rpi_cooling_fan

  - alias: 'Pi Lüfter ausschalten'
    trigger:
    platform: numeric_state
    entity_id: sensor.cpu_temp
    below: 36
    action:
      service: switch.turn_off
      entity_id: switch.rpi_cooling_fan