MqttPublish doesn't seem to work with variables

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.

More
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
Last edit: 2 years 4 months ago by bowlingbeeg.

Please Log in to join the conversation.

More
2 years 4 months ago #1561 by davep
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.

More
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
publishing works great with variables. I am having an issue with subscribing,  When I try to subscribe to anything  I get client session is unknown.

Please Log in to join the conversation.

Time to create page: 0.221 seconds