Send timestamp on event via MQTT

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
papperone
Normal user
Posts: 497
Joined: 04 Oct 2016, 23:16

Send timestamp on event via MQTT

#1 Post by papperone » 08 Oct 2016, 10:02

Sorry for the maybe "noob" question but as I'm not able to search forum with keyword "mqtt" (it says it's a too common word!) I did not find anythign that can help me on this issue.
Basically I want to be able when a specific even occurrs to publish an MQTT topic (which I can do already) but I want the content of the topic to be the current timestamp, and apparently I can send only fixed text.
Any clue/help on how this can be achieved on ESPEasy without creating script/rules on my mqtt server/broker?
My TINDIE Store where you can find all ESP8266 boards I manufacture --> https://www.tindie.com/stores/GiovanniCas/
My Wiki Project page with self-made PCB/devices --> https://www.letscontrolit.com/wiki/inde ... :Papperone

Martinus

Re: Send timestamp on event via MQTT

#2 Post by Martinus » 08 Oct 2016, 11:16

Have you tried sending %systime% ?

papperone
Normal user
Posts: 497
Joined: 04 Oct 2016, 23:16

Re: Send timestamp on event via MQTT

#3 Post by papperone » 08 Oct 2016, 12:36

Martinus wrote:Have you tried sending %systime% ?
NO, will try soon... but how do I find some documentation about all those "tricks"?
I've the feeling ESPEasy is great but with eventually many "hidden" features coudl be even better!!!
My TINDIE Store where you can find all ESP8266 boards I manufacture --> https://www.tindie.com/stores/GiovanniCas/
My Wiki Project page with self-made PCB/devices --> https://www.letscontrolit.com/wiki/inde ... :Papperone

papperone
Normal user
Posts: 497
Joined: 04 Oct 2016, 23:16

Re: Send timestamp on event via MQTT

#4 Post by papperone » 09 Oct 2016, 22:09

it does not work :(
I have this rule setup:

Code: Select all

On System#Boot do
  Publish /%sysname%/lastboot,%systime%
endon
but the topic contents after boot is ",0:00" (yes, including the comma)...
is it a bug or I'm doing somethign wrong?
My TINDIE Store where you can find all ESP8266 boards I manufacture --> https://www.tindie.com/stores/GiovanniCas/
My Wiki Project page with self-made PCB/devices --> https://www.letscontrolit.com/wiki/inde ... :Papperone

Martinus

Re: Send timestamp on event via MQTT

#5 Post by Martinus » 10 Oct 2016, 14:25

papperone wrote:is it a bug or I'm doing somethign wrong?
It's a specific bug for system time on boot events...
Will be fixed with the next build.

papperone
Normal user
Posts: 497
Joined: 04 Oct 2016, 23:16

Re: Send timestamp on event via MQTT

#6 Post by papperone » 10 Oct 2016, 17:03

Thanks for the quick answer, will wait for the fix :)
My TINDIE Store where you can find all ESP8266 boards I manufacture --> https://www.tindie.com/stores/GiovanniCas/
My Wiki Project page with self-made PCB/devices --> https://www.letscontrolit.com/wiki/inde ... :Papperone

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 52 guests