PC Temperature out of MQTT message

Hello together,

sorry for asking this maybe too simple question but I can´t seem to figure out how to get Data out of an MQTT message. I´m not really expierenced with MQTT so please bear with me. The software I´m running to control all my fans on my water cooled PC has the ability send MQTT messages to my broker. I do receive the messages as expected but don´t know how to handle the received data.

For example here I´m trying to create an MQTT temperature sensor in Home Assistant that shows my water temps. I would like to use this sensor to run certain automations.

The MQTT Message looks like this:

{
    "Id": "9990186d-899e-4d31-a680-7eac58f58044",
    "Topic": "aquaero",
    "Title": "Notification",
    "Message": "",
    "Data": [
        {
            "Name": "Wasser",
            "Unit": "°C",
            "Value": 31.02
        }
    ]
}

I am also able to create the MQTT sensor but fail to get the information thats stored in “Value”. It simply shows nothing.

- platform: mqtt
  name: "Wasser"
  state_topic: "aquaero"
  device_class: "temperature"
  qos: 0
  value_template: "{{ value_json.Value }}"
  unit_of_measurement: '°C'

2021-01-11 16_21_37-Einstellungen - Home Assistant

What am I doing wrong here?

Thanks in advance for your help!

Regards
Stefan

I had a similar issue, see this post: [SOLVED] RESTful Sensor.. How to get the right attribute from JSON result - #4 by Piggyback

Helpful is this link : https://jsonpathfinder.com/

Perfect thats it. So easy, yet so complicated if you don´t know. Thanks @Piggyback and @123 for the help.

1 Like