Mqtt sensor not working as created

I’m trying to define a mqtt sensor in HA. I can see the message reaching the broker, but I’m unable to convert it to an entity in HA. I’ve created a sensor to monitor the P value. But it’s not working. This is the first time I’m doing this, so any help is always appreciated.

mqtt:
  sensor:
    - name: 'REMI MQTT'
      unique_id: remi_mqtt_ch0
      state_topic: '244cab254dfc\PUB\CH0'
      unit_of_measurement: 'Watt'
      value_template: '{{ value_json.PI }}'
{
  "ident": "244cab254dfc",
  "device_CH": "0",
  "Name": "P1_ALL",
  "Type": "P1",
  "Units": "Varia",
  "U": "227",
  "I": "9660",
  "PI": "1959",
  "PE": "0",
  "T": "1",
  "CIH": "4198556",
  "CIL": "6155084",
  "CEH": "4016606",
  "CEL": "1683734",
  "CG": "0",
  "CW": "0"
}

This looks OK…

Check your topic is correct.

244cab254dfc\PUB\CH0

Check the slashes direction too.

244cab254dfc/PUB/CH0
1 Like

My god, why didn’t I think of that… the slashes in the other direction fixed it… :sweat_smile:

1 Like