Lambda handler for the AWS IoT Button
(https://aws.amazon.com/iot/button/)
The IoT button sends 3 different events corresponding to the type of click. Single, Double or Long click. Right now I don't do anything special with these events other than sending a Slack notification.
Installation is somewhat manual at this point:
-
edit makefile to use proper AWS account number
-
copy config.json.example to config.json and edit (see below for encrypted Slack URL)
-
Make and deploy:
make init
make deploy-new-
configure IoT button (see below)
-
set event source on lambda to the proper IoT button
cp config.json.example config.jsonconfigure the Slack channel, emoji, username etc to your liking
make a KMS key in the proper region, I called mine 'DefaultKey'
aws kms encrypt --key-id alias/DefaultKey --plaintext "hooks.slack.com/services/....... (whatever your Slack webhook URL is)"take that CiphertextBlob and drop it in config.json
TODO: need to fill this section in
- Logging to Dynamo
- Home Automation system integration
- SMS notifications