Hello all I just wanted to share my experiance in setting up the (unbranded) amazon IoT button with ST, this requires a bit of tech savvy.
My original desire was for some type of zigbee / zwave doorbell - I tried https://www.amazon.com/Aeotec-Aeon-Labs-ZW056-Doorbell/dp/B0182XG27Q/ref=sr_1_1?s=digital-text&ie=UTF8&qid=1480896076&sr=8-1&keywords=zwave+doorbell
as the reviews mention the actual remote button as terrible - and a few of zwave/zigbee buttons I tried left a lot to be desired (or lacked ST support)
IoT button:
a 2nd gen has just hit pre-order for february , that claims a larger battery (I believe the FCC filing also lists bluetooth) I leave that to those more in theloop to comment
requires a amazon ec2 account: https://aws.amazon.com - I am actually not entirely clear on billing but my few days of testing has resulted in a 2 cent bill.
start with setting up the ST Side using this guide: I used this guide: http://docs.smartthings.com/en/latest/smartapp-web-services-developers-guide/tutorial-part1.html
pointing the end result to whatever switch/device you want to use the button with - I used it with the Aon Labs Doorbell alert without loading a custom device handler, just as a zwave âswitchâ that seems to work best atm.
when you are done you should have a API Token and API URL - as exmplained towards the bottom of the ST docs you must click the âenable OAUTHâ button when setting up in order to see these options.
On the Amazon Side:
configure the Iot Button following the instructions: https://console.aws.amazon.com/iotv2/home?region=us-east-1#/connIntro
one of the important things to make sure to use the ânewâ verion of the console (you will be presented with this option on top in most cases) this helped me after failing to get this working some months back.
Set up the button to connect to your home wifi, load the necessary certificates and configured the âend pointsâ on amazon - you can use amazonâs demo template which we will reconfigure.
Once the template is in place, on the configuration tab - https://postimg.org/image/bes3uvh07/
- change the Runtime to Python 2.7
- handler to lambda_function.lambda_handler
- Descripon - I recommend putting in at least the serial # of your button in here for future reference
Rember, that the URL and Token will be unique for any smartapp you create.
also this is the simplified version that does not differentiate short/long/double press - in my case just turns âonâ the doorbell switch
here is my code:
import pycurl
import json
def lambda_handler(event, context):
# #############################
# Run Smarterthings Command
# #############################
#DoorBell Alarm
#
url = 'https://<your ST URL>'
#
data = json.dumps({"TextBody": "Some text"})
c = pycurl.Curl()
c.setopt(pycurl.HTTPHEADER, ['Authorization:Bearer <Your ST API Token>','content-type:application/json'])
c.setopt(pycurl.PUT, 1)
c.setopt(pycurl.POSTFIELDS, data)
c.setopt(pycurl.URL, url)
c.perform()
thanks