Invalid config for [mqtt]: required key not provided @ data ['mqtt'] ['light'][10]['command_topic']. Got None

All of a sudden my mqtt entities have stopped working; I haven’t changed any configuration for a long time

If I “check configuration” under Developer tools/YAML I get

Invalid config for [mqtt]: required key not provided @ data[‘mqtt’][‘light’][10][‘command_topic’]. Got None. (See /config/configuration.yaml, line 99

image

I haven’t changed anything in a long time and I haven’t updated anything recently; everything was working fine until last night

It’s complaining about the eleventh light ([10]). Please post code as correctly-formatted text not screenshots.

Ok, so these first two entities are the 9th and 10th lights;

    - name: "Bedroom2"
      state_topic: "shellies/shelly1-BCDDC27742AD/relay/0"
      command_topic: "shellies/shelly1-BCDDC27742AD/relay/0/command"
      payload_on: "on"
      payload_off: "off"
      retain: false  
    
    - name: "Bedroom3"
      state_topic: "shellies/shelly1-A4CF12F3E9D6/relay/0"
      command_topic: "shellies/shelly1-A4CF12F3E9D6/relay/0/command"
      payload_on: "on"
      payload_off: "off"
      retain: false


    - name: "Prism hello"
      state_topic: "prism/hello"
    - name: "Prism stato"
      state_topic: "prism/1/state"
      value_template: >
        {% set map = {
        '1': 'nessun veicolo connesso',
        '2': 'veicolo connesso, in attesa di ricaricare',
        '3': 'veicolo in carica',
        '4': 'carica in pausa'
         } %}
         {{ map[value] if value in map else 'error' }}
    - name: "Prism corrente"
      state_topic: "prism/1/amp"
      unit_of_measurement: 'mA'

I already solved this by adding

sensor:

between the 10th and 11th entity (which is not a light). What I don’t understand is why this hasn’t been a problem until now

It might have been a problem all a long, but the checks have not caught it.
The check code is being updated now and then, so the update could mean that it is suddenly caught.