Use a AWS IOT 1-Click button to track working time, illness or vacation in your home office and generate monthly reports.
This project uses a Seeed IoT button for AWS IoT 1-Click to capture time tracking events, e.g. start/end of work or illness and vacation.
A AWS IOT 1-Click button usually supports three types of click. Each click type will capture a different time tracking record.
Click Type | Description |
---|---|
Single Click | Captures time tracking record for working day. |
Double Click | Use double click to capture illness. |
Long Press | This click type is used to capture start of vacation. |
This package includes different types of repositories, a report generator, an Excel output formatter and a publisher which uploads generated reports to a S3 bucket.
Repository | Description |
---|---|
LocaLRepository | An in memory repositorie, e.g. for testing. |
S3Repository | A repository which persists time tracking records in a S3 bucket. |
The report generator creates a montly summary with working hours and breaks per day for a list of passed time tracking records.
Report generating uses different rules to interpret time tracking records.
Each pair of WORKDAY events is used to calcualte working time. Time between is intepreted as a break.
If a workday has an odd number of captured events the end of a working day will be estimated, e.g. by default working hours defined in locale settings.
It's not necessary to click each day on the button if you're sick or on vacation. You only have to capture start of illness or vacation using corresponding click type. For monthly report this type will be used until next differing type occurs.
If a day belongs to more than one type (WORKDAY.ILLNESS.VACATION) of time tracking events, they'll be used to determine type of the entire day in floowing order.
- ILLNESS, has highest priority, overwrites all other
- VACATION, will overwrite WORKDAY
- WORKDAY, lowest priority
A formatter takes a generated report to create an putput for it. You can pass a list of public holidays, the formatter will highlight them in its output.
This formatter generates monthly report as an Excel file.
This publisher uploads a generated report output to a S3 bucket.
Simply writes a report to a given local file.
Uses AWS SES to send an email with generated report attached.
A calendar uses an external service to fetch public holidays.
In a locale you can define some settings e.g. country for holidays, time zone or default wokring time per day.
Following repoditories are using this time tracker package and contain AWS Lambda functions to capture click events and generate reports.
Repository | Description |
---|---|
hob-core | Contains core components for this project, e.g. event definitions and helper to serialize/deserialize events. |
hob-iot-handler | Handler to process events from AWS IOT 1-Click. |
hob-apigw-handler | Handler for capture request send to AWs API Gateway. |
hob-report-generator | Kambda function to generate and send monthly reports. |