An AllThingsTalk starter kit experiment to receive notifications from a doorbell on your smartphone.
Ever been in a situation where you are working in the garden and someone rings at your door but you couldn’t hear the doorbell?
If yes, then this experiment is definitely for you.
This experiment will send out a notification to your smartphone when someone pushes the button representing our doorbell. It demonstrates
how you can connect hardware, use notifications and how to integrate an Android device as an IoT device.
Basic knowledge of Raspberry Pi, if you’ve never used an Raspberry Pi before we suggest the setup guide.
First we need to create our device. Log in to AllThingsTalk Maker and navigate to the ground in which you want to create your device. Next follow these instructions.
If you just created a new account, you will have a default ground called playground setup for you. You can use this ground to create your devices.
When you have executed the previous task, an example of the doorbell python application is already present on your Raspberry Pi.
sudo nano doorbell.py
1 | IOT.DeviceId = "" |
Copy and paste these credentails from the AllThingsTalk Maker into the script.
You find the device credentials under the SETUP tab of your device settings, which you can find behind the gear icon.
The Raspberry Pi will use C# applications which you write and modify on your computer.
You can find the smart doorbell
application in the experiments folder of the libraries you downloaded to your computer.
MainPage.xaml.cs
file in your project1 | _device = new Device("your client id", "your client key", _logger); |
You find the device credentials under the SETUP tab of your device settings, which you can find behind the gear icon.
sudo python doorbell.py
If everything went ok, you should see some lines appear in the shell and after the python script has been executed, you should now see the assets created under your device in the AllThingsTalk Maker (you may need to refresh your screen).
Now simply hit Run and your application will start. You should now see the assets created under your device in AllThingsTalk Maker.
It’s time to test the first part of the experiment. Click the button to initiate it. It will now show true or false depending on whether the button is down or not.
As a last step, we will create a pinboard for a nicer visualisation of our asset.
To visualise our date, we will create a pinboard. For more information on pinboards, please check how to use pinboards.
Now we will pin a control (visual representation) for our Push button asset.
To receive ground notifications, simply turn them on in the ground. You can do this as follows:
You will now receive a notification every time something in the ground changes. You can view these notifications both in the AllThingsTalk Maker
and AllThingsTalk Mobile!