Need help to setup influxdb sensor

I try to configure influxdb sensor with follow code added to configuration.yaml :

sensor:  
  - platform: influxdb
    host: 192.168.1.90
    username: username
    password: pass
    queries:
      - name: Moisture
        value_template: '{{ (100 - float(value) / 11) | round(1)}}'
        unit_of_measurement: '%'
        group_function: last
        where: '"time" > 0'
        measurement: 'moisture'
        field: level
        database: plant
      - name: Threshold
        value_template: '{{ (100 - float(value) / 11) | round(1)}}'
        unit_of_measurement: '%'
        group_function: last
        where: '"time" > 0'
        measurement: 'moisture'
        field: threshold
        database: plant

and get this error :
Unable to prepare setup for platform influxdb.sensor
Unable to set up component.
Error during setup of component influxdb

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/setup.py", line 229, in _async_setup_component
    result = await task
  File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/influxdb/__init__.py", line 473, in setup
    conf = config[DOMAIN]
KeyError: 'influxdb'

influxdb is on other hardware on the same local network with home assistant raspberry pi.
i`m new on HA so thanks in advance for any help.