Top Banner
My Minecraft Smart Home Internet of Uncanny Things Sascha Wolter @ saschawolter January 2017 Source: Mattel's Barbie Hello Dreamhouse, via https://youtu.be/lgax5y7hVpc
38

My Minecraft Smart Home - EclipseCon France2018 · My Minecraft Smart Home Internet of Uncanny Things ... 1st-Person via Mouse and AWSD-Keys. ... Sascha Wolter, Hour of Code 2015,

May 28, 2018

Download

Documents

hoangkhanh
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: My Minecraft Smart Home - EclipseCon France2018 · My Minecraft Smart Home Internet of Uncanny Things ... 1st-Person via Mouse and AWSD-Keys. ... Sascha Wolter, Hour of Code 2015,

My Minecraft Smart HomeInternet of Uncanny Things

Sascha Wolter

@saschawolter

January 2017

Source: Mattel's Barbie Hello Dreamhouse, via https://youtu.be/lgax5y7hVpc

Page 2: My Minecraft Smart Home - EclipseCon France2018 · My Minecraft Smart Home Internet of Uncanny Things ... 1st-Person via Mouse and AWSD-Keys. ... Sascha Wolter, Hour of Code 2015,

Speed kills! In 1830 people thought, your brain stops working travelling more than 20 mph. And anyone going at more than 30 mph would have all air sucked out of them and would suffocate to death.

Source:Tony Robinson's Weird World of Wonders! British

Page 3: My Minecraft Smart Home - EclipseCon France2018 · My Minecraft Smart Home Internet of Uncanny Things ... 1st-Person via Mouse and AWSD-Keys. ... Sascha Wolter, Hour of Code 2015,

Internet of (Important) Things

Image: https://en.wikipedia.org/wiki/File:RegVarneyATM.jpg, https://www.ucc.asn.au/services/drink.ucc

1967 1982

Page 4: My Minecraft Smart Home - EclipseCon France2018 · My Minecraft Smart Home Internet of Uncanny Things ... 1st-Person via Mouse and AWSD-Keys. ... Sascha Wolter, Hour of Code 2015,

100 billion connections will be generated and

2 million new sensors will be deployed

every hour by 2025 (Huawei)

Page 5: My Minecraft Smart Home - EclipseCon France2018 · My Minecraft Smart Home Internet of Uncanny Things ... 1st-Person via Mouse and AWSD-Keys. ... Sascha Wolter, Hour of Code 2015,

Regular Users don’t Rule the Tech!

Today's Smart Home solutions are

not good enough for a mainstream

market. These solutions are well

suited to early adopters, but have so

far failed to attract mainstream

buyers. (see VisionMobile “The Smart

Home Landscape 2015”)

Progressive Thinkers Worriers

Antagonists

Page 6: My Minecraft Smart Home - EclipseCon France2018 · My Minecraft Smart Home Internet of Uncanny Things ... 1st-Person via Mouse and AWSD-Keys. ... Sascha Wolter, Hour of Code 2015,

Image: Electrolux presents Screenfridge 1999, http://www.electroluxgroup.com/en/history-1990-1999-764/

Value Proposition!

Page 7: My Minecraft Smart Home - EclipseCon France2018 · My Minecraft Smart Home Internet of Uncanny Things ... 1st-Person via Mouse and AWSD-Keys. ... Sascha Wolter, Hour of Code 2015,

Image: New York, ca. 1900 (http://ethw.org/Archives:Edison_Electric_Light_Sign/Ad)

Page 8: My Minecraft Smart Home - EclipseCon France2018 · My Minecraft Smart Home Internet of Uncanny Things ... 1st-Person via Mouse and AWSD-Keys. ... Sascha Wolter, Hour of Code 2015,

Image: Sascha Wolter

Page 9: My Minecraft Smart Home - EclipseCon France2018 · My Minecraft Smart Home Internet of Uncanny Things ... 1st-Person via Mouse and AWSD-Keys. ... Sascha Wolter, Hour of Code 2015,

Conversational User Experience

Amazon Echo: Alexa…

Google Home: Okay Google…

LingLong DingDong : DingDong DingDong …

Page 10: My Minecraft Smart Home - EclipseCon France2018 · My Minecraft Smart Home Internet of Uncanny Things ... 1st-Person via Mouse and AWSD-Keys. ... Sascha Wolter, Hour of Code 2015,

Source: MGM Child's Play (The Lakeshore Strangler), Vivid My friend Cayla

Internet of Uncanny Things

Uncanny Valley of Anticipation

Page 11: My Minecraft Smart Home - EclipseCon France2018 · My Minecraft Smart Home Internet of Uncanny Things ... 1st-Person via Mouse and AWSD-Keys. ... Sascha Wolter, Hour of Code 2015,

Worlds of Wonder's Julie doll (1987), which children could train to respond to their voice.

Speech Recognition

Source: https://youtu.be/UkU9SbIictc

Page 12: My Minecraft Smart Home - EclipseCon France2018 · My Minecraft Smart Home Internet of Uncanny Things ... 1st-Person via Mouse and AWSD-Keys. ... Sascha Wolter, Hour of Code 2015,

Source: Boris Adryan, 2015-10-20, http://iot.ghost.io/is-it-all-machine-learning/

Page 13: My Minecraft Smart Home - EclipseCon France2018 · My Minecraft Smart Home Internet of Uncanny Things ... 1st-Person via Mouse and AWSD-Keys. ... Sascha Wolter, Hour of Code 2015,

Source: http://www.jre-water.com/Suica/index.html

Voice and Facial Recognition

Gender, Age and Mood

Page 14: My Minecraft Smart Home - EclipseCon France2018 · My Minecraft Smart Home Internet of Uncanny Things ... 1st-Person via Mouse and AWSD-Keys. ... Sascha Wolter, Hour of Code 2015,

Start doing

a smatteringof REST with SSE

See also http://appinventor.mit.edu/

Page 15: My Minecraft Smart Home - EclipseCon France2018 · My Minecraft Smart Home Internet of Uncanny Things ... 1st-Person via Mouse and AWSD-Keys. ... Sascha Wolter, Hour of Code 2015,

Minecraft 101

Good to know• See http://minecraft.gamepedia.com/

• Several Versions• Pocket Edition (PE, e.g. Android, HoloLens), Pi

Edition, Console Edition (e.g. Xbox, PlayStation), Education, etc.

• Samples and code in this presentation is based on Minecraft 1.8.9

• Gamemodes• Survival

• Creative (to ignore recipes)

• Inventory and Recipes

• Redstones

• …

Cheats via t-Key• /help

• /weather clear

• /weather rain

• /time set day

• /time set night

• /gamemode creative

• /gamerule doDaylightCycle false

• /tp Player x y z

Inventory via e-Key

1st-Person via Mouse and AWSD-Keys

Page 16: My Minecraft Smart Home - EclipseCon France2018 · My Minecraft Smart Home Internet of Uncanny Things ... 1st-Person via Mouse and AWSD-Keys. ... Sascha Wolter, Hour of Code 2015,
Page 17: My Minecraft Smart Home - EclipseCon France2018 · My Minecraft Smart Home Internet of Uncanny Things ... 1st-Person via Mouse and AWSD-Keys. ... Sascha Wolter, Hour of Code 2015,

see also Project Malmo (http://research.microsoft.com/en-US/groups/mip-ai/default.aspx)

Start doing

a smatteringof REST with SSE

Page 18: My Minecraft Smart Home - EclipseCon France2018 · My Minecraft Smart Home Internet of Uncanny Things ... 1st-Person via Mouse and AWSD-Keys. ... Sascha Wolter, Hour of Code 2015,
Page 19: My Minecraft Smart Home - EclipseCon France2018 · My Minecraft Smart Home Internet of Uncanny Things ... 1st-Person via Mouse and AWSD-Keys. ... Sascha Wolter, Hour of Code 2015,

Minecraft Forge: Simple Modding

Bare minimum

Get the Minecraft Forge Mod Development Kit (MDK) from http://files.minecraftforge.net/

Page 20: My Minecraft Smart Home - EclipseCon France2018 · My Minecraft Smart Home Internet of Uncanny Things ... 1st-Person via Mouse and AWSD-Keys. ... Sascha Wolter, Hour of Code 2015,

Java and Minecraft Forge: Setup and Lifecycle

@Mod(modid = SmartHomeMod.MODID, version = SmartHomeMod.VERSION)

public class SmartHomeMod {

public static final String MODID = "smarthomemod";

public static final String VERSION = "0.1";

// Happens as #1 right before Minecraft loads. Used for most registration.

@EventHandler

public void preInit(FMLPreInitializationEvent event) {}

// Happens as #2 when Minecraft loads.

@EventHandler

public void init(FMLInitializationEvent event) {}

// Happens #3 when World generators and alike are loaded.

@EventHandler

public void postInit(FMLPostInitializationEvent event) {}

// Happens #4 right before starting the server.

@EventHandler

public void registerCommands(FMLServerStartingEvent event) {}

}

Event-Subscriber, Items, and Blocks

Resources

Commands

main

Lifecycle

Page 21: My Minecraft Smart Home - EclipseCon France2018 · My Minecraft Smart Home Internet of Uncanny Things ... 1st-Person via Mouse and AWSD-Keys. ... Sascha Wolter, Hour of Code 2015,

Minecraft Forge: Simple Command

public class HelloCommand extends CommandBase {

public static final String COMMAND_NAME = "hello";

@Override

public String getCommandName() {

return COMMAND_NAME;

}

@Override

public String getCommandUsage(ICommandSender sender) {

return String.format("/%s <name>", COMMAND_NAME);

}

@Override

public void processCommand(ICommandSender sender, String[] args) throws CommandException {

if (sender instanceof EntityPlayer) { ... } else { ... }

}

}

Command Name

Command Help

Command Code

Page 22: My Minecraft Smart Home - EclipseCon France2018 · My Minecraft Smart Home Internet of Uncanny Things ... 1st-Person via Mouse and AWSD-Keys. ... Sascha Wolter, Hour of Code 2015,

Use SmartHome Plug-In via SSE and REST API

• List of Things via HTTP Get http://localhost:9998/rest/things

• Server Sent Events (SSE)http://localhost:9998/rest/events

• Helps to check what’s possible and what’s going on

• Player

• Switches

• Doors

• Sensor

• …

• Unique ID is always location

• Relevant data is separated into components (channels)

Page 23: My Minecraft Smart Home - EclipseCon France2018 · My Minecraft Smart Home Internet of Uncanny Things ... 1st-Person via Mouse and AWSD-Keys. ... Sascha Wolter, Hour of Code 2015,

Minecraft Spigot: Simple Plug-in

Bare minimum

Get the Minecraft Spigot Server, API, and Build Tools from https://www.spigotmc.org/wiki/buildtools

Page 24: My Minecraft Smart Home - EclipseCon France2018 · My Minecraft Smart Home Internet of Uncanny Things ... 1st-Person via Mouse and AWSD-Keys. ... Sascha Wolter, Hour of Code 2015,

Minecraft Spigot: SmartHome.java

public class SmartHome extends JavaPlugin {

// Fired when plugin is first enabled

@Override

public void onEnable() {

// Register event listener

// Could handle PlayerJoinEvent, BlockRedstoneEvent, PlayerInteractEvent, BlockPlaceEvent...

// ...using @EventHandler annotation

Bukkit.getPluginManager().registerEvents(new BlockChangedListener(), this);

// Register command (set an instance of command class as executor)

this.getCommand("sendCommand").setExecutor(new SendCommand());

}

// Fired when plugin is disabled

@Override

public void onDisable() {

}

}

main

Lifecycle

Commands

Events

Page 25: My Minecraft Smart Home - EclipseCon France2018 · My Minecraft Smart Home Internet of Uncanny Things ... 1st-Person via Mouse and AWSD-Keys. ... Sascha Wolter, Hour of Code 2015,

Minecraft Spigot: Simple Command

public class SendCommand implements CommandExecutor {

@Override

public boolean onCommand(CommandSender sender,

Command command, String label, String[] args) {

Bukkit.broadcastMessage("onCommand " + args[0]);

Bukkit.getLogger().info("onCommand " + args[0]);

return false;

}

}

Command Code

Loggin/Messages

Page 26: My Minecraft Smart Home - EclipseCon France2018 · My Minecraft Smart Home Internet of Uncanny Things ... 1st-Person via Mouse and AWSD-Keys. ... Sascha Wolter, Hour of Code 2015,

ESH

Core

Device

BindingsDevice

BindingsDevice

Bindings

Internet of Things Platform

ESH

Core

Device

BindingsDevice

BindingsDevice

Bindings

Internet of Things Platform

ESH

Core

Device

BindingsDevice

BindingsDevice

Bindings

Developer

CommunityDevice Vendor

XY Company

Internet of Things Platform

ESH

Core

Device

BindingsDevice

BindingsDevice

Bindings

Eclipse SmartHome as open technology for Prosumers

Page 27: My Minecraft Smart Home - EclipseCon France2018 · My Minecraft Smart Home Internet of Uncanny Things ... 1st-Person via Mouse and AWSD-Keys. ... Sascha Wolter, Hour of Code 2015,

https://github.com/wolter

Page 28: My Minecraft Smart Home - EclipseCon France2018 · My Minecraft Smart Home Internet of Uncanny Things ... 1st-Person via Mouse and AWSD-Keys. ... Sascha Wolter, Hour of Code 2015,

Minecraft Bindingfor Eclipse SmartHome• Integrating Devices

into Eclipse SmartHome

1. Create OSGi skeleton

2. Edit identifiers and parameters

3. Add binding logic

4. Export and deploy

5. Test

create_binding_skeleton

Page 29: My Minecraft Smart Home - EclipseCon France2018 · My Minecraft Smart Home Internet of Uncanny Things ... 1st-Person via Mouse and AWSD-Keys. ... Sascha Wolter, Hour of Code 2015,

Minecraft Bindingfor Eclipse SmartHome@Override

public void handleCommand(ChannelUID channelUID, Command command) {

switch (channelUID.getId()) {

case CHANNEL_POWERED:

if (command instanceof OnOffType) {

MinecraftThingCommand minecraftCommand = new MinecraftThingCommand();

minecraftCommand.id = id;

minecraftCommand.component = new MinecraftThingComponent();

minecraftCommand.component.type = MinecraftThingComponentType.POWERED;

minecraftCommand.component.state = command.equals(OnOffType.ON) ? true : false;

postState(minecraftCommand);

}

break;

case CHANNEL_OPEN:

...

}

}

RESTful POST

Handle Command

Or delegate to a Bridge.

Page 30: My Minecraft Smart Home - EclipseCon France2018 · My Minecraft Smart Home Internet of Uncanny Things ... 1st-Person via Mouse and AWSD-Keys. ... Sascha Wolter, Hour of Code 2015,

Minecraft Bindingfor Eclipse SmartHome

Runnable runnable = new Runnable() {

@Override

public void run() {

requestState();

}

};

refreshJob = scheduler.scheduleAtFixedRate(runnable, 0, refreshInterval, TimeUnit.SECONDS);

...

MinecraftThing minecraftThing = gson.fromJson(reader, MinecraftThing.class);

MinecraftThingComponent component minecraftThing.getComponentByType(MinecraftThingComponentType.POWERED);

OnOffType state = ((Boolean) component.state) ? OnOffType.ON : OnOffType.OFF;

updateState(CHANNEL_POWERED, state);

RESTful GET

Update Channel

Use SSE instead!

Page 31: My Minecraft Smart Home - EclipseCon France2018 · My Minecraft Smart Home Internet of Uncanny Things ... 1st-Person via Mouse and AWSD-Keys. ... Sascha Wolter, Hour of Code 2015,

Source: https://mojang.com/2016/06/weve-sold-minecraft-many-many-times-look/

Why?

Page 32: My Minecraft Smart Home - EclipseCon France2018 · My Minecraft Smart Home Internet of Uncanny Things ... 1st-Person via Mouse and AWSD-Keys. ... Sascha Wolter, Hour of Code 2015,

Design and Hybrid Thinking

Page 33: My Minecraft Smart Home - EclipseCon France2018 · My Minecraft Smart Home Internet of Uncanny Things ... 1st-Person via Mouse and AWSD-Keys. ... Sascha Wolter, Hour of Code 2015,

Construction Kit

APIs, Services

Software-Architecture (e.g. MVVM)

Page 34: My Minecraft Smart Home - EclipseCon France2018 · My Minecraft Smart Home Internet of Uncanny Things ... 1st-Person via Mouse and AWSD-Keys. ... Sascha Wolter, Hour of Code 2015,

Value Innovation

Practice and Exchange

to find new opportunities.

Source: Siematic, Discovery Channel, BSH, Microsoft, ZDF

Page 35: My Minecraft Smart Home - EclipseCon France2018 · My Minecraft Smart Home Internet of Uncanny Things ... 1st-Person via Mouse and AWSD-Keys. ... Sascha Wolter, Hour of Code 2015,

Businesses are coming to realize that attracting developers is the fastest route to innovation. Moreover, attracting developers means attracting external investment, which finances innovation and expansion.

Source: Benno Luthiger, Open-Source-Jahrbuch 2004

MYTHS OF TYPICAL DEVELOPER / BORN TO CODE

Innovation Prosumer: Consumer and Producer

Millions and millions of dollars are being spent to attract developers: The millions of dollars in developer marketing efforts serve one purpose: to persuade developers to use a specific platform, network, tool or API set to generate innovations and to reach more consumers. In short: Developers consume an Platform, API, etc. and produce something based on it.

Source: Developer Economics 2012, www.developereconomics.com

Some Consumers turn into Developers to solve their needs.

Video: youtube/Microsoft

Page 36: My Minecraft Smart Home - EclipseCon France2018 · My Minecraft Smart Home Internet of Uncanny Things ... 1st-Person via Mouse and AWSD-Keys. ... Sascha Wolter, Hour of Code 2015,

Responsibility and DogfoodingHippocratic Oath and Eating your own Dogfood.

Teaching Responsibility and Enlightenmentversus Believe in Wonders (i.e. Politics and Regulation)

Image: Sascha Wolter, Hour of Code 2015, see also https://code.org/learn

Page 37: My Minecraft Smart Home - EclipseCon France2018 · My Minecraft Smart Home Internet of Uncanny Things ... 1st-Person via Mouse and AWSD-Keys. ... Sascha Wolter, Hour of Code 2015,

Video: https://youtu.be/xgakdcEzVwgl

My Minecraft Smart HomeInternet of Uncanny Things

Sascha Wolter

@saschawolter

January 2017

more at http://wolter.biz

Page 38: My Minecraft Smart Home - EclipseCon France2018 · My Minecraft Smart Home Internet of Uncanny Things ... 1st-Person via Mouse and AWSD-Keys. ... Sascha Wolter, Hour of Code 2015,

Software Developer (m/w) Connected Home Runtime

Senior Software Developer (m/w) Connected Home Frontend

Senior Software Developer (m/w) Connected Home Community

Senior Developer Evangelist Connected Home

Senior UX Designer

31.01.2017 38

WE ARE HIRING

Jobs

https://telekom.jobs/global-careers (Keyword Connected Home)