1technophile / OpenMQTTGateway

MQTT gateway for ESP8266 or ESP32 with bidirectional 433mhz/315mhz/868mhz, Infrared communications, BLE, Bluetooth, beacons detection, mi flora, mi jia, LYWSD02, LYWSD03MMC, Mi Scale, TPMS, BBQ thermometer compatibility & LoRa.
https://docs.openmqttgateway.com
GNU General Public License v3.0
3.61k stars 792 forks source link

Invalid JSON in Home-Assistant config topic #1900

Closed wdonker closed 5 months ago

wdonker commented 9 months ago

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

github-actions[bot] commented 6 months ago

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

github-actions[bot] commented 5 months ago

This issue was closed because it has been inactive for 14 days since being marked as stale.