T he Dog Gateway A SHORT INTRODUCTION A brief overview on the Dog gateway, starting from the design principles and going deep into the gateway architecture and modules, with some application sample http://dog-gateway.github.io/
WIRELESS Protocol Jungle WIRED WIRED 4/3/2014 The Dog Gateway - Dario Bonino
Open Horizontal AmI Architectures Application Application Application Application Application Real time processing Intelligence (service, agent) API Basic services Intelligence Data exchange Neutral representation Protocol interfaces/drivers D D D D D D D D D D D D 2013/2014 Ambient intelligence: technology and design 3
The Dog Gateway Mobile, Web, Home Display, User User Multi Touch, Accessibility, Interface User Natural language , … Interface Interface ERP, Web services, Stream Data processors, Datawarehouse analysis Device abstraction, Event Dog abstraction, State Bundles abstraction, Rules engine , … Ethernet, Wi-Fi, USB Bus-to-IP gateway GW GW Bus-to-serial gateway Domotic bus (wired, wireless) Smart Domotic devices (switches, D D D D D D D D Applianc buttons, relays, sensors, meters , …) e 2013/2014 Ambient intelligence: technology and design 4
Design objectives EASY DEVELOPMENT (EXTERNAL APPLICATIONS) SINGLE POINT OF ACCESS SINGLE LANGUAGE / PROTOCOL NETWORK-LEVEL INDEPENDENCE FULLY INTEGRATED SYSTEM SUPPORT FOR MANY TECHNOLOGIES FLEXIBILITY 4/3/2014 The Dog Gateway - Dario Bonino
Abstraction / Information hiding SEGREGATION OF THE “PARTS” THAT ARE MOST LIKELY TO CHANGE, THUS PROTECTING OTHER COMPONENTS FROM EXTENSIVE MODIFICATION IF THE “PARTS” ARE CHANGED APPLICATION PROGRAMMING SINGLE INTERFACE SLOWLY EVOLVING INFORMATION HIDING CHANGES IN PARADIGMS NETWORK CHANGES IN TIME CHANGES IN FEATURES 4/3/2014 The Dog Gateway - Dario Bonino
Natural Modeling TECHNOLOGY INDEPEDENT HOME MODELING Representing devices, appliances, furniture and home environments in a technology independent, yet actionable manner.
Natural Modeling LAMP On Off 4/3/2014 The Dog Gateway - Dario Bonino
Natural Modeling Meter + Plug On Off Energy Power 4/3/2014 The Dog Gateway - Dario Bonino
Natural Modeling *10*1*1# *10*0*1# On Off 4/3/2014 The Dog Gateway - Dario Bonino
A Device is... WHAT IT CAN DO UPON COMMAND (FUNCTIONALITIES) WHAT IT CAN BE (STATES) WHAT IT CAN DO AUTONOMOUSLY (NOTIFICATIONS) 4/3/2014 The Dog Gateway - Dario Bonino
Device types … 4/3/2014 The Dog Gateway - Dario Bonino
Device Modeling - Instances Sample Room OnStateValue OffStateValue isIn isIn OnStateValue OffStateValue OnOffState OnOffState hasState hasState Switch Lamp hasFunctionality OnOffFunctionality hasFunctionality OnOffNotification hasCommand Functionality hasCommand OnCommand OffCommand hasNotification hasNotification OffNotification OnNotification 4/3/2014 The Dog Gateway - Dario Bonino
Example Device description (XML) 4/3/2014 The Dog Gateway - Dario Bonino
Dog THE GATEWAY Architecture, technology and APIs
General Architecture Application e.g., /devices/lamp1/commands/on Rest API Dog IP-Network Wired Protocol (e.g., KNX) Wireless Protocol (e.g., ZigBee) GW GW D D D D D D D A 4/3/2014 The Dog Gateway - Dario Bonino
Dog • Based on OSGi (formerly Open Services Gateway Initiative) which facilitates: – componentization of software modules and applications – assures remote management and interoperability – provides specifications, reference implementations (Eclipse Equinox, Apache Felix), test suites and certification • Many interacting components organized in 4 layers: – Core Communication – Drivers Addons – Communication Core – Addons Drivers 4/3/2014 The Dog Gateway - Dario Bonino
Architecture Communication : Rest API Addons : Rules, Core functions : house Historic Storage, model, device model, … unit of measure support, device management Drivers : Support to different technologies 4/3/2014 The Dog Gateway - Dario Bonino
Architecture Rest API Web Socket API JAXB Core Measure Stream Rule Event Xively Library Library Library Library Engine Store Client Log House Device Monitor RXTX Clock Helper Model Manager Admin EnOcea KNX Z-Wave Echelon MyHome Texas ZigBee n 4/3/2014 The Dog Gateway - Dario Bonino
Dog Vet: the Admin UI http:// dog.example.com :8080 /admin/ui/index.html 4/3/2014 The Dog Gateway - Dario Bonino
Dog REST API PROGRAMMING DOG Architecture, technology and APIs
Dog RESTful API • Quickly evolving / constantly updated • Technology independent (based on DogOnt) • Transfers XML / JSON data • 3 main APIs – Devices – Environment – Rules • Documentation: http://dog-gateway.github.io/rest-api.html • REST endpoint: http:// dog :8080/api/v1/ 4/3/2014 The Dog Gateway - Dario Bonino
Device API • Allows to manage connected devices: – query the gateway about installed devices, their location, functionalities and configurations; – require execution of commands to existing devices; – monitor device statuses and measures in real-time; – add, modify or update the set of devices controlled through the gateway 4/3/2014 The Dog Gateway - Dario Bonino
Device API - Query Resource: /devices <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <dhc:dogHomeConfiguration> <dhc:controllables> <dhc:device domoticSystem="ELITE" id="oven1" class="ElectricalOven"> <dhc:description>A ElectricalOven instance named oven1</dhc:description> <dhc:isIn>kitchen</dhc:isIn> <dhc:pluggedIn>MainsPowerOutlet_p12_kitchen</dhc:pluggedIn> <dhc:controlFunctionality class="OnOffFunctionality"> <dhc:commands> <dhc:command name="on" class="OnCommand"/> <dhc:command name="off" class="OffCommand"/> </dhc:commands> 4/3/2014 The Dog Gateway - Dario Bonino
Device API – Execute Commands Resource: /devices/{device-id}/commands/{command-name} PUT http://dog/devices /lamp1/commands/on On Off 4/3/2014 The Dog Gateway - Dario Bonino
Device API – Status Resource: /devices/status Resource: /devices/{device-id}/status GET http://dog/devices/lamp1/status { “id" : “lamp1", "description" : " The lamp over the closet near to the livingroom armchair", "active" : true, "status":[ { ? “ OnOffstate" : "on" On } ] } 4/3/2014 The Dog Gateway - Dario Bonino
Device API - Update PUT http://dog/devices/lamp1 { "description" : "The Lamp A lamp near to the armchair " } The Lamp near to the armchair 4/3/2014 The Dog Gateway - Dario Bonino
Environment API { • Allows to manage "rooms":[ { information about the "id" : "kitchen", environment: "class" : "Kitchen", – insert, update or delete "description" : "The best room in the house“ }, rooms; { – insert, update or delete "id" : "sam_bedroom", flats; "class": "Bedroom“, • E.g., "description" : "Sam's bedroom" } – GET ] http://www.mydog.com/en } vironment/flats/flat/rooms 4/3/2014 The Dog Gateway - Dario Bonino
Rules API (under refinement) IF OR-IF TRIGGER-EVENT TRIGGER-EVENT WHEN WHEN CONDITION (S) CONDITION (S) THEN ACTION(S) 4/3/2014 The Dog Gateway - Dario Bonino
Dog REST API HANDS-ON Architecture, technology and APIs
Recommend
More recommend