Hello
I get from the mqtt server a number sent to the espeasy. This number should be used in the rules as a parameter for a timer.
e.g. I send to mqtt a 100 then the timer should execute an action for 100 minutes. After completion the esp waits until the next action, before the action it looks if there is a new value in the Generic - MQTT Import. if yes this value is taken.
My problem is how do I tell the timer to take this variable?
TimerSet,1,[mqtt_in#nr] does not work.
is there another way to set the timer value variable?
set the timer value variable
Moderators: grovkillen, Stuntteam, TD-er
Re: set the timer value variable
How do you receive the value from the MQTT broker?
Is it via MQTT import, or do you send a command (topic ending with /cmd) ?
If MQTT import receives a value, then it should send out an event.
You can act on this event by setting the timer.
Is it via MQTT import, or do you send a command (topic ending with /cmd) ?
If MQTT import receives a value, then it should send out an event.
You can act on this event by setting the timer.
Code: Select all
on mqtt_in#nr do
TimerSet,1,%eventvalue1%
endon
Re: set the timer value variable
Thank you very much.
I have tried to work with [ xx#yy]. Your hint worked right away
edit
And my variant works also if you correct the spelling mistakes.
I have tried to work with [ xx#yy]. Your hint worked right away
edit
And my variant works also if you correct the spelling mistakes.
timerSet,2,[NodeRED#nr]]
Re: set the timer value variable
Glad it is solved
Just another tip for debugging and writing rules.
We do have a syntax highlighter for ESPEasy rules for Notepad++
See: https://github.com/letscontrolit/ESPEas ... epad%2B%2B
Just another tip for debugging and writing rules.
We do have a syntax highlighter for ESPEasy rules for Notepad++
See: https://github.com/letscontrolit/ESPEas ... epad%2B%2B
Who is online
Users browsing this forum: No registered users and 2 guests