32
Hack The House Technical Briefing

Bosch hackathon tech

Embed Size (px)

Citation preview

Page 1: Bosch hackathon tech

Hack The House

Technical Briefing

Page 2: Bosch hackathon tech

Hacking for the Internet of Things

Page 3: Bosch hackathon tech

3 simple rules

1. Delays are to be expecteda. Non-blocking asynchronous codeb. Work with mocksc. let the user know you are working (spinners, etc)

2. Study the APIs & SDKs3. Start small and add features - MVP thinking

a. Do the Hard stuff firstb. Have fun (at the end)

Page 4: Bosch hackathon tech

Devices at the Hackathon

Page 5: Bosch hackathon tech

Things you can code

1. Siemens HS658GXS6 and Bosch HRG636XS6 Home Connect Smart Ovens2. Siemens SN478S06TE and Bosch SMU88TS06E Home Connect Smart Dishwashers3. relayr WunderBars4. 5 nest Thermostats5. 4 nest Protect Smoke and CO Detectors6. NetAtmo Weather Stations7. 4 Foscam IP Cameras8. 12 Philips Hue Light bulbs

Page 6: Bosch hackathon tech

Things you retro-fit

1. Siemens KS36FPI40 and Bosch KSF36PI40 Refrigerators2. Siemens WM14Y7W4 and Bosch WAW28640 Washing

Machines3. Siemens TE803509DE and Bosch TES80551DE Cofee

Machines4. Siemens TB76XTRMW and Bosch TDA703021 Irons

Page 7: Bosch hackathon tech

Things you can code

Page 8: Bosch hackathon tech

the WunderBar

Documentation:https://dev.relayr.io/

Support:The relayr team!

Page 9: Bosch hackathon tech

B/S/H Oven and Dishwasher

Documentation:https://dev.relayr.io/

Support:The relayr team!

Page 10: Bosch hackathon tech

nest Thermostat and Smoke Alarms

Documentation:https://developer.nest.com/

Support:Francois GirodollePartner Evangelist - Nest Labs

Page 11: Bosch hackathon tech

Hacking the NetAtmo

Documentation:https://dev.netatmo.com/

Support:Dinu GhermanPython Evangelist - relayr

Page 12: Bosch hackathon tech

Hacking the Foscam

Documentation:https://github.com/quatanium/python-onvif“http://foscam.us/downloads/

IP Camera User Manual for HD Indoor_English_V2.0.pdf”

Support:Daniel MancusoHardware Engineer - relayr

Page 13: Bosch hackathon tech

Hacking the Hue

Documentation:http://www.developers.meethue.com

Support:Khaled OsmanHardware Hacker - relayr

Page 14: Bosch hackathon tech

OnBoarding your BSH Device

Page 15: Bosch hackathon tech
Page 16: Bosch hackathon tech
Page 17: Bosch hackathon tech
Page 18: Bosch hackathon tech
Page 19: Bosch hackathon tech
Page 20: Bosch hackathon tech
Page 21: Bosch hackathon tech
Page 22: Bosch hackathon tech

relayr SDKs and API

Page 23: Bosch hackathon tech

HTML5 library initialize

//Initialize the Relayr SDK, you must give a RedirectURI and AppID

var relayr = RELAYR.init({

appId: "b616cb5d-17e6-4f57-aec5-e6eb1ab3de29",

});

Page 24: Bosch hackathon tech

HTML5 library Get Data

//If you have a token and your device ID, you can start listening to your

device without going through the login process

relayr.devices().getDeviceData({

token: "p7xjSVAhqP9gtqvg9aGD_dZ4DDzlSJHw",

deviceId:"c9b48194-bd71-42a6-9c11-f6901b9c9017",

incomingData: function(data){

console.log("data from single sensor with specific token", data);

}

});

Page 25: Bosch hackathon tech

HTML5 library Send Commands

//Turn you're BSH oven on

relayr.devices().sendCommand({

//you're relayr token if you haven't included it before

token: "p7xjSVAhqP9gtqvg9aGD_dZ4DDzlSJHw",

//relayr ID of you're oven

deviceId:"c9b48194-bd71-42a6-9c11-f6901b9c9017",

//turns on the Oven

command:{"path":"power_unit", "command": "power", "value": 2}

});

Page 26: Bosch hackathon tech

Android SDK

// INITIALIZE

private void loadUserInfo() {

RelayrSdk.getRelayrApi()

.getUserInfo()

.subscribeOn(Schedulers.io())

.observeOn(AndroidSchedulers.mainThread())

.subscribe(new Subscriber<User>() {

//...

@Override

public void onNext(User user) {

loadDevices(user.id);

}

});

}

Page 27: Bosch hackathon tech

// LOAD DEVICES

private void loadDevices(String userId) {

RelayrSdk.getRelayrApi()

.getTransmitters(userId)

.flatMap(new Func1<List<Transmitter>, Observable<List<TransmitterDevice>>>() {

@Override

public Observable<List<TransmitterDevice>> call(List<Transmitter> transmitters)

{

return

RelayrSdk.getRelayrApi().getTransmitterDevices(transmitters.get(0).id);

}

})

.subscribeOn(Schedulers.io())

.observeOn(AndroidSchedulers.mainThread())

.subscribe(new Subscriber<List<TransmitterDevice>>() {

//...

@Override

public void onNext(List<TransmitterDevice> devices) {

if (!devices.isEmpty())

subscribeForUpdates(devices.get(0));

}

});

}

Page 28: Bosch hackathon tech

// HANDLE DATA

private void subscribeForUpdates(TransmitterDevice transmitterDevice) {

RelayrSdk.getWebSocketClient()

.subscribe(transmitterDevice)

.observeOn(AndroidSchedulers.mainThread())

.subscribe(new Observer<Object>() {

@Override

public void onCompleted() {

}

@Override

public void onError(Throwable e) {

e.printStackTrace();

}

@Override

public void onNext(Object o) {

//Parse data depending on device model

Log.i("DATA", o.toString());

}

});

}

Page 29: Bosch hackathon tech

// Send a Command

int value = 2;

String path = "power_unit";

String command = "power";

Command mCommand = new Command(path, command, value);

RelayrSdk.getRelayrApi()

.sendCommand(deviceId, mCommand)

.observeOn(AndroidSchedulers.mainThread())

.subscribe(new Observer<Void>() {

@Override

public void onCompleted() {

}

@Override

public void onError(Throwable e) {

e.printStackTrace();

}

@Override

public void onNext(Void aVoid) {

Log.i("TAG", "Command sent");

}

});

Page 30: Bosch hackathon tech

The Other SDKs / Libraries and Frameworks

● NodeJS - Paul● iOS - Marcos● C# - Khaled● Ruby - sorry!● Python - DinuWould Like to see more? let’s talk :)

Page 31: Bosch hackathon tech

Where to get Help

Page 32: Bosch hackathon tech

May the Force be with you!