DHT22 values always show as 0

I’ve set up my Raspberry to use a DHT22 sensor to get temperature and humidity.
I’ve configured MQTT integration in HA and tested send a message to MQTT and it shows up in MQTT Explorer.
Using MQTT Explorer I can see it is receiving the values from RPi:

image

But in HA values always show as 0

My Yaml is as follows:

sensor:
- platform: mqtt
  name: "Temperatura Sala"
  state_topic: "Sala/DHT22/sensor/temperatura_sala" 
  unit_of_measurement: "°C"
  value_template: '{{ value_json.temperature }}'
- platform: mqtt
  name: "Humidade Sala"
  state_topic: "Sala/DHT22/sensor/humidade_sala" 
  unit_of_measurement: "%"
  value_template: "{{ value_json.humidity }}"

What am I doing wrong here?

Try this:

sensor:
- platform: mqtt
  name: "Temperatura Sala"
  state_topic: "Sala/DHT22/sensor" 
  unit_of_measurement: "°C"
  value_template: '{{ value_json.temperatura_sala }}'
- platform: mqtt
  name: "Humidade Sala"
  state_topic: "Sala/DHT22/sensor" 
  unit_of_measurement: "%"
  value_template: "{{ value_json.humidade_sala }}"

Now instead of showing 0ºC and 0% , i shown Unknown in both…

My mistake, as I do not know MQTT Explorer and the format of those records… I installed it (thanks to you)…

Try this instead

sensor:
- platform: mqtt
  name: "Temperatura Sala"
  state_topic: "Sala/DHT22/sensor/temperatura_sala" 
  unit_of_measurement: "°C"
  value_template: '{{ value_json }}'
- platform: mqtt
  name: "Humidade Sala"
  state_topic: "Sala/DHT22/sensor/humidade_sala" 
  unit_of_measurement: "%"
  value_template: "{{ value_json }}"

That’s it!

Thank you.