Samsung SmartThings Hub (STH-ETH-250) [B195]





https://www.youtube.com/watch?v=ERabX0zL7ag


* Specs

- Description

The brain of your smart home.

Connect wirelessly with a wide range of smart devices and make them work together.

Monitor and control connected devices in your home using a single SmartThings app for iPhone or Android.

Receive alerts from connected devices when there’s unexpected activity in your home.

Automate connected devices in your home and set them to turn on or off when doors are opened, as people come and go, and much more.

Manage connected devices in your home with SmartThings Routines for Good Morning, Goodbye, Good Night, and more.

Control connected devices in your home with voice commands using SmartThings and Amazon Alexa or Google Home.

Requires an internet-connected Wi-Fi router with an available ethernet port, plus the free SmartThings app for Android (4.1 or later) or iPhone (iOS 9.0 or later).


- Specs

Model number: STH-ETH-250

Power source: Battery, Wall-Powered

Color: White

Weight: 7.68 oz

Dimensions: 4.2" x 4.9" x 1.3"

Protocol: ZigBee, Z-Wave, Cloud-to-Cloud, LAN

Battery type: 4 AA batteries


* Contents

1. Install SmartThings Hub

- It needs welcome code (6 digit)

- power : AA battery 4ea or AC


2. Connect to SmartThings Hub and SmartThings Classic Mobile App

- add new SmartThings User


- create Samsung Account 


- After login, Confirm your country



- Enter Code for activate your SmartThings secure Code.


- Connect your Hub 


- Setup your location


- Setting up your hub


- Setup success!


- Adjust Battery Settings


- Finished


- Status Check : Hub is Online in menu


- Reference

https://shop.smartthings.com/products/samsung-smartthings-hub


Posted by RDIoT
|

Pi4J + Amazon S3 REST API + Amazon Athena [P019]






https://www.youtube.com/watch?v=G-Ot7oh4_jk


GitHub : https://github.com/rdiot/rdiot-p019.git


* Parts

- Raspberry Pi2

Temperature and humidity DHT11 sensor module (KY-015) [S008]



* Contents

- Connect 

S - Signal GPIO3

middle - VCC

- - GND


1. Getting sensor value by Pi4J (Java I/O library for the Raspberry Pi) and then upload to amazon s3.

 : Run the java application

$ java -Dpi4j.linking=dynamic -jar pi4j_s3rest-0.0.1-SNAPSHOT.jar


2. Check the upload status in the amazon console. (s3)




3. Setup Amazon Athena .

- add database : pisensor

- add table : temperature


- DDL (add table)

CREATE EXTERNAL TABLE IF NOT EXISTS piSensor.temperature (

  `name` string,

  `value` float 

)

ROW FORMAT SERDE 'org.openx.data.jsonserde.JsonSerDe'

WITH SERDEPROPERTIES (

  'serialization.format' = '1'

) LOCATION 's3://rdkim-test/'

TBLPROPERTIES ('has_encrypted_data'='false');


4. SQL Query in the Amazon Athena

example : SELECT * FROM "pisensor"."temperature" limit 10;



- Pi4J Java Maven

<dependency>

    <groupId>com.pi4j</groupId>

    <artifactId>pi4j-core</artifactId>

   <version>1.1</version>

</dependency>


- project maven pom.xml 

 : https://github.com/rdiot/rdiot-p019/blob/master/pom.xml


- source : main : https://github.com/rdiot/rdiot-p019/blob/master/pi4j_s3rest/App.java

- source : pi4j : https://github.com/rdiot/rdiot-p019/blob/master/pi4j/dht11.java

- source : s3 rest api header aws sig4 : https://github.com/rdiot/rdiot-p019/blob/master/s3rest/auth/AWS4SignerForAuthorizationHeader.java


- Key Code

     dht11 dht = new dht11();

   

        for (int i=0; i<10; i++) {

            try {

Thread.sleep(2000);

} catch (InterruptedException e) {

e.printStackTrace();

}

            

            objectContent = dht.getTemperature();

            

            if(objectContent != null) {

        System.out.println(objectContent);

        putS3Object(bucketName, regionName, awsAccessKey, awsSecretKey);

            break;

            }            

         }     



- Reference

 : Pi4J Project : http://pi4j.com

 : Pi4J GitHub : https://github.com/Pi4J/pi4j

 : get dht11 : https://stackoverflow.com/questions/28486159/read-temperature-from-dht11-using-pi4j

 : Amazon S3 Rest API : https://docs.aws.amazon.com/AmazonS3/latest/API/Welcome.html


Posted by RDIoT
|

Amazon Polly + Google Home + Sonoff wifi [P018]





https://www.youtube.com/watch?v=IX2mUb73he8


GitHub : https://github.com/rdiot/rdiot-p018.git


* Parts

Google Home AI Speaker [B187]

Sonoff ITEAD WiFi Switch Module (ESP8266) [S198]

Amazon Polly TTS [P017]


* Contents

- Install AWS CLI in Raspberry Pi

wget https://s3.amazonaws.com/aws-cli/awscli-bundle.zip

$ unzip awscli-bundle.zip 

$ sudo ./install -i /usr/local/aws -b /usr/local/bin/aws


- Config AWS CLI

$ aws configure


- Java amazon polly development

 : maven : pom.xml : https://github.com/rdiot/rdiot-p018/blob/master/pom.xml

 : Source : https://github.com/rdiot/rdiot-p018/blob/master/PollyDemo.java

 : Binary : polly_sonoff.tar.gz

 : command.txt : ON or OFF 



- Sonoff Work with Google Home 

- How to connect Sonoff smart ewelink to Google Assistant

1) Tap Home control in Googlt Home App Menu

2) Uner Devices, tap the + icon in the bootom right. (add devices)

3) Tap Smart We Link 

4) Enter Your eWeLink account email/phone number. (need countrycode and account, password)

5) After Logging in successfully, it will display the device.




- Run java amazon polly application

$ java - jar polly-0.0.1-SNAPSHOT.jar 



Posted by RDIoT
|