Page 1 of 1

MQTT topic

Posted: 01 Nov 2019, 10:30
by madru
Morning,

I am new to ESPEasy and I try to publish to my MQTT-Broker some values via a rule

reading the documentation it should be:

Code: Select all

Publish topic, payload 
some example show

Code: Select all

publish, top, payload

but I receive the following on the broker:

Topic = Publish, payload = topic

the log shows following:

Code: Select all

154584 : ACT  : Publish "topic", "payload"
154595 : Command: publish
I must do something wrong but I can't figure it out......


I searched the forum but did not find an answer :(

thank you for your help

M

Re: MQTT topic

Posted: 01 Nov 2019, 13:50
by TD-er
Could you try with this test build: https://www.dropbox.com/s/7cbfjvg5ytlqc ... 8.zip?dl=0
Please let me know if these fixes do help you with your problem.

Re: MQTT topic

Posted: 01 Nov 2019, 14:58
by madru
YEP :)

does fix the topic problem

👍

Re: MQTT topic

Posted: 01 Nov 2019, 16:08
by dynamicdave
I've just tried again with release... ESP_Easy_mega-20191028-21-PR_2698_normal_ESP8266_4M1M.bin

I have a publish command in a rule-set to publish a 'json' string.

It would seem if the payload is just a single item, then it works.
Publish,node24/ir_detector,{"ssid":"%ssid%"}

If it's more than one item, then is fails with "Failed to parse JSON string"
Publish,node24/ir_detector,{"ssid":"%ssid%","node_number":"node%unit%"}

Hope this helps to narrow-down the issue.

Re: MQTT topic

Posted: 01 Nov 2019, 17:43
by TD-er
Could you try wrapping the last parameter in the "other" quotes?

Code: Select all

Publish,node24/ir_detector,'{"ssid":"%ssid%","node_number":"node%unit%"}'

Re: MQTT topic

Posted: 01 Nov 2019, 18:39
by dynamicdave
Thanks for pointing out that I should have surrounded the json string (in the Publish command) with single quote marks.

I can confirm that the json string publishes correctly in this release ( ESP_Easy_mega-20191028-21-PR_2698_normal_ESP8266_4M1M.bin ).