riessal
(Riessal)
November 15, 2024, 1:30am
1
Hello there,
I am facing a problem that I cannot resolve. I use open3e to get readings from my heat pump. The results are then broadcasted via MQTT to my HA Installation. Unfortunately there is data that I cannot extract to use it as values for a sensor.
open3e result is:
vcal 274 OutsideTemperatureSensor {"Actual": 5.3, "Minimum": 4.8, "Maximum": 5.4, "Average": 4.8, "Unknown": 0}
the sensor in the configuration.yaml as follows:
- state_topic: open3e/vitocal/274_OutsideTemperatureSensor/Actual
unit_of_measurement: "°C"
name: "Aussentemperatur"
unique_id: "Aussentemperatur"
device:
name: "Vitocal 250"
identifiers:
- "vitocal_250"
This results in the Value
"Unknown"
of the sensor entity.
Where is the mistake I am making over and over again?
Regards,
Alex
Sir_Goodenough
((SG) WhatAreWeFixing.Today)
November 15, 2024, 1:33am
2
Hello riessal ,
Troubleshooting MQTT? MQTT-Explorer can help you be successful!
If you have Add-ons available, try adding this Add-on repository to your Add-on list. GitHub - GollumDom/addon-repository .
Using that you can better see what the topics are and what they need to be.
riessal
(Riessal)
November 15, 2024, 1:49am
3
Hello @Sir_Goodenough ,
Thank you for your fast response. I have the MQTT-Explorer running (see the screenshot). Unfortunately it doesnt help me solving my problem.
I need the numeric value of “Actual” but only get an “Unknown”, not the “0”.
Sir_Goodenough
((SG) WhatAreWeFixing.Today)
November 15, 2024, 1:59am
4
That’s the topic I think. Actual is part of the JSON of the value you are looking for.
value_json.Actual
Needs something like this…
state_topic: "open3e/vitocal/274_OutsideTemperatureSensor"
state_value_template: "{{ value_json.Actual }}"
1 Like
riessal
(Riessal)
November 15, 2024, 7:19am
5
Unfortunately state_value_template cannot be parsed.
But if I use the topic “open3e/vitocal/0274_OutsideTemperatureSensor/Actual” shouldn’t that give me a numeric result?
Spiro
November 15, 2024, 7:31am
6
your indentation is wrong.
riessal
(Riessal)
November 15, 2024, 7:52am
7
Thank you for the hint. Would this be correct?
state_topic: open3e/vitocal/274_OutsideTemperatureSensor/Actual
unit_of_measurement: "°C"
name: "Aussentemperatur"
unique_id: "Aussentemperatur"
device:
name: "Vitocal 250"
identifiers: "vitocal_250"
Spiro
November 15, 2024, 11:02am
8
- name: "turned on"
state_topic: "pump/timestamp_on"
device_class: "timestamp"
value_template: "{{ as_datetime(value) }}"
unique_id: "hp_1231232_ts_on"
device:
name: "Heat pump"
identifiers:
- "hp_1231232"
From the integration page. Copy and paste on my phone is causing indentation errors as well.
finity
November 15, 2024, 1:16pm
9
No.
the data is held in the topic.
the topic is “open3e/vitocal/0274_OutsideTemperatureSensor”.
the data is held in “key:value” pairs inside the topic
the key for the value you want from the above topic is “Actual”.
you have to extract that value by passing the resulting json string from the topic thru a template.
If you paste this into the dev tools template editor and play around with the part inside the {{ }} you should see how it works:
{% set value_json = {"Actual": 5.3, "Minimum": 4.8, "Maximum": 5.4, "Average": 4.8, "Unknown": 0} %}
{{ value_json.Actual }}
you were close.
We are assuming that they are creating an MQTT sensor so it should actually be:
state_topic: "open3e/vitocal/274_OutsideTemperatureSensor"
value_template: "{{ value_json.Actual }}"
So full config should look something like:
mqtt:
sensor:
- state_topic: "open3e/vitocal/274_OutsideTemperatureSensor"
value_template: "{{ value_json.Actual }}"
unit_of_measurement: "°C"
name: "Aussentemperatur"
unique_id: "Aussentemperatur"
device:
name: "Vitocal 250"
identifiers:
- "vitocal_250"
1 Like
riessal
(Riessal)
November 16, 2024, 10:32am
10
Thank you so much, now it works!
2 Likes