Pls help with this value template from MQTT

in MQTT Explorer, i see this topic “CAR” and these values


in my config.yml file, under my MQTT sensor section, i have:

  - name: "Hyundai Battery SoC2"
    unique_id: "Hyundai_soc2"
    state_topic: "CAR"
    device_class: "battery"
    unit_of_measurement: "%"
    value_template: "{{ value_json.SOC }}"

but off course it is not working. any idea how i can view the value of “59” as an entity?

What does “not working” mean? Do you see the sensor as unknown or not see it at all?

Your config looks good — do you have other working MQTT sensors? Have you restarted since adding the first one? Messages in the logs?

it works after all
image

i was editing a backup location and not the real yml. oops!

1 Like