From 1495338f53ff41d2c806d2f81db7f06a7ca11d79 Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Wed, 23 Jul 2025 12:30:35 +0200 Subject: [PATCH] Fix Build MQTT topic string based on FullTopic --- tasmota/berry/lorawan/decoders/LwDecode.be | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tasmota/berry/lorawan/decoders/LwDecode.be b/tasmota/berry/lorawan/decoders/LwDecode.be index 5ae3aad27..eb1551bd4 100644 --- a/tasmota/berry/lorawan/decoders/LwDecode.be +++ b/tasmota/berry/lorawan/decoders/LwDecode.be @@ -23,6 +23,7 @@ class lwdecode_cls def LwDecode(data) import json + import string var deviceData = data['LwReceived'] var deviceName = deviceData.keys()() @@ -44,7 +45,11 @@ class lwdecode_cls end if Payload.size() && self.LwDecoders.find(decoder) - var topic = "tele/" + self.thisDevice + "/SENSOR" + var topic = string.replace(string.replace( + tasmota.cmd('FullTopic',true)['FullTopic'], + '%topic%', tasmota.cmd('Topic',true)['Topic']), + '%prefix%', tasmota.cmd('Prefix',true)['Prefix3']) # tele + + 'SENSOR' var decoded = self.LwDecoders[decoder].decodeUplink(Node, RSSI, FPort, Payload) var mqttData = {"LwDecoded":{deviceName:decoded}} mqtt.publish(topic, json.dump(mqttData))