First Button App¶
Button app is a native LaMetric Time app that allows to do things when you press an action button. We will use zapier.com to demonstrate how it works. Zapier is a service that can do something (like send email) in response to some event. We will use LaMetric Time button app to trigger such an event.
Let’s create an app that will notify wife when you are going home.
To do that, we will need to:
- Create “Button App” at developer.lametric.com
- Create new Zapp (a.k. rule) at zapier.com
- Publish you “Button App” and test how it works.
So, let’s get started!
Create Button App¶
Start by logging in to your developer account and create new button app.
Now add “message” parameter that will allow us to change the text that will be sent. Choose icon and enter text that will be displayed on the LaMetric Time when app is active.
As you noticed, now we need URL to put into “URL to be triggerd” field. This is when Zapier comes into play.
Let’s open zapier.com in separate tab and proceed with creating new zap.
Let’s search for “webhooks” triggers. Webhook is an API that we can call from our app to do some action.
Now choose “Catch Hook” and press “Save + Continue” button. This will tell Zapier to create an API endpoint for us that we will be able to call.
At this step enter parameter name we added to our button app - “message”.
After this step you have the hook URL we can use in our button app. Copy it by pressing on “Copy to clipboard button”.
Lets switch to the tab where we have LaMetric Developer open and continue from step 5. Just paste the URL into “URL to be triggered” field and press “Next”.
Now enter your app name and short description. As an example we will use “Wife Notifier” name.
Ok, now publish app privately by clicking on “Publish” button and install it to your LaMetric Time device.
Open LaMetric Time app, go to your device settings and press on “+” button. Choose “Private” category, find your app and press “Add”.
Now check your device - you should see “Leve” text (the one we added during app creation). Let’s press “Action” button for a few times. This will cause hook URL to be triggered and zapier will know it works.
Let’s get back to Zapier and continue with our zap. If you see “Test Successful” message - press “Continue”. If not - try to press “Action” button on the device few more times.
Now, when we are done creating trigger let’s continue with action. Because we want to send an e-mail, let’s find Gmail action by typing “Gmail” into action search field. Choose “Send Email” action and press “Save + Continue” button.
Login to you Gmail account and select it when asked, followed by “Save + Continue” button.
Lets fill out the e-mail form:
|To:||email@example.com (this may be your wives e-mail address)|
|Reply to:||firstname.lastname@example.org (this is your e-mail addres)|
|From name:||John (your name)|
|Subject:||I’m on my way! (subject of email)|
|Body:||here choose Querystring Message parameter. It will get replaced by the message from our app.|
Now it is ok to click “Continue” button to proceed to the next step
Check your e-mail and click on “Create & Continue” button.
And finally here is our “Finish” button! Let’s click it!
Final touch, lets choose the name for our zap - “Wife Notifier” would be good.
That’s it! You have created your first zap - rule that sends e-mail to your wife when you click button on your LaMetric Time!
Let’s press the action button…..
Ding! It works!
Hope you enjoyed the tutorial. Let us know if you find any issues, typos or other issues. Thanks!