- Posts: 79
- Thank you received: 0
MqttPublish doesn't seem to work with variables
- Jim Peduto
- Topic Author
- Offline
- User
-
Less
More
2 years 6 months ago #188
by Jim Peduto
Set up MyServer 6- Drivers not displaying was created by Jim Peduto
Thank you. it eas the second one. resolved.
Please Log in to join the conversation.
- bowlingbeeg
- Offline
- User
-
Less
More
- Posts: 248
- Thank you received: 33
2 years 4 months ago - 2 years 4 months ago #1557
by bowlingbeeg
Replied by bowlingbeeg on topic MqttPublish doesn't seem to work with variables
I'm finding that MqttPublish doesn't seem to work when you use a variable for the data. Here is an example that looks like it works from the logs but nothing gets published to the topic in Mqtt:
Macro|
SetVariable|test_bjv~atv!
MqttPublish|theater/source~{{test_bjv}}!
But just calling MqttPublish like this does work:
Macro|
MqttPublish|theater/source~atv!
Here are the logs for the failure case:
12/03/2024 00:21:23.21 · DEBUG · Server.doCommand - {{server_selectedmacro}} from dashboard-fx-l367
12/03/2024 00:21:23.21 · DEBUG · Server.doCommand - macro.test
12/03/2024 00:21:23.21 · DEBUG · Server.doCommand - SetVariable|test_bjv~atv from dashboard-fx-l367
12/03/2024 00:21:23.21 · DEBUG · Server.doCommand - MqttPublish|theater/source~{{test_bjv}} from dashboard-fx-l367
12/03/2024 00:21:23.21 · DEBUG · Server.doCommand - MqttPublish|theater/source~atv
Macro|
SetVariable|test_bjv~atv!
MqttPublish|theater/source~{{test_bjv}}!
But just calling MqttPublish like this does work:
Macro|
MqttPublish|theater/source~atv!
Here are the logs for the failure case:
12/03/2024 00:21:23.21 · DEBUG · Server.doCommand - {{server_selectedmacro}} from dashboard-fx-l367
12/03/2024 00:21:23.21 · DEBUG · Server.doCommand - macro.test
12/03/2024 00:21:23.21 · DEBUG · Server.doCommand - SetVariable|test_bjv~atv from dashboard-fx-l367
12/03/2024 00:21:23.21 · DEBUG · Server.doCommand - MqttPublish|theater/source~{{test_bjv}} from dashboard-fx-l367
12/03/2024 00:21:23.21 · DEBUG · Server.doCommand - MqttPublish|theater/source~atv
Last edit: 2 years 4 months ago by bowlingbeeg.
Please Log in to join the conversation.
- davep
- Offline
- Admin
-
Less
More
- Posts: 367
- Thank you received: 96
2 years 4 months ago #1561
by davep
Replied by davep on topic MqttPublish doesn't seem to work with variables
Wow, great find! You are indeed correct! This issue is resolved in the next myServer update.
The following user(s) said Thank You: bowlingbeeg
Please Log in to join the conversation.
- ffneil@comcast.net
- Offline
- User
-
Less
More
- Posts: 27
- Thank you received: 0
2 years 4 months ago #1670
by ffneil@comcast.net
Replied by ffneil@comcast.net on topic MqttPublish doesn't seem to work with variables
Please Log in to join the conversation.
Time to create page: 0.221 seconds