New MQTT Sensor

I need to add a new MQTT Sensor.

But it´s always giving me an error!!
I followed the fixtse_com tutorial.
But now I have this error!

Detalhes do log (ERRO)

Logger: homeassistant.setup
Source: setup.py:221
First occurred: 13:45:46 (1 occurrences)
Last logged: 13:45:46

Setup failed for ‘command_line’: Invalid config.

Detalhes do log (ERRO)

Logger: homeassistant.config
Source: config.py:1195
First occurred: 13:45:46 (1 occurrences)
Last logged: 13:45:46

Invalid config for ‘command_line’ at configuration.yaml, line 25: ‘platform’ is an invalid option for ‘command_line’, check: command_line->1->platform, please check the docs at

My Config file is below

# Loads default set of integrations. Do not remove.
default_config:

# Load frontend themes from the themes folder
frontend:
  themes: !include_dir_merge_named themes

# Text to speech
tts:
  - platform: google_translate

automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml

command_line:
  - sensor:
      name: CPU Temp
      command: 'cat /sys/class/thermal/thermal_zone0/temp'
      unit_of_measurement: '°C'
      value_template: '{{ value | multiply(0.001) }}'

        #new sensor
  - platform: mqtt_room
    device_id: "iBeacon:123"
    name: 'S21U'
    state_topic: 'espresense/devices/iBeacon:123'
    timeout: 10
    away_timeout: 20

light:
  - platform: rpi_gpio_pwm
    leds:
      - name: RPI Cooling Fan
        pin: 14

Please learn to format your code.

Just by looking at your unformatted code, I can tell you put the sensor in the wrong area.

it should be

mqtt:
  sensor:
  - name: ...

And the nomenclature - platform: mqtt should not be present.

Also, it looks like you made up a platform. mqtt_room seems to be something you made up.

1 Like

My latest attempt is looking something like this, but I still have the error!

command_line:
  sensor:
    - platform: CPU_Temp 
      name: CPU Temp
      command: 'cat /sys/class/thermal/thermal_zone0/temp'
      unit_of_measurement: '°C'
      value_template: '{{ value | multiply(0.001) }}'
      
    - platform: mqtt_room
      device_id: "iBeacon:123"
      name: 'S21U'
      state_topic: 'espresense/devices/iBeacon:123'
      timeout: 10
      away_timeout: 20
light:
  - platform: rpi_gpio_pwm
    leds:
      - name: RPI Cooling Fan
        pin: 14

From my understanding the -platform is a grouping
But this is my fisrt atemp at YAML!

My errors are
As following:

Setup failed for 'command_line': Invalid config.

19:10:20 – (ERRO) setup.py

Invalid config for 'command_line' at configuration.yaml, line 17: 
expected a dictionary for dictionary value 'command_line->0->sensor',
got None, please check the docs at...

19:10:20 – (ERRO) config.py

Any suggestions?