Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect display of long and complex JSON payload #803

Closed
lindhe opened this issue May 29, 2024 · 1 comment
Closed

Incorrect display of long and complex JSON payload #803

lindhe opened this issue May 29, 2024 · 1 comment

Comments

@lindhe
Copy link

lindhe commented May 29, 2024

MQTT Explorer version: 0.4.0-beta4

During some debugging I found that MQTT Explorer seems to struggle with some JSON payloads.

$ mosquitto_sub -h mqtt.example.com -p 1883 -t 'homeassistant/binary_sensor/Nexa-Security-3-7559323-state/config'
{"stat_t":"+/+/RTL_433toMQTT/Nexa-Security/3/7559323","name":"State","uniq_id":"Nexa-Security-3-7559323-state","val_tpl":"{{ value_json.state | is_defined }}","pl_on":"ON","pl_off":"OFF","device":{"ids":["Nexa-Security-3-7559323"],"cns":[["mac","Nexa-Security-3-7559323"]],"mdl":"Nexa-Security","name":"Nexa-Security-3-7559323","via_device":"OMG_1"}}

In MQTT Explorer, it looks like this:

{"uuid":"ac\",\"Nexa-Security-3-7559323\"]],\"mdl\":\"Nexa-Security\",\"name\":\"Nexa-Security-3-7559323\",\"via_device\":\"OMG_1\"}}"}

MQTT Explorer

I tried to find a MWE, this is the best I could come up with:

$ mosquitto_pub -h mqtt.lindhe.io -p 1883 -t debug/foo -m '{"stat_t":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","aaaa":"aaaaa","aaaaaaa":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaa","val_tpl":"{{ value_json.state | is_defined }}","aaaaa":"aa","aaaaaa":"aaa","aaaaaa":{"aaa":["aaaaaaaaaaaaaaaaaaaaaaa"],"aaa":[["mab","aaaaaaaaaaaaaaaaaaaaaaa"]],"aaa":"aaaaaaaaaaaaa","aaaa":"aaaaaaaaaaaaaaaaaaaaaaa","aaaaaaaaaa":"aaaaa"}}'

Some notes:

  • It seems like length matters, because as far as I can tell I cannot delete a single character from that.
  • Complexity seems to matter, because as far as I can tell I cannot remove the val_tpl value.
  • Maybe special characters like _ plays a role?
  • Note that I can change mac into mab (like in the example above), but not into xab.
@lindhe lindhe changed the title Incorrect display of JSON payload Incorrect display of long and complex JSON payload May 29, 2024
@thomasnordquist
Copy link
Owner

There was an issue with the Sparkplug implementation.
Ther is a more recent beta which fixes it.
Sparkplug will be re-added later this week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants