#need help with custom mqtt thermostat, and parent device to group many entities
1 messages · Page 1 of 1 (latest)
currently, all of the entities just fal into an ungrouped section within HA
for extra context, the topic homeassistant/sensor/outdoors/config is getting a payload of:
{
"device":{"identifiers":["outdoors"],"name":"Outside","serial_number":"28e7065f02000023","via_device":"temp_daemon"},
"device_class":"temperature",
"expire_after":60,
"name":"Outside",
"object_id":"outdoors",
"state_topic":"homeassistant/sensor/outdoors/temp",
"suggested_display_precision":1,
"unique_id":"outdoors",
"unit_of_measurement":"\u00b0C",
"value_template":"{{ value_json.temperature}}"}
while zigbee2mqtt is grouping multiple entities together:
ive re-organized the code some, it now has these 2 payloads:
homeassistant/sensor/outdoors/config
with:
{
"availability": [
{
"topic": "temp_daemon/state",
"value_template": "{{ value_json.state }}"
}
],
"device": {
"identifiers": [
"outdoors"
],
"name": "Outside",
"serial_number": "28e7065f02000023",
"via_device": "temp_daemon"
},
"device_class": "temperature",
"expire_after": 60,
"name": "Outside",
"object_id": "outdoors",
"state_topic": "temp_daemon/state",
"suggested_display_precision": 1,
"unique_id": "outdoors",
"unit_of_measurement": "°C",
"value_template": "{{ value_json.outdoors}}"
}```
and temp_daemon/state with:
{
"bedroom": 21.1875,
"hallway": 21.8125,
"kitchen": 20.5,
"living_room": 19.6875,
"mode": "auto",
"outdoors": -11,
"server_room": 21.875,
"setpoint": 18,
"state": "online"
}
both verified to be reaching HA, via the "listen to a topic" option in the HA settings
and there is also a homeassistant/climate/living_room/config where i'm having a different issue:
{
"availability": [
{
"topic": "temp_daemon/state",
"value_template": "{{ value_json.state }}"
}
],
"current_temperature_template": "{{value_json.living_room}}",
"current_temperature_topic": "temp_daemon/state",
"device": {
"identifiers": [
"temp_daemon"
]
},
"expire_after": 60,
"mode_state_template": "{{ json_value.mode }}",
"mode_state_topic": "temp_daemon/state",
"modes": [
"auto"
],
"name": "Living Room",
"optimistic": true,
"retain": true,
"temperature_command_topic": "temp_daemon/living_room/set_temp",
"temperature_state_template": "{{ json_value.setpoint }}",
"temperature_state_topic": "temp_daemon/state",
"unique_id": "living_room"
}
when i post updates to the temperature_state_topic (due to changing it outside HA), the current setpoint in HA isnt updating
🤦 {{ json_value.mode }} vs {{ value_json.state }}, one of these isnt like the other!
lets see what happens if i fix those...
yep, that explains half the problem, the temperature_state_topic is working now
that just leaves the entity grouping
YOu have to provide the same device information to all the config topics
Your device information differs from the 2 or 3 that you've posted so far
meaning HA will see them as different devices
let me try with them all matching...
{
"availability": [
{
"topic": "temp_daemon/state",
"value_template": "{{ value_json.state }}"
}
],
"device": {
"identifiers": [
"temp_daemon"
],
"name": "temp daemon",
"via_device": "temp_daemon"
},
"device_class": "temperature",
"expire_after": 60,
"name": "Outside",
"object_id": "outdoors",
"state_topic": "temp_daemon/state",
"suggested_display_precision": 1,
"unique_id": "outdoors",
"unit_of_measurement": "°C",
"value_template": "{{ value_json.outdoors}}"
}
``` for `homeassistant/sensor/outdoors/config`
{
"availability": [
{
"topic": "temp_daemon/state",
"value_template": "{{ value_json.state }}"
}
],
"current_temperature_template": "{{value_json.living_room}}",
"current_temperature_topic": "temp_daemon/state",
"device": {
"identifiers": [
"temp_daemon"
],
"name": "temp daemon",
"via_device": "temp_daemon"
},
"expire_after": 60,
"mode_state_template": "{{ value_json.mode }}",
"mode_state_topic": "temp_daemon/state",
"modes": [
"auto"
],
"name": "Living Room",
"optimistic": true,
"retain": true,
"temperature_command_topic": "temp_daemon/living_room/set_temp",
"temperature_state_template": "{{ value_json.setpoint }}",
"temperature_state_topic": "temp_daemon/state",
"unique_id": "living_room"
}
``` for `homeassistant/climate/living_room/config`
the device key now matches between both the sensor and the climate, and its still showing up as ungrouped
but i do also see a new device, with some connected devices
but each of those devices, then has zero entities within it
Then you're doing something wrong, look at the documentation again and verify you're supplying the correct information for a device
https://www.home-assistant.io/integrations/climate.mqtt/#configuration
its not really clear what is wrong, all of the keys under device are optional, and it doesnt look like i'm missing any important ones