09-19-2025, 03:13 AM
Hello everyone,
I'm trying to create a dynamic MQTT subscription topic that is built using the value from another variable, but I can't seem to find the correct syntax.
Here is my setup:
Y/$C2_V0.value/AC/CHARGER/Current
However, this doesn't work. It seems the app is not replacing $C2_V0.value with the actual serial number ("MySerialNumber123"). It treats it as a literal string.
Is it possible to dynamically build a subscription topic using the value of another variable? If so, what is the correct syntax I should use?
Thank you for your help
I'm trying to create a dynamic MQTT subscription topic that is built using the value from another variable, but I can't seem to find the correct syntax.
Here is my setup:
- I have a variable (ID: C2_V0) that successfully reads a device's serial number from an MQTT topic. Let's say the serial number it reads is "MySerialNumber123". This works perfectly.
- I have a second variable (e.g., "Charger Current") that needs to subscribe to a topic that includes this serial number. The topic structure I need is: Y/<serial_number>/AC/CHARGER/Current.
Y/$C2_V0.value/AC/CHARGER/Current
However, this doesn't work. It seems the app is not replacing $C2_V0.value with the actual serial number ("MySerialNumber123"). It treats it as a literal string.
Is it possible to dynamically build a subscription topic using the value of another variable? If so, what is the correct syntax I should use?
Thank you for your help