Can't find the right documentation

I am sorry to bother this community with my stupid question but I seem incapable of finding the right documentation to solve my problem. Here’s the situation:
I am still running HA OS 2022.5.4 because I make heavy use of the GPIO pins for temp sensors (DS18B20) en detection of rainsensors (open/close). GPIO support is depricated in 2022.6 and I don’t have the time yet to see the solution.
Yesterday I upgraded Visual Studio Code to the latest version because I thought this would be a harmless upgrade. Now VSC is complaining about some things in my config.yaml

sensor:
  - platform: mqtt
    name: WHR_intake
    state_topic: "testxcvb/WHR"
    value_template: "{{ value_json.intake }}"
    device_class: temperature
    unit_of_measurement: °C

VSC claims that this construction is legacy.
I guess that it has to be something like

mqtt:
  - platform sensor:
    sensors:
    - name: xyz 

but I can’t fine the pages where the new syntax is described.
Who can help?

mqtt:
  sensor:  
     - name: WHR_intake
       state_topic: "testxcvb/WHR"
       value_template: "{{ value_json.intake }}"
       device_class: temperature
       unit_of_measurement: °C

     - name: next_sensor
       etc etc

  switch: 
      - name: if_you_have_switch
1 Like

if you change your mqtt sensor config to the new syntax the issue could be that it won’t work because you are further behind in your HA version. I can’t remember when that syntax first became available.

if it is an issue then just keep using your current version of HA along with the existing mqtt sensor config and ignore the VSC warnings. Or update your HA to the latest release, update your mqtt sensor to the latest syntax and figure out your GPIO issue.

1 Like