To ensure consistent sensor data collection for the ThriveWell project, I implemented an auto-notification system using AWS Lambda and EventBridge (CloudWatch Scheduler). The goal was to send timely reminders to users who haven't uploaded data recently — specifically those who haven't sent a heartbeat signal within the last 30 minutes.
This system works by:
Through this setup, the system ensures passive sensing is maintained without manual intervention, enhancing both data reliability and user engagement
Lambda Function
Configuration Change: 30 sec
Environment Variables:
DEVICE_TABLE | thrivewell-service-dev-devices |
---|---|
FIREBASE_CONFIG | {your firebase config} |
IAM Role
Go to IAM > Roles and search for auto-notification-for-inactive-users-role-ef9t71kr
Add permissions > Create inline policy
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"dynamodb:Scan",
"dynamodb:GetItem"
],
"Resource": "arn:aws:dynamodb:us-east-1:992382461970:table/thrivewell-service-dev-devices"
}
]
}