Help with sensor string

I have defined a mqtt sensor to retrieve values from mqtt server.

    - name: "OpenEVSE State"
      state_topic: "openevse/announce/9c0c"
      qos: 1

The sensor returns this string


I’m only intersted in the “state” attribute and would like to evaluate if this is connected (or not). What is the best way to do this?

Many thanks

I think you should add a line like

value_template: "{{ value_json.state}}"

See here MQTT Sensor - Home Assistant

1 Like