Sending 1 and 0 at intervals

0
Hi I am trying to accomplish this feature where:  A user clicks on a button to turn on LED. It send a ‘1’ value to my IOT platform to turn on LED. After a duration, for example 20 minutes, it automatically sends a ‘0’ value to my IOT platform to off the LED. ( Basically switching on and turning it off after 20minutes by using just ONE button). I managed to accomplish this. Microflow2 and Microflow  is just a single Call Rest activity to send ‘1’ and ‘0’ respectively. However, I have noticed that the user must stay on that page ( or native page as I am building a native mobile app as well), in order to send ‘0’ to the IOT platform automatically. May I know if it is possible to send ‘0’ automatically even when the user closes the tab/ app please? I am using a free license of Mendix 8 and I am not sure if it is possible to achieve it with a free license since free Mendix is not able to do scheduling. 
asked
3 answers
1

Use ‘executeMicroflowInBackground’ to start a microflow in background that does your last two activities: ‘Wait’ and ‘Microflow’.

answered
0

Edit: Does not work for nanoflows. I suggest going with Tim's solution :-)

answered
0

Hi guys,

Thanks for answering. I am still not sure how to use the “executeMicroflowInBackground” after downloading CommunityCommons. However, I have tried the “Delay” in CommunityCommons and it seems to be working. 

 

I have tried to use it in free sandbox environment and it works. Hopefully that it also works in native mobile ( which I feel that it should work as well, as all I have to do is to call microflow inside nanoflow). Thanks so much guys!

Edit: Just curious, but may I know whats the difference between “Wait” in nanoflow commons and “Delay” in CommonCommunity please? Is it because “Delay” is working in the server side ( like how all microflow works) while “Wait” works only in client side? Hence, “Delay” will work even after closing the tab as it sends to the server? 

answered