MQTT Sensor Multi Topic Sensor

Hello!

I’m new here and I’m just starting with the topic of Homeassistant and MQTT
I have a heat pump that I want to integrate via MQTT.
when integrating the sensors, I reached the limits of my knowledge. Maybe someone of you can help me with that.
I would need the temperature value:

mqttconfig

Unfortunately, the value is not displayed in the Entidät.

LG
Robin

noE
You have mispelt your state topic. Missing e of temperature.

Also if you include a device class you can get statistical data.

device_class: "temperature"

Hello Spiro!
Thank you very much, now it works. that was a typo :wink:
I now only have one problem with the heatpump.cycles because there are 4 times the “name” I would need the fourth

lg from Austria
Robin

It’s preferred to use the preformatted text to make things easier to copy and manipulate. Use the </> symbol

value_template: "{{ value_json.4.value}}"

This should give you the number 22086 as the output

Hi,

Unfortunately it doesn’t work, the value of the entities is unknown

image

Show the whole json for heatpump.cycles using the preformatted text and somebody might be able to give the right value_template.

HI
When you use the </> button on the reply toolbar it looks like below which is easier to read espicially if on a mobile phone. Put the text between the 2 rows of 3 ticks.

{"time":"2024-12-29T09:25:38.654453Z","model":"Nexus-TH","id":223,"channel":1,"battery_ok":1,"temperature_C":8.4,"humidity":89}


Pictures of text more difficult to read and people less likely to try to help. When you first start on the forum you are also limited to the number of pictures you can post.

Hello!
Thanks for the tip, you never stop learning

heatpump.cycles = { "0": {"name": "group", "value": 80}, "1": {"name": "value", "value": 1}, "2": {"name": "type", "value": "1d"}, "3": {"name": "unit", "value": "00"}, "4": {"name": "", "value": 22096}}

LG
Robin

1 Like
    - name: "WP zyklen"
      state_topic: "ochsner/24849/heatpump.cycles"
      value_template: "{{{ value_json["4"].value }}"	  
      unit_of_measurement: 'h'

Try this.

This is how it looks in the template editor. Things that work here sometimes doesn’t work in Home assistant for real.

Have a problem, in studio code server

doesn’t work either

- name: "WP zyklen"
      state_topic: "ochsner/24849/heatpump.cycles"
      value_template: "{{{ value_json['4'].value }}"
      unit_of_measurement: 'h'

or

- name: "WP zyklen"
      state_topic: "ochsner/24849/heatpump.cycles"
      value_template: "{{ value_json["4"].value }}"
      unit_of_measurement: "h"

I deleted one of the three { brackets, doesn’t work either and “h” in ‘h’

- name: "WP zyklen"
      state_topic: "ochsner/24849/heatpump.cycles"
      value_template: "{{ value_json['4'].value }}"
      unit_of_measurement: 'h'

If I remove the 3 objects via Node Red and send them back to MQTT, the value tamplete works

- name: "WP zyklen"
      state_topic: "heatpump.cycles"
      value_template: "{{ value_json['4'].value }}"
      unit_of_measurement: "Zyklen"

image

For some reason HA doesn’t like’1’ ‘2’ ‘3’ or ‘4’ as objects. Glad you got it working.