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

Invalid JSON in Home-Assistant config topic #1900

Open
wdonker opened this issue Feb 16, 2024 · 1 comment
Open

Invalid JSON in Home-Assistant config topic #1900

wdonker opened this issue Feb 16, 2024 · 1 comment
Labels

Comments

@wdonker
Copy link

wdonker commented Feb 16, 2024

OpenMQTTGateway seems to generate invalid JSON in some HA config topics. For instance:

-topic: homeassistant/sensor/GT-WT02-1-4-battery_ok/config
-payload: {"stat_t":"+/+/RTL_433toMQTT/GT-WT02/1/4","dev_cla":"battery","unit_of_meas":"%","name":"battery","uniq_id":"GT-WT02-1-4-battery_ok","val_tpl":"{{ float(value_json.battery_ok) * 99 + 1 | is_defi1��2homeassistant/sensor/GT-WT02-1-4-battery_ok/config{"stat_t":"+/+/RTL_433toMQTT/GT-WT02/1/4","dev_cla":"battery","unit_of_meas":"%","name":"battery","uniq_id":"GT-WT02-1-4-battery_ok","val

I copied this payload from MQTT explorer.

The error seems to occur incidentally, for another 'battery' sensor the payload is ok:
{
"stat_t": "+/+/RTL_433toMQTT/Acurite-01185M/0/64",
"dev_cla": "battery",
"unit_of_meas": "%",
"name": "battery",
"uniq_id": "Acurite-01185M-0-64-battery_ok",
"val_tpl": "{{ float(value_json.battery_ok) * 99 + 1 | is_defined }}",
"state_class": "measurement",
"device": {
"identifiers": [
"Acurite-01185M-0-64"
],
"connections": [
[
"mac",
"Acurite-01185M-0-64"
]
],
"model": "Acurite-01185M",
"name": "Acurite-01185M-0-64",
"via_device": "OMG_lilygo_rtl_433_ESP"
}
}
Expected behavior
Valid JSON in config topic

Screenshots

Environment (please complete the following information):
version: v1.6.0 (I tried OTA to 1.7.0 but it failed)
env: lilygo-rtl_433
modules: 'LilyGo_SSD1306', 'WebUI', 'rtl_433'

Additional context

Copy link

This issue is stale because it has been open for 90 days with no activity.

@github-actions github-actions bot added the stale label May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant