HA appears as a very neat way to control the HVAC system I am building. The HVAC includes a classic CV, a heatpump, multi-group floorheating, radiators etc and of course a bunch of sensors. The control over these components is done using on a Rasp Pi Pico with drivers / hw control written in MicroPython. Interaction with HA is done using Mosquitto MQTT.
getting acqainted with HA have brought me to get single sensor readings from the controller, via MQTT to HA and visualize it on a dashboard. The ultimate situation is that multiple sensors broadcast their value - upon change - against a single MQTT topic: heating/sensor_data. In Python terms, I would send a “dictionary_of dictionaries”. Like: { {sensor_a: data_a}, {sensor_b: data_B}}. In doing so, HA thus needs to extract the sensor_id and the sensor’s data from that topic. And here is where I get confused how to do that. In the HA MQTT section, reference is made to two declarations I may need: “json_attributes_topic” and “json_attributes_template” to allow HA to extract sensordata from my “dict_of-dicts” as published.
Setting YAML up as follows however fails:
mqtt:
sensor:
- json_attributes_topic: "heating/sensor_data"
- json_attributes_template:
{
"sl_verd": <string>,
"sl_cv_aanv": <string>,
"sl_cv_ret": <string>
}
The YAML conf checker thinks this is ok but it fails on the reload. I appear to miss (do not understand) the way this is supposed to work. Any clarification / guidance to achieve my objective is highly appreciate. THX !