In this example we will connect the Grove Pushbutton to your Raspberry Pi to detect movement. When the button is pushed, a notification is sent to your smartphone to tell you someone is at the door.
If you are new to using a Raspberry Pi, we suggest you try the basic example on the previous page first.
No need to install the sdk and Grove Pi if you are using the AllThingsTalk Raspberry Pi kit. The SD card comes pre-installed.
If you are using your own Raspberry Pi, you can clone the AllThingsTalk SDK to it using
git clone git://github.com/allthingstalk/python-sdk.git.
Next install the sdk by browsing to the folder
cd python-sdkand the
pip3 install .command.
To install Grove Pi support, please follow these instructions.
An alternative to using a SSH client is hooking up a screen and keyboard to your Raspberry Pi.
Run the application with the command
If all went well, a doorbell asset is created under your device in AllThingsTalk Maker. Push the button and see if the value changes.
As a final step, we will set up an automation rule to notify you on your smartphone when someone presses the Doorbell button.