I’m a huge beginner in Squirrel/C, so thanks for your patience. My basic use case:
- Door sensor recognizes when open or closed (works)
- Every time door is opened, log time stamp and store data (works with server log but not with Twilio just yet)
3*. If door is opened for too long, inform agent and send Twilio notification (This is a big problem at the moment) - At the end of day, at 11:59pm, send twilio text notification with all time stamps that door was opened in that day (Seem to have no problem storing data into an array, but not quite working yet)
- Wipe any time stamp data after 11:59pm to allow room for tomorrow’s time stamps
For (3) I am unsure how to use the device.on / agent.send combo for device to tell agent to run the function that sends the twilio notification — I do not need to pass any data parameter in this case.
For (4) preliminary testing I printed the server log and it returned (array : 0x7fce843d8640) instead of a timestamp
I’ll be honest and say I’m not even sure how to approach (5), as I am unfamiliar with the device storage of the Imp004m other than that it has little memory. I figure I will run into issues if I don’t wipe time stamps daily.