0

I am creating an IOT device where the user can set a particular time to trigger an action by an IOT device. For eg: At 01:00 PM, the Air Conditioner starts automatically. In this case, user will set 01:00PM in the Mobile App which will further be stored the value in a database table.

Now i need to read these database values and trigger an Azure function that will switch on the A/C, but this process is complex since i need to write my own scheduler. Is there any alternate way, perhaps using Azure Timer Functions.

Thanks

Sandy
  • 79
  • 2
  • 8
  • You could have a look at [Azure Scheduler](https://azure.microsoft.com/en-us/services/scheduler/) – rickvdbosch Jun 11 '18 at 12:33
  • So Functions supports chron based timer scheduling, also Logic Apps has a timer option if you have more of a multi-step process orchestration. Functions Guidance:https://learn.microsoft.com/en-us/azure/azure-functions/functions-bindings-timer Logic Apps Guidance:https://learn.microsoft.com/en-us/azure/logic-apps/logic-apps-workflow-actions-triggers#recurrence-trigger – KWilson Jun 11 '18 at 16:04
  • @KWilson are you suggesting to use Azure Timer function. Yes i do know that Azure functions support CRON based timer scheduling, but my use case is that the time is stored in the database. There needs to be something that will check the database on a frequency and trigger the command to the device. If you can elaborate the solution, that would be great. – Sandy Jun 13 '18 at 09:50
  • @rickvdbosch Getting scheduler is an addition cost. Is there any other way? – Sandy Jun 13 '18 at 09:50
  • @Sandy Sure. For instance: you could have a function check the database every 1/5/10/(other-amount-of) minutes and trigger based on the values in the database. – rickvdbosch Jun 13 '18 at 12:11
  • @rickvdbosch Yes, even i was thinking same, a function that executes every 1min. to check in the database if time has arrived to switch the A/C. But problem is, if i keep on hitting the database every min, then it may impact the cost. Another solution that i thought is to create a function that will run for every 4 hr. At start of the function, will pull the records from DB for the next 4 hrs. Lets say if the func executes at 12:00PM then it picks the record from the database from 12:01PM till 04:00PM. The func will keep on executing for these 4 hours and check if the time have arrived. – Sandy Jun 13 '18 at 14:20

0 Answers0