Weatherstation integration - help needed

Hello.

First off, Total beginner here, I followed a few guides to get my 433Mhz receiver to get the dataflow from my weatherstation and have successfully received the information in MQTT settings when listening to “rtl_433/#”

The configuration.yaml and mqtt.yaml are accepted by “http://www.yamllint.com/” but my home assistant states that it is invalid.

Invalid config for [mqtt]: [platform] is an invalid option for [mqtt]. Check: mqtt->mqtt->sensor->0->platform. (See /config/configuration.yaml, line 11)

my mqtt.yaml





discovery: true
discovery_prefix: homeassistant

sensor:
  - platform: mqtt
    device_class: temperature
    unit_of_measurement: '°F'
    name: "Cotech-Temp"
    state_topic: "rtl_433/Cotech-367959/43"
    force_update: true
    value_template: "{{ value_json.temperature_F }}"
    
  - platform: mqtt
    device_class: humidity
    unit_of_measurement: '%'
    name: "Cotech-Humidity"
    state_topic: "rtl_433/Cotech-367959/43"
    force_update: true
    value_template: "{{ value_json.humidity }}"
    
  - platform: mqtt
    device_class: light_lux
    unit_of_measurement: 'lux'
    name: "Cotech-Lux"
    state_topic: "rtl_433/Cotech-367959/43"
    force_update: true
    value_template: "{{ value_json.light_lux)*0.0079) | round(3) }}"
    
  - platform: mqtt
    device_class: uv
    unit_of_measurement: 'uv'
    name: "Cotech-uv"
    state_topic: "rtl_433/Cotech-367959/43"
    force_update: true
    value_template: "{{ value_json.uv }}"
    
  - platform: mqtt
    device_class: time
    unit_of_measurement: 'db'
    name: "Cotech-Time"
    state_topic: "rtl_433/Cotech-367959/43"
    force_update: true
    value_template: "{{ value_json.time }}"
    
  - platform: mqtt
    device_class: rain_mm
    unit_of_measurement: 'mm'
    name: "Cotech-rain"
    state_topic: "rtl_433/Cotech-367959/43"
    force_update: true
    value_template: "{{ value_json.rain.in }}"
    
  - platform: mqtt
    device_class: wind_avg_m_s
    unit_of_measurement: 'm/s'
    name: "Cotech-wind-avrage"
    state_topic: "rtl_433/Cotech-367959/43"
    force_update: true
    value_template: "{{ value_json.wind_avg_m_s)*2.237) | round(3)) }}"
    
  - platform: mqtt
    device_class: wind_max_m_s
    unit_of_measurement: 'm/s'
    name: "Cotech-wind-gust"
    state_topic: "rtl_433/Cotech-367959/43"
    force_update: true
    value_template: "{{ value_json.wind_max_m_s)*2.237) | round(3)) }}"
    
  - platform: mqtt
    device_class: wind_dir_deg
    unit_of_measurement: '°'
    name: "Cotech-wind-degt"
    state_topic: "rtl_433/Cotech-367959/43"
    force_update: true
    value_template: "{{ value_json.wind_dir_deg }}"

Can anyone help me figure out what i am doing wrong?

You’re mixing the old and new mqtt sensor configuration.
Remove the platform: mqtt lines and it should work.

Try:

sensor:
   - name: "Cotech-Temp"
     device_class: temperature
     unit_of_measurement: '°F'
     state_topic: "rtl_433/Cotech-367959/43"
     force_update: true
     value_template: "{{ value_json.temperature_F }}"

Ty for the help, but now I am getting a new invalid message.

Invalid config for [mqtt]: expected SensorDeviceClass or one of ‘apparent_power’, ‘aqi’, ‘battery’, ‘carbon_monoxide’, ‘carbon_dioxide’, ‘current’, ‘date’, ‘duration’, ‘energy’, ‘frequency’, ‘gas’, ‘humidity’, ‘illuminance’, ‘monetary’, ‘nitrogen_dioxide’, ‘nitrogen_monoxide’, ‘nitrous_oxide’, ‘ozone’, ‘pm1’, ‘pm10’, ‘pm25’, ‘power_factor’, ‘power’, ‘pressure’, ‘reactive_power’, ‘signal_strength’, ‘sulphur_dioxide’, ‘temperature’, ‘timestamp’, ‘volatile_organic_compounds’, ‘voltage’ for dictionary value @ data[‘mqtt’][‘sensor’][2][‘device_class’]. Got ‘uv’. (See /config/configuration.yaml, line 11).

I cant seem to make sens of what that error means?!

You see all possible device_classes in the error message.
Remove uv of one of your sensors and then check the others for valid classes.

Thank you again for the help, Cant use UV, and can’t use Time apperanly.

edit: timestamp works instead of just time

After removing them Config was valid.

Much appreciated