smiliemws
(Robin )
December 28, 2024, 3:25pm
1
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:
Unfortunately, the value is not displayed in the Entidät.
LG
Robin
Spiro
December 28, 2024, 6:15pm
2
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"
smiliemws
(Robin )
December 28, 2024, 9:58pm
3
Hello Spiro!
Thank you very much, now it works. that was a typo
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
Spiro
December 28, 2024, 10:21pm
5
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
smiliemws
(Robin )
December 28, 2024, 11:00pm
6
Hi,
Unfortunately it doesn’t work, the value of the entities is unknown
Spiro
December 28, 2024, 11:09pm
7
Show the whole json for heatpump.cycles using the preformatted text and somebody might be able to give the right value_template.
Spiro
December 29, 2024, 9:34am
9
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.
smiliemws
(Robin )
December 29, 2024, 1:16pm
10
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
Spiro
December 29, 2024, 2:22pm
11
- 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.
smiliemws
(Robin )
December 29, 2024, 3:28pm
12
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'
smiliemws
(Robin )
December 29, 2024, 6:49pm
13
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"
Spiro
December 29, 2024, 7:22pm
14
For some reason HA doesn’t like’1’ ‘2’ ‘3’ or ‘4’ as objects. Glad you got it working.