Can't get a value out of my sensor

Hello…first post here.
Have been searching the forums for some time now and they have been a big help so far. Unfortunately I’m stuck where I can’t get a value to report on a device I have installed in my RV. I have successfully installed mqtt and can access my device. Here is the output:

Message 58 received on RVC/INVERTER_TEMPERATURE_STATUS/1 at 10:36 AM:

{
“data”: “01A026C028FFFFFF”,
“dgn”: “1FEBD”,
“fet temperature”: 36,
“fet temperature F”: 96.8,
“instance”: 1,
“name”: “INVERTER_TEMPERATURE_STATUS”,
“timestamp”: “1673796991.527135”,
“transformer temperature”: 53,
“transformer temperature F”: 127.4
}

QoS: 0 - Retain: false

My first goal was to report the " fet temperature F" in my home assistant as a sensor with a thermometer icon. Here is the code I used…

# Inverter
mqtt:
    sensor:
        name: "fet_temperature_F"
        state_topic: "RVC/INVERTER_TEMPERATURE_STATUS/1"
        value_template: '{{value_json.fet_temperature_F}}'
        device_class: temperature
        unit_of_measurement: '°F'
        icon: mdi:thermometer

Everything runs and it does show up in developer tools under state. The problem I have is there is no value being transferred. I’m new to JSON so I don’t know where my mis-step is.

Any help would be appreciated. Thanks

# Inverter
mqtt:
    sensor:
        name: "fet_temperature_F"
        state_topic: "RVC/INVERTER_TEMPERATURE_STATUS/1"
        value_template: '{{value_json["fet temperature F"]}}'
        device_class: temperature
        unit_of_measurement: '°F'
        icon: mdi:thermometer

The key you want is named fet temperature F. It contains spaces not underscore characters. Because it contains spaces, we can’t reference it using dot notation and must use bracket notation.

Thank you. Your solution worked perfectly. Much appreciated!!!

1 Like

You’re welcome!

Please consider marking my post above with the Solution tag. It will automatically place a check-mark next to the topic’s title which signals to other users that this topic has been resolved. This helps users find answers to similar questions.

For more information about the Solution tag, refer to guideline 21 in the FAQ.

Done…thanks again.