Peter, GitHub
Active open source contributor
Speaker
COSCUP、MOPCON......
An associate engineer
DevOps
Back-end
System Architecture Researching
Web Application Security
PHP, Python and JavaScript
Industrial Technology Research Institute
Smart Grid Technology (2017~2021)
Institute for Information Industry
Database, Data platform architecture (2021~)
The motivation
IoT and smart home introduction
Choosing the proper IoT devices, manual or existed?
The fundamentals are for initializing selected IoT devices setting
What's IFTTT? And how to use the IFTTT service?
The demonstration for Integrating the IoT devices with IFTTT
Using the PHP program to develop the Webhook on IFTTT service
The demonstration for the completed smart home application
Estimating the budget & Summary
It's hard for the old people to switch the night light
I don't like to switch the night light manually everyday
Internet of Things
Smart Home
Choosing the proper IoT devices, manual or existed?
Manual
Pros
It can control all of components. E.g. hardware and software.
It's for maker
Cons
It's hard and unfriendly for web or software developers.
Existed
Pros
It's the completed products.
It's friendly for web and software developers.
Cons
It cannot set some detailed setting for the products.
It's not full-control for the hardware.
Customized hardware specifications or behaviors are limited.
Choosing the proper IoT devices, manual or existed?
Choosing the proper IoT devices, manual or existed?
The fundamentals are for initializing selected IoT devices setting
Prepare for the WiFi at home
Download the Wemo App
Check the Wemo device id
Pairing the device in the App
Done!
The fundamentals are for initializing selected IoT devices setting
The fundamentals are for initializing selected IoT devices setting
The fundamentals are for initializing selected IoT devices setting
The fundamentals are for initializing selected IoT devices setting
The fundamentals are for initializing selected IoT devices setting
Prepare for the WiFi at home
Download the Wemo App
Check the Wemo device id
Pairing the device in the App
Done!
The fundamentals are for initializing selected IoT devices setting
The fundamentals are for initializing selected IoT devices setting
The fundamentals are for initializing selected IoT devices setting
Date and time trigger is not good enough
It's not good enough to customized specific date time
Consider using the webhook trigger
Integrating the Existed Componenets with WeMo Smart Plug
Integrating the Existed Componenets with WeMo Smart Plug
Integrating the Existed Componenets with WeMo Smart Plug
Using the PHP program to develop the Webhook on IFTTT service
Using the PHP program to develop the Webhook on IFTTT service
The demonstration for the completed smart home application
D-Link DSP-W215 Example
localadmin@clickhouse02:~$ mkdir light-dlink
localadmin@clickhouse02:~$ cd light-dlink/
localadmin@clickhouse02:~/light-dlink$ php ~/composer.phar require lee/light-controller
Info from https://repo.packagist.org: #StandWithUkraine
Using version ^0.1.0 for lee/light-controller
......
Generating autoload files
4 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
localadmin@clickhouse02:~/light-dlink$
The demonstration for the completed smart home application
D-Link DSP-W215 Example
The demonstration for the completed smart home application
D-Link DSP-W215 Example
The demonstration for the completed smart home application
D-Link DSP-W215 Example
The demonstration for the completed smart home application
D-Link DSP-W215 Example
The demonstration for the completed smart home application
D-Link DSP-W215 Example
The demonstration for the completed smart home application
D-Link DSP-W215 Example
The demonstration for the completed smart home application
D-Link DSP-W215 Example
The demonstration for the completed smart home application
D-Link DSP-W215 Example
The demonstration for the completed smart home application
D-Link DSP-W215 Example
The demonstration for the completed smart home application
D-Link DSP-W215 Example
localadmin@clickhouse02:~/light-dlink$ cat light.php
<?php
require_once __DIR__ . '/vendor/autoload.php';
use lee\Light;
$light = new Light('webhook-maker-service-key', 'dlink-light-on');
$response = $light->sendRequest();
var_dump($response);
localadmin@clickhouse02:~/light-dlink$ php light.php
object(GuzzleHttp\Psr7\Response)#29 (6) {
["reasonPhrase":"GuzzleHttp\Psr7\Response":private]=>
string(2) "OK"
["statusCode":"GuzzleHttp\Psr7\Response":private]=>
int(200)
["headers":"GuzzleHttp\Psr7\Response":private]=>
array(13) {
["Content-Type"]=>
array(1) {
[0]=>
string(24) "text/html; charset=utf-8"
........
The demonstration for the completed smart home application
D-Link DSP-W215 Example
localadmin@clickhouse02:~/light-dlink$ cat light.php
<?php
require_once __DIR__ . '/vendor/autoload.php';
use lee\Light;
$light = new Light('webhook-maker-service-key', 'dlink-light-off');
$response = $light->sendRequest();
var_dump($response);
localadmin@clickhouse02:~/light-dlink$ php light.php
object(GuzzleHttp\Psr7\Response)#29 (6) {
["reasonPhrase":"GuzzleHttp\Psr7\Response":private]=>
string(2) "OK"
["statusCode":"GuzzleHttp\Psr7\Response":private]=>
int(200)
["headers":"GuzzleHttp\Psr7\Response":private]=>
array(13) {
["Content-Type"]=>
array(1) {
[0]=>
string(24) "text/html; charset=utf-8"
........
The demonstration for the completed smart home application
D-Link DSP-W215 Example
<?php
require_once __DIR__ . '/vendor/autoload.php';
use lee\Light;
$light = new Light('webhook-maker-service-key', 'dlink-light-on');
$response = $light->sendRequest();
var_dump((string)$response->getBody());
localadmin@clickhouse02:~/light-dlink$
ocaladmin@clickhouse02:~/light-dlink$ php light.php
string(59) "Congratulations! You've fired the dlink-light-on json event"
localadmin@clickhouse02:~/light-dlink$
The demonstration for the completed smart home application
D-Link DSP-W215 Example
The demonstration for the completed smart home application
D-Link DSP-W215 Example
The demonstration for the completed smart home application
D-Link DSP-W215 Example
localadmin@clickhouse02:~/light-dlink$ cat light.php
<?php
require_once __DIR__ . '/vendor/autoload.php';
use lee\Light;
$light = new Light('webhook-maker-service-key', 'dlink-light-off');
$response = $light->sendRequest();
var_dump((string)$response->getBody());
localadmin@clickhouse02:~/light-dlink$ php light.php
string(60) "Congratulations! You've fired the dlink-light-off json event"
localadmin@clickhouse02:~/light-dlink$
Checking whether it's high temperature every five minutes!
root@web-monetization-demo:~# cat /var/www/2020datathon.peterli.website/html/delay.php
<?php
$postdata = file_get_contents("php://input", 'r');
$decoded = json_decode($postdata, true);
sleep(60);
$eventname = 'dlink-light-off';
$key = 'webhook-maker-key';
$url = sprintf('https://maker.ifttt.com/trigger/%s/json/with/key/%s', $eventname, $key);
$curl = curl_init($url);
curl_exec($curl);
curl_close($curl);
Hardware Device
Wemo Smart Plug: NT $899
D-Link DSP-W215: NT $499
(Acer Air Monitor): NT $1990 or NT $4490
DigitalOcean VM
NT $300/month (NT $3600/year)
Upgrading IFTTT Plan (Choosing the one of)
NT $150/month
NT $75/month
The paired Smart plug Device will be gone
Pairing the device again
The reason is about WiFi signal is unstable
Trying to improve the WiFi signal
The light bulb is broken
This reason cannot be avoided
This situation is not happened frequently
It only switch the bulb manually
The light switch is turned off
The light switch always should be turned on
The reason is someone turn off the light switch
Telling them: don't switch the light
https://ifttt.com/maker_webhooks
https://ifttt.com/wemo_switch
https://ifttt.com/mydlink
https://ifttt.com/Air_Monitor
https://github.com/peter279k/ifttt-web-monitor
https://github.com/peter279k/ifttt-wemo-light-controller
https://github.com/peter279k/light-controller