Bosch hackathon tech
-
Upload
paul-hopton -
Category
Devices & Hardware
-
view
254 -
download
1
Transcript of Bosch hackathon tech
Hack The House
Technical Briefing
Hacking for the Internet of Things
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)
Devices at the Hackathon
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
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
Things you can code
B/S/H Oven and Dishwasher
Documentation:https://dev.relayr.io/
Support:The relayr team!
nest Thermostat and Smoke Alarms
Documentation:https://developer.nest.com/
Support:Francois GirodollePartner Evangelist - Nest Labs
Hacking the NetAtmo
Documentation:https://dev.netatmo.com/
Support:Dinu GhermanPython Evangelist - relayr
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
Hacking the Hue
Documentation:http://www.developers.meethue.com
Support:Khaled OsmanHardware Hacker - relayr
OnBoarding your BSH Device
relayr SDKs and API
HTML5 library initialize
//Initialize the Relayr SDK, you must give a RedirectURI and AppID
var relayr = RELAYR.init({
appId: "b616cb5d-17e6-4f57-aec5-e6eb1ab3de29",
});
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);
}
});
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}
});
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);
}
});
}
// 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));
}
});
}
// 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());
}
});
}
// 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");
}
});
The Other SDKs / Libraries and Frameworks
● NodeJS - Paul● iOS - Marcos● C# - Khaled● Ruby - sorry!● Python - DinuWould Like to see more? let’s talk :)
Where to get Help
May the Force be with you!