Hi all, I have HA for 5 years now and really happy it. My main way of integrating IoT around the house is via mqtt. I’d say I’m pretty experienced with the protocol and how to use it in both HA and Node Red.
However, for a while now I get like 3.5k warnings a day in the log for an Erroneous JSON. The reason is, that a too large JSON is sent, it is cut off by HA or the mqtt broker and hence the JSON structure becomes faulty (i.e. prob a bracket is missing because of the cut off).
All ok and well, but for the life of me I cant find the source of the json to reduce its size. I know it comes from an http call to homewizard in node red. Seeing the data it is clearly from there. But where I used to sent the entire response (causing this warning), I now split it in different pieces and sent it to different topics. So this shouldnt occur anymore.
When checking all topics in mqtt explorer, I also dont see the original huge response coming by anymore (as expected). So, my guess is somewhere it still lives in HA and I cant find where it is used. I checked all the related topics in my mqtt configuration in HA and those all have small jsons.
Any idea where to look further?
The warning message in HA is as follows:
Logger: homeassistant.components.mqtt.mixins
Source: components/mqtt/mixins.py:443
integration: MQTT ([documentation](https://www.home-assistant.io/integrations/mqtt), [issues](https://github.com/home-assistant/core/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+mqtt%22))
First occurred: October 7, 2024 at 20:59:33 (25403 occurrences)
Last logged: 11:22:29
* Erroneous JSON: {bla bla bla sudden cut off
* Erroneous JSON: {bla bla bla sudden cut off
* Erroneous JSON: {bla bla bla sudden cut off
* Erroneous JSON: Not Found
I also get the following error message that suggests that these are the code pieces involved, since they cant process the JSON
Logger: homeassistant.helpers.template
Source: helpers/template.py:792
First occurred: October 7, 2024 at 20:59:33 (43548 occurrences)
Last logged: 11:22:29
* Error parsing value: 'value_json' is undefined (value: {bla bla bla sudden cut off, template: {{ value_json["values"]["status"] }})
* Error parsing value: 'value_json' is undefined (value: {bla bla bla sudden cut off, template: {{ value_json["values"] | tojson }})
* Error parsing value: 'value_json' is undefined (value: Not Found , template: {{ value_json["values"] | tojson }})
* Error parsing value: 'value_json' is undefined (value: Not Found , template: {{ value_json["values"]["status"] }})
I have searched for all the “value_json[“values”]” pieces in my yaml config files of HA and monitored their mqtt topics and those all have the new smaller JSONs. Are there other places I could be reading mqtt directly which causes me to miss a topic?
I’m lost and I don’t like the frequency of this warning. I want a clean config so would really like to address this.
Thanks for any help!!
edit: The json mentioned in HA is 1100 characters long. So I have made a node red flow that checks the length over every mqtt message and I only see messages longer than 1000 characters for frigate, double take and rpi-monitor. This suggests even more so that there is cache of the original long json in HA somewhere. My install is quite old, so maybe somwhere along the way something got a not-that-great update causing this. But I’m so curious where. I always update to latest versions of HA within a month or two btw.