Introduction to the xAAL protocol ****************************** Version 0. 2 *********** Jérôme Kerdreux Corinne Le Moan Christophe Lohr ======================================= ============== Summary: this document gives the description of the protocol xAAL such as defined by the team IHSEV of Telecom Brittany, And his(her,its) state of progress in 2014. 1 general Architecture * = * = * = * = * = * = * = * = * = * = * = * = * = The xAAL system articulates around a multicast bus IP (IPv4 or IPv6). It is architecture fundamentally distributed: the functions(offices) described below can be present several times, Be implemented and grouped(included) in several material components of various manners, And have a dialogue all via this xAAL bus. There are several interests in a communication by bus: - Ne primauté gérer ensemble de l'ONU de connexions point-à-point ce qui permet d'économiser les ressources des équipements domotiques. - A bus allows the discovery: when a new constituent(component) appears in the installation, He announces; all other entities can then take into account him(it). Also, When we add a constituent(component), This one can question the bus to discover the already present elements. It facilitates largely the configuration and allows the dynamicité and the evolution capacities of the system. 1. 1 functional Architecture =============================== The face(figure) 1 represents the general functional architecture of the system xAAL. ---- Drunk - xaal_devices Drunk - xaal_databases Drunk - xaal_activators Face(Figure) 1: functional Architecture of xAAL. ---- Native equipments. Equipments home automations (sensors, Actuators) can have a dialogue in a native way in the xAAL protocol. Gateways. More most probably, Equipments home automations of every builder(manufacturer) support(bear) only the communication protocol of the builder(manufacturer). From then on, Gateways will take care to translate messages between protocols builder(manufacturer) and the xAAL protocol. At this level we suppose that there is so much of gateway that of protocols builder(manufacturer) to support(bear) in the building(ship). According to the technologies and the protocols builder(manufacturer), Every gateway will have to manage the questions of matching between the gateway and the equipments home automations which it manages, The problems of addressing and configuration of equipments home automations, And manage the obstinacy of this information of configuration. Let us note that he can be interesting to be able to question a gateway about the mapping which she(it) makes between the addresses xAAL and the physical addresses builders(manufacturers) of equipments. Even if we interact xAAL with equipments via their xAAL address there, This information of mapping which manages the gateway can be interesting for the configuration of the database (described below). Indeed, During the installation, The installer notes generally the physical address builder(manufacturer) of the equipment with its location(localization) in the house. To facilitate the configuration of this database (associate this information of location(localization) with the xAAL address of the device), He can be interesting to cross(spend) at the beginning by the identifier or the address builder(manufacturer) of the device. Registers of plans (Plans repository). Generally speaking, Equipments home automations must be described by a plan (the nature of the equipment, The possible interactions). These various plans are listed in one or several registers of plans. These registers of plans are present on the xAAL bus. Other entities question them, Via this bus, To obtain the plan of description of the other equipments (that these equipments are active or not on the bus). - We question the register about an identifier of type(chap), He(It) sends back to(dismisses) us his(its) plan, If he(it) knows him(it). More exactly, He(It) retroune us an URL where we can download the plan. - Associated to a plan, Besides the description of the very device, He can have metadatas there: the language(tongue) in which are drafted the descriptions, Dates or version number, Url for the documentation, Url for the ihm (clock towards fragments of html, Possibly accommodated on the Internet), Etc. An url for them updated, Etc. - Let us note that the register is also described itself by a plan (to draft). This plan must thus be capable of describing how to announce plans (we are thus a little bit meta) In a given installation, He can have zero or several registers of plans on the xAAL bus there. The definition of the plan of an equipment must be particularly looked after. A number of these plans with general vocation must be drafted by our international bureau of standardization xAAL. More specific plans can be drafted by the very builders(manufacturers). Consequently, He can have conflicts there: for a name of given plan, Several registers on the bus could send back(dismiss) plans having divergent descriptions. It is then necessary to plan a mechanism of resolution of conflict: or in a static way where an administrator(director) comes invalidate/to erase plans with problem in a register, Or in a dynamic way where registers spread(broadcast) an information of priority besides the plan itself (load(responsibility) then to the receiver to sort out). This point is not cut in the current specification yet. Furthermore, We can envisage several manners to update these registers: or via the xAAL bus itself, Or by Internet (the register is going to download files of plans at addresses that we shall have indicated to him(her)), Or by another way(means) (INSTALLATION CD, Etc. ). There also, This point must be afterward specified. Database of metadatas. In every equipment home automation present in an installation, It is advisable to associate a number of information: at least an information of location(localization) (p. Eg. Declare that the equipment of type(chap) swigs and of address X is situated in the cooking(kitchen)), And possibly a symbolic name (p. Eg. That the equipment of address X is called " lamp 1 "). All this information is grouped(included) in a database of metadatas. Concretely, By concerns(marigolds) of opening and extensibility (in the sense(direction) flexibility of use and not in the sense(direction) load increase), This information is realized by tags. This database contains in a way the configuration of the installation home automation. The database of metadatas is present on the xAAL bus. Other entities question him(it) via this bus to obtain tags associated to the identifier of a device, Or conversely obtain the list of devices associated to one or several tags. - We fund him(it) with one ID of device, His(Her) type(chap), A series of keyword (tags) to locate(localize) him(it) in the house - We can update the information on a device - We question him(it) to know tags associated to such or such ID - We question him(it) to know ID associated to such tag or such typifies - We question him(it) to know the existing tags - We can delete(eliminate) a recording - Note(mark): a device can be declared in this database without being present on the bus It would be advisable to have at least a base(basis) of metadatas on the bus, But he could have several of it there. Even there, The constitution of this database must be established with the biggest care. It will thus be advisable to implement the classic mechanisms of organization of tags: verify the incoherence, Synonyms, Ambiguities, Propose opportunities of renommage of the tags, Etc. The classic trap being to want to specify an information of location(localization) in two places, For example indicate in a friendly name tag: " lamp of the lounge(show) ", Then add rent: "lounge"("show") (and still in this example the information is redundant but convergent. . . ) Note(Mark): we find this notion of friendly name in UPnP. . . In the facts this mechanism is a source(spring) of problems: he(it) is is diverted(hijacked) from his(its) role to put back(let in) information of location(localization) as in the previous example there, He(It) is is left with the value builder(manufacturer) (how many TV DLNA or of androïd smartphone has for friendly name: media Server. . . ) Mask(Hiding place). He(It) is common(current) to have monodirectional sensors, That we cannot question, And which(who) send the information in a sporadic way. ( P. Eg. A thermometer which sends the temperature only if it changed. ) It is then advisable to have at least a mask which memorizes(stores) this type(chap) of information and which the other entities can question every time necessity. Such a mask has to memorize(store) at least the notifications emitted(uttered) by devices. We can wonder about the relevance to memorize(store) also the exchanges of type(chap) command / answer. As in any mechanism of mask(hiding place), It is necessary to associate a temporal stamp with the information put in mask(hiding place). When another entity on the xAAL bus asks for an information in the mask, He specifies the maximum duration. It is not the mask itself who(which) manages the relevance of the data according to their age, But the customer who makes his request. Even there we can imagine that incoherence arises if two masks(hiding places) on the bus turn(return) divergent information but having the same temporal stamp. We consider that this phenomenon is a priori rare, And consequently we do not intend to define a particular mechanism in the specification to raise the ambiguity. We leave the care to the customer to sort out the information received according to his(her,its) own criteria. Automatons of scenarios. Among the advanced services(departments) of the home automation, We find the notion of scenarios: for example execute a whole sequence of actions(shares) from a click of the user, Or at scheduled(programmed) hours, Or watch sequences of events then react to it, Etc. To do it, XAAL plans that it is taken care by one or several entities of type(chap) automatons of scenarios. These automatons of scenarios are also the hangout to implement virtual devices: for example a scenario could aggregate and correlate a whole set of events of devices realities Who could then be to reexploit by of other one entities. By proceeding in this way, This scenario should then appear as being itself a device on the bus, With his(her,its) address and its plan. As usual, We can have incoherence or conflicts between scenarios (the one lights(switches on) the lamp, Other one puts out(switches off) him(it)), Or interbloquent, Etc. It is not the xAAL specification in herself(itself) who(which) is going to prevent him(it). The specification does not impose the appeal(recourse) to a model-checker with Network of Molded colored delayed, Nor anything of the kind(genre). . . It remains a subject of search(research), Certainly hardly interesting, But detached of the xAAL specification. ( If somebody wants him(it), He can introduce a device of supervision, Which(Who) would be himself(itself) a kind of engine of a little bit particular scenarios. ) Interface user. Or, User interfaces are assured(insured) by specific entities connected to the xAAL bus. It can be a real material equipment with a screen and buttons; either a software constituent(component) which generates for example Web interfaces usable in a sailor(browser) on a PC, A connected or other TV; or another software which supplies an API REST for mobile applications (tablets, Smartphone) or towards an external waiter(server) at a person receiving benefits(provider). Even there, It seems natural to be able to arrange several user interfaces (Smartphone, Tablet, Remote control, Etc. ) Within an installation home automation. Synthesis Such a functional architecture allows to manage the dynamic aspects of the infrastructure (modularity, Evolution capacities, Adaptation, Etc. ). So, The advanced functions(offices) such as the IHM or the engines of scenarios, Can adapt themselves automatically to the infrastructure and to its modifications (if an equipment enters / takes out, If the one falls out of order, Or is replaced, Etc. ). The typical functioning of an IHM could be this one: 1. Question the bus to spot(locate) the present equipments; 2. Question the register of plans to know the type(chap) of these equipments, The type(chap) of data of the sensors / actuators, The possible commands(orders), URLS to get back icons; 3. Question the base(basis) of metadatas of the sensors to discover the configuration of the installation (post(show) the symbolic name, The location(localization) and the other tags associated to every equipment); 4. Question the mask to know the last states known for these equipments; 5. Build dynamically display screens and interfaces of command(order) for these equipments. 1. 2 material Architecture ============================= The interest of such a distributed functional architecture is to authorize a big freedom concerning the investment(placement) and the grouping of the functions(offices) on material components. For example: - A builder(manufacturer) of equipments home automations could market one cubicle(garage,dock) which would group(include): the gateway for its own protocol home automation, The directory of plans for the equipments of his(her,its) mark(brand), The mask of equipments managed by the gateway, Some automatons of scenarios to manage the virtual devices, And a small base(basis) of metadatas for his(her) own sensors to note their location(localization). - An operator of services(departments) home automations could sell one cubicle(garage,dock) (different and complementary(additional) of the first one(night)) which would group(include): the database of location(localization), The automatons of scenarios, Web interfaces and REST to have a dialogue with his(her,its) waiters(servers) in the cloud and offer enriched services(departments), Etc. - A provider of virtual services(departments) (c. À. D. Ne vendant que du le service et la primauté de matériel) pourrait fournir une le portable d'application versent le smartphone ou tablette qui embarquerait : une interface utilisateur, An automaton of scenarios, An interface towards his(her,its) external waiters(servers) for advanced services(departments), - A service provider (p. Eg. Help(Assistant) to the person, Telemedicine, Etc. ) Could add his(her,its) cubicle(garage,dock) (still an other one) which would group(include): a gateway for specific equipments (medical, Remote alarm, Etc. ), Automatons of scenarios of alert, An interface towards his(her,its) external waiters(servers), Etc. - A builder(manufacturer) of innovative connected objects could sell these connected objects which would embark: the constituent(component) home automation himself(itself) speaking in a native way there xAAL, The register of plan describing the object itself, An automaton of scenarios, An interface towards his(her,its) external waiters(servers), Etc. - The services(departments) or a little developed the muscle scenarios (p. Eg. With actimétrie, Or of composition of adaptive services(departments), . . . ) Could consist of an engine of scenarios, Coupled with the mask, Coupled with a base(basis) of metadatas. The fact of leaning on IP as way(means) of interconnection and this light xAAL protocol allows, We hope for it, A big flexibility and a better interoperability between these various actors who have nothing else to reveal in the competition(competitors) that messages xAAL. The really hard point is the definition of plans and the rigor with which we comply with it in implementations. . . 2 The coat(layer) of transport * = * = * = * = * = * = * = * = * = * = * = * = * We use of the multicast IP (IPv4 and/or IPv6), In UDP thus. - The multicast IP address is to be defined(to define). - The number of port(bearing) is to be also defined. Possibly save itself a beach(range) of ports(bearings). - If there are several " networks home automations " in the place of residence, They use different ports(bearings). - Messages will have a size limited by the size max UDP (p. Eg. 65507 bytes(octets) in IPv4). We let the fragmentation IP operate normally. ( By opposition to approaches as xPL which limits in 1500, Then implement continuous. The fragmentation IP already manages it very well. ) The problem stays that certain PEAKS do not manage necessarily very well the fragmentation IP (p. Eg. The stack of base(basis) of Arduino). We recommend only to try to limit itself to 1500 bytes(octets). If services(departments) need to exchange the biggest volumes of data between devices, They are asked to clear(release) the bus home automation (which(who) is not made for it) for the benefit of another channel(canal) of transmission (p. Eg. A connection TCP) which they can announce on the other hand on the xAAL bus. - The configuration IP of equipments is detached of the xAAL system. Equipments can use some static configuration IP, Of the DHCP, Router Advertisement IPv6, Of ZeroConf, A Link-Local address (169. 254. 0. 0/16, Fe80::/64), Etc. Let us note however that, Because of the use of a multicast bus, The address source(spring) of broadcasting stations(issuers) is rather little important (and not used in our case). Certain equipments could use as well a phony hardcodée IP address. . . - We draw the attention of the future possible developers on the horrors which we were able to notice in the implementations of buses xPL or xAP (often in Java(Popular waltz) or. Clear(Net)): the appeal(recourse) to a "hub", A software constituent(component) which repeats the messages of the bus for the applications situated on the same machine. It is perfectly useless on almost all of the current operating systems: the applications of the same machine can completely have each their own socket on the multicast bus, If we use the options of socket dedicated to it (typically SO_REUSEADDR and IP_MULTICAST_LOOP). . . - The choice of the multicast IP imposes almost the protocol UDP. UDP not managing the detection of loss of package and broadcasts, We would have been able to find more comfortable to choose TCP. Here are some arguments which can reassure people sensitive to cold(people nervous) face to face of UDP: In the context of a network in the place of residence, We can make the hypothesis that the loss of packages, Although always possible, Is a priori rather raâe. By construction xAAL is enough little requiring(demanding) face to face from the treatment(processing) of the cases of error (cf. 7. 3); from this point of view xAAL we rather strong parraît. To use TCP for the management of the losses of packages is only moving the problem in the formal pile(battery) (and in a heavy way: it is systematic, And the automaton TCP is consumer of resources). In xAAL, If we need to manage it (what, Finialement, A systematic need) is not inevitably, It will be made at the level of the application of services(departments) (entitées implanted on the material(equipment) which arranges generally comfortable resources). 3 The coat(layer) of presentation(display) of the data * = * = * = * = * = * = * = * = * = * = * = * = * = * = * = * = * = * = * = * = * = It is a question of deciding if the data treated(manipulated) by the xAAL bus are rather of textual nature either binary nature. This point was the object of a debate within the team, Where two schools of thought wonder. 3. 1 The approach binary protocol =================================== The main motivation is to stay in low level: a protocol which can be coded in a PEAK (p. Eg. C of base(basis)), Rather than a sophisticated middleware stemming from the world PC and Web applications. It does not necessarily mean that we aim at compact / compress messages, Mais des des messages simples à fabriquer et l'analyseur syntaxique (au coup(au coup d'État) structurent de C à la roulette), Self-sufficient, In a forced size(format), With a forced variability, A predictable size, Etc. More concretely we would decide to treat(manipulate) essentially words of 32 bits, By aligning itself with 32 bits (thus, With the stuffing if needed). The inconvenience is that the phase of débuggage of the messages is more complicated than a textual approach, Because is then needed a tool validated to analyze exchanged wefts. Other inconvenience and that we are too much taken away from the fashionable techno (around Web), And that it will a priori be more complicated to make adhere(subscribe) to it a community. Finally, It is not the approach which was held(retained) by the team for the implementation of xAAL. Nevertheless, A draft of specification was defined and is available on request, It is the version 0. 1-bin In the future he could be interesting to deal with the protocol Mihini / M3DA to make it exactly. . . 3. 2 L'approche protocole textuel =================================== The advantage of a textual protocol is that it is easier to débugger, Only by looking at exchanged wefts. The inconvenience is that messages are more complex to build, And even more complicated to parser. The adopted compromise was to choose Json as exchange format of data. De nombreuses librairies sont disponibles dans de nombreux environnements de développement. Furthermore, It is rather close to the Web world, And as the last generations of IT specialists were massively and firstly trained(formed) to the technologies of Web, We can hope for a better membership(support) with this public, As well as with a certain public of decision-makers. . . It is this approach which was experimented in the previous implémenations of xAAL made in the team: it was the version version 0. 1-json. The specifications given during the document for the version 0. 1 lean on this approach textual protocol, And spread(widen) him(it) to describe the current version. . . An interesting variant would maybe be to use certain aspects of CoAP ( 1 ) (or a subset). . . To study for the future. . . Even if the closeness with the world of Web appears nevertheless of a limited technical interest. . . 4 Definition of a device * = * = * = * = * = * = * = * = * = * = * = * = * = * = A device possesses: - A devType: this name references the plan, That is the type(chap) of the device. He(It) is hard coded there in the device. - This identifier of plan is a chain(channel) compound(made up) of a pair of words separated by a point. - The first word indicates(appoints) a class of type(chap) of device (p. Eg. Lighting, Heating, Multimedia, Etc. ). - The second word indicates(appoints) a type(chap) in a given class (p. Eg. In the class lighting, We have a lamp one - off, A lamp with graduateur, A ball with facets, Etc. ). This second word can reference the extensions of plans builders(manufacturers) (cf. 5. 1). - The identifier of type(chap) " any. Any " is reserved, And indicate(appoint) all the types(chaps) of all the classes. - And for example the couple " lamp. Any " indicate(appoint) all the types(chaps) of the class " lamp ". - We save ourselves a particular name: "experimental" (c. -à-d. When somebody makes an implementation but has not obtained a name by our international bureau of standardization of xAAL) yet. And this for the class, As well as for the type(chap). - An address: an identifier of device, A unique(only) number on the bus. - The identifier of device is an integer 32 bits. - The address 0 is reserved. It is the address of broadcast and indicates(appoints) all the devices. - How is attributed(awarded) an address? - Is hard coded there, In factory (the first 2 bytes(octets) are builder's(manufacturer) number attributed(awarded) by our office(desk) of allocation(attribution) of the numbers, The rest is for the appreciation of the builder(manufacturer) (serial number or other one), Way YES in Ethernet) - Auto-generated random ) if YES (c. -à-d. The first 2 bytes(octets)) is 0xFFFF? - But verified by a kind(genre) of " arp free " by requests isAlive to verify that somebody else does not already have him(it) - But especially not attributed(awarded) by a supervisor of bus or other thing of the kind(genre)! - An equipment can consist of several devices. It is the case typically of a gateway (p. Eg. An equipment which is going to make the footbridge between our bus home automation and of X10, Either of Zigbee, X2D, Somfy, Etc. ). But it can be also the case of a small meteo station(resort) which measures the intérieure/extérieure/hygrométrie/etc temperature. - Such an equipment is then qualified as device composite, - And each of its components is a device embedded. - The composite device announces (possibly) itself on the bus with its own address and its own name of plan. We can interact with him specifically (e. G to make his(her,its) config, Consult his(her,its) level of battery(drum kit), Etc. ). He also announces the list of his embedded (with their address) - Each of the embedded is also announced on the bus as an ordinary device, Bus-native, With his(her,its) own address and its own name of plan. Each is announced by specifying his parent(relative), C. -à-d. The composite to which he(it) is hung up. ( Note: devices really bus-native has for parent=0) - A composite device can also choose to be invisible, Do not look himself(itself), Nor indicate that he(it) has embedded, Nor that his(her,its) embedded has him for parent(relative). 5 Definition of a plan (or type(chap) of a device) * = * = * = * = * = * = * = * = * = * = * = * = * = * = * = * = * = * = * = * = * = * = * = * = * = * = * Every device is typified, C. -à-d. Described by a plan. The plan is strongly inspired by UPnP ( 2 ). We have not defined dialect yet to draft these plans. Most probably it will be of the XML (remains to write the DTD). - The plan gives a little of semantics to a device and describes its capacities: a list of possible methods on this device (mechanism of type(chap) request-answer), A list of notifications which he(it) emits(utters) spontaneously, And a list of variables of state of this device (the device announces spontaneously on the bus any valuable change). - A list of methods. Every method is described by: - A unique(only) name in the plan which identifies him(it). - A textual description (see later how managing the language(tongue) and the problems the internationalization) - A list of arguments, Every argument being defined by: - A name - A direction(management) (in / out) - The unity(unit) (in the sense(direction) International Bureau of Weights and Measures. . . ) - Eine Beschreibung - A list of notifications. The notifications are messages which the device emits(utters) spontaneously on the bus. These notifications are defined by: - A name, - A description - A list of variables (name, Unity(Unit)) - A list of variables of state. If their value changes, It generates by default a notification on the bus. ( Let us note that a device can very well consist of a number of additional internal variables which are not monitored and are not the object of notifications. . . ) Every variable of state is defined by: - A name - A description - The unitée - A default value (?) 5. 1 Inheritance of plans. =========================== There is a notion of inheritance between plans, A plan can spread(widen) a pre-existent plan. We define the first 3 levels of this genealogy: 1. A generic plan common to all the devices of the bus, That everybody has to implement. 2. A specific plan in every class, Which(Who) thus inherits from the general plan (lamp, Thermometer, Switch, Thermostat, Etc. ) 3. A specific plan to every type(chap), And who specifies the level of features (p. Eg. A lamp can be of type(chap) one / off, Some are of type(chap) to trigger, And others with graduateur. . . ) 4. Afterward, The builders(manufacturers) of equipments home automations are naturally going to define their own plans and to decline them according to their range of products. On the other hand, It is forbidden these plans builders(manufacturers) to be level plans 1 (the generic plan is the only), Nor level plans 2 (plan of class). The plans of the builders(manufacturers) are thus inevitably extensions of level plans 2 or more. In terms of naming of plans (the clocked(pointed,stuck) pair described in 4), The second word is then left with the discretion of the builder(manufacturer). ( The builders(manufacturers) deprived of this state of affairs are cordially invited to discuss with our office(desk) of normalization(standardization) if they wish the introduction again level plan 2 or 3. ) Note(Mark): think, please, By listing the APIs of devices described by these plans, That some devices will not be capable of listening to the bus and will not only be emitting(uttering) above, Only notifications of them variables of state. 5. 2 Naming of plans ========================= It will be necessary to grant(tune) a big rigor in the naming of plans to protect a maximum of coherence in mind of all. . . In too numerous systems (xAP, XPL not to name(appoint) them), The naming of devices and their typage is regularly hijacked to put back(let in) notions there which have no their place there. That is a plan. Two things: we wish that the name of the plan sends back(dismisses) above all to the features of the device, In the ways(means) to interact with him. This name also has to evoke the nature of the sensor. That is not a plan. - The name is not supposed to send back(to dismiss) to builder's(manufacturer) technology (and even less in a precise model). - The name of the plan does not have to send back(dismiss) to a use(custom): a contactor (which passes on(transmits) notifications "open / close") can be of use as well to the safety(security) (on windows or front door) that of That he(it) is dedicated to a meteo station(resort) or to a management of the heating. He(It) has not grounds there thus for having categories of security type(chap) or hvac (Heating, Ventilation(Breakdown) and Air-Conditioning)! They are chapters in a catalog of sale builder(manufacturer) there, No categories of functions(offices) of equipments home automations. At the most, The role associated with a sensor (safety(security), Heating, Etc. ) A tag is to be memorized(stored) in the base(basis) of metadatas of the installation. - We shall avoid carefully the junk categories of the soft type(chap) (that already saw itself!). Obviously that we have a number of software components. . . Also, Certain equipments will be purely software (for example an application of Web-radio in a PC). The fact that the constituent(component) is soft rather than hard has no interest of the point of seen xAAL. 6 generic Plan * = * = * = * = * = * = * = * = * = * = * = It is the basic plan. All other plans have to inherit from it somehow or other. - Internal parameters: - DevType: the name of the plan which obeys the device - Address: an integer 32 bits (the address of the device) - Parent(relative): an integer 32 bits (The address of the parent(relative) in the case of a composite, Or 0 if not) - Variable of state: - None imposed in the generic plan - Notification: - Alive: emitted(uttered) during the putting on of the device, Then regularly with a rhythm left with the free appreciation of the device. The message of notification does not contain parameters, No bodysuit. - StateChange: emitted(uttered) in every change of one of the variables of state. The body of the message contains only variable of state which(who) changed. - Error: emitted(uttered) when the equipment detects an error. - Description: the textual description of the error - Code: a code (digital technology) of error. It has authority to be overloaded in the definitions of specific plans. - Methods: - IsAlive: no attributes, Nor of value of return. However (or) addressee has to answer as far as possible by an alive notification in all (c. À. D. And not by a reply message to the author of the request). - GetDescription - VendorId ( out ): character string or number attributed(awarded) by the office(desk)? - ProductId ( out ): character string - Version ( out ): character string - Parent(relative) (out ): address of the parent(relative) if there is one, Or 0. - GetState - < Variables of state >: a priori this method will be overloaded in the definitions of the specific plans of every device to turn(return) all the specific parameters of state added by every type(chap) - Attention: we do not send back(dismiss) the internal parameters devType, Address which(who) are anyway in makes dizzy him(it), Nor the parent(relative) who is given in the getDescription. - SetBusConfig - BusAddr (in / out): a character string giving the IPv4 or IPv6 address of the bus xAAL onto which to tip(fall) over. If the turned(returned) address is not the one that we had sent, It is because the device was not able to configure above (in brief, There is an error). - BusPort (in / out): an unsigned integer (finally, Limited to 65535), Indicating the port(bearing) of the bus xAAL on which to tip(fall) over. If the turned(returned) value is not the one that we had sent, It is because there was an error. - TTL (in / out): an integer 8 bits unsigned, Indicating the TTL used for the broadcast(emission,issue) of packages multicast. A priori we put 1 by default, But after all we could also want to change him(it). . . 7 Definition of a message * = * = * = * = * = * = * = * = * = * = * = * = * = * = * A message consists of a part(party) header and of a part(party) bodysuit. The header is compulsory, While the presence of the bodysuit is optional. The face(figure) 2 gives an example of exchange of messages xAAL. ---- " Header ": < < {{ " Header ": "version": " 0. 2 ", { "Source"("Spring"): 16778244, "Version": " 0. 2 ", " Target ": 39595606, "Source"("Spring"): 39595606, " MsgType ": " reply ", " Target ": 16778244 " devType ": " thermometer. Queryable " " DevType ": " thermometer. Queryable ", "Action"("Share"): " getState ", " MsgType ": " request ", " Cipher ": " none ", "Action"("Share"): " getState ", "Signature": " " " Cipher ": " none ", } "Signature": "bodysuit": } { } "Temperature": 9. 3000000000000007 > >} } > > Face(Figure) 2: example of messages xAAL ---- 7. 1 Header =========== Makes dizzy him(it) of a message understands(includes): - Version: the version of the protocol. The present document describes the version 0. 2. - Source(spring) target: source(spring) and destination of the message is addresses. Let us note that the address destination can be 0, To which case the message is of type(chap) broadcast. The receivers (thus everybody) are invited to filter the relevance of the message on type(chap) (name of plan) of the device. The messages of notification are often of broadcast type(chap), But not inevitably. On the other hand, The messages of answer to a request are specifically dismissed to the address of the applicant. - DevType: the name of the plan (classy couple. Type(Chap)) to whom relates this message. Thus typically if it is a message of type(chap) request, It is the name of the plan of the device addressee, And if it is a message of type(chap) answer or notification, It is the plan of the transmitter(issuer). Let us note that in the case of a request (broadcast or not), The applicant can resort(turn) to the keyword any for the class as for the type(chap). On the other hand, In their answer (if necessary), The concerned devices specifies their devType explicitly. ( E concretely we can have of any neither in the answers nor the notifications. ) - MsgType: the type(chap) of message among request reply notify. Thus, Typically, A request message is followed by a reply if necessary to turn(return) values to the applicant. Let us note that we do not impose number of sequence or the identifier of request-answer. . . We can thus have some incoherence: we discuss it more low. - Action(share): the name of the action(share) carried(worn) by the message among the list of the methods and the notifications described in the plan the name of which is indicated in the message. - Cipher: the mechanism of safety(security) used in the message. At the moment we defined the mechanism none. . . In the future we can envisage the mechanism SHA (SHA1 SHA256 SHA512?): a key shared on all the bus. We can also envisage a typical mechanism PGP: an asymmetric encryption, The key deprived of every device being hardcodée, And the public keys written on the label and shared (and countersigned) within the bus. . . See below for a discussion about the subject. - Signature: the signature of the message by the chosen cipher. . . 7. 2 Bodysuit ========= The body of the message is optional: everything depends on what was defined in the plan in question, According to the action(share) and to the type(chap) of message. Thus, Where necessary, The body of the message contains a list of keys-values. 7. 3 Cases of error =================== The spirit of the specification xAAL is before any being interested in the interoperability. We are thus guided by the will to propose, But not to force. . . Consequently, The xAAL protocol has very few railings against the cases of error. It is of the responsibility of the implementations of constituent(component) of xAAL to do the best. The specification says nothing as for the absence of answer. On one hand, Because we are in UDP, The request as the answer can get lost. On the other hand, There is device which know how to only emit(utter) and not listen to on the bus. The specification does not impose a mechanism of timeout: some device have inevitably no clock under the hand, And can manage the answers to the requests in a circular buffer (and if an answer arrives so much late that we forgot the question, Too bad) Other argument concerning the non-answer to a request: in the case of a request not unicast (or really broadcast, Or on a class of type(chap)), It seems natural that the equipments which cannot honor the request can choose to keep silent rather than to pollute the bus with error messages. In certain cases we can want to make sure that messages are not lost (p. Eg. Power plant alarms). Because the loss is not managed by the formal xAAL coat(layer) itself, It can be taken care by the application above. We can envisage several strategies: - After a request of action(share) towards a device, The transmitter(issuer) questions the device to verify if there was change in its variables of state; - The api of an action(share) can introduce an ad hoc parameter (p. Eg. RequestId) that the device has to repeat in its answer; - Etc. The cases of error or incoherence are possibly many. The specification does not impose a precise behavior. Thus, In front of an inconsistent message, Doubles(Doubloons), Answers or contradictory announcements, The behavior is specified. We could want to decree nevertheless that, In front of an inconsistent message, We have the obligation(bond) to reject him(it), To ignore it. Unfortunately, For certain equipments, It is not possible to undo what we began to make (not enough memory(report), Or partial action(share)). In brief, The specification imposes nothing. Load(Responsibility) in the implementations to pay attention, And to do the best. For example, In certain cases it is relatively easy to cut: - A device receives a request on its address, With a type(chap) of device handbook, But which is not his. He can identify thus easily the problem and ignore the request. - A device receives a request but the name of the method does not exist in its plan. He can identify thus easily the problem and ignore the request. - A device receives a request but certain parameters are of the bad type(chap), Either parameters are missing, Or there is too. There, According to the cases, He can have begun to realize partially a number of tasks corresponding to the wanted method and can find himself in bad situation. He cannot maybe undo what he began, And thus we cannot impose on him(her) to reject the message. If he(it) makes him(it), It's good. If not, Too bad. At the most he(it) positions a code of error which is well. - Conversely, If in an answer certain variables have no good type(chap), If it is lacking or if there is too, The device can have begun to handle partially the answer. . . We ask him(her) to do the best. - If plans are carefully drafted, We can also plan a number of messages of notification of error. But this is of the responsibility of the plan, Not of the xAAL bus. 8 Safety(Security) * = * = * = * = * = * = * In the preliminary works, We did not propose model of mechanism of safety(security). However, This need seems inescapable(major) today. This section proposes some elements of reflection. We can consider that the underlying link brings certain level of safety(security). Let us consider an infrared remote control: the connection RC5 (or RC6) is not calculated(coded), And to pirate the transmission between the remote control and the TV, The neighbor has to can aim with its remote control through the window. It is the walls of rooms(parts,plays) which assure(insure) the safety(security) of the transmission, Not the protocol itself. It's the same for a protocol IP: it is already necessary to be on the network to be able to attack(affect) him(it). It is necessary to be present physically to cable in Ethernet, The WIFI connections have keys wpa (generally), Rest that in CPL the encryption is existing but rarely activated. . . And to finish, Think that in contrario the configuration of the firewall of the network of the house can be bad, Or that PC on this network can be compromised by viruses. . . 8. 1 Need for safety(security) ========================= When we speak about safety(security), It is necessary before defining everything against what we want to protect themselves. It is not a question here of handling the cases of failure, But well and truly cases of hostility. Among the classic rules of the safety(security) (integrity, Confidentiality, Availability, Non-rejection, Authentification), What do we need? At least, It is necessary to be able to assure(insure) the authentification of the transmitter(issuer) of messages, That messages are not corrupted, And that there is no rejeu. The question of the confidentiality stays: a priori it is not necessarily very annoying if the neighbor little to listen to (as long as he cannot inject false messages). However, In certain cases of use(custom) it can be annoying: only makes him(it) know that the power plant of alarm is cut or that the front door is maybe unbolted problem. . . On the other hand, It is necessary to keep in mind that we have very light equipments and that the mechanisms of encryption are resource intensive. Furthermore, To set up them it is necessary to pass by a phase of configuration (keys), And that it can be problematic. ( We can be inspired by mechanisms of automatic configuration of key WIFI as WPS. ) 8. 2 Proposals of safety(security) =============================== - " Cipher ": " none ": it is necessary to beware the possibility of communicating without encryption, Exactly for all these equipments which are too light to embark some encryption and mechanisms of configuration of keys. - "Signature":xxx: only a mechanism of signature by a classic hash function (MD5 SHA1 SHA-256 SHA-512 Blowfish. . . ) With a shared key allows to guarantee the authentification and the integrity. On the other hand it implies(involves) to manage the configuration of device to give them this key. Another approach is to use mechanisms with asymmetric keys: the private key being hardcodée in the device, His(Her,Its) public key being written on the label, With a mechanism of distribution(broadcasting), Of division(sharing) and countersignature of these keys (in the PGP). The fact remains that to avoid the rejeu it is necessary to add in the signed message a young something who(which) makes him(it) unique(only). . . For that purpose, We can add a temporal stamp (and to avoid the rejeu of weft captured there is too long). Or, In the plan of the device we can plan a mechanism of challenge: at first ask the device for a cookie, Then turn(return) him(it) to him(her) in the message by signing everything. Such a mechanism is to be planned in the plan of the device, Not in the xAAL protocol. - The confidentiality: it implies(involves) to calculate(code) the information themselves transported in the message. We can envisage two approaches: - It can be specified not in the xAAL protocol but in the plan of the device which needs it: we are exchanged a public parameter dated but whose value is calculated(coded). - Another approach would consist in redefining in the size(format) of message a new block bodysuit but completely calculated(coded). At the moment, All this is still embryonic. 9 Best practice * = * = * = * = * = * = * = * = * = * The xAAL specification in itself allows a large number of things, Good ones(Maids) and the the least good. . . In the course of the previous pages some suggestions of best practice were evoked. We group(include) them here. 9. 1 composite Device ===================== In the world of the home automation he(it) is common(current) to find equipments which include several functions(offices) in a single case: for example thermometer, Contactor of door, Experimental thread. In xAAL, This gets organized around the notion of device composite. ( It is our way of making of the multiple inheritance. . . ) This device is then going to expose(explain) so much of devices xAAL that of elementary functions(offices). In the example here: a device with the plan thermometer, A device with the plan contactor of door, A device with a plan experimental thread. Furthermore, The device is going to expose(explain) itself itself with the composite plan, The only function(office) of which is to list its devices embedded (give their address and plan). The fact of exposing(explaining) itself as composite is not compulsory, It is only recommended: it does not bring feature additional home automation, But it allows to express the material architecture, What can help in the diagnosis and in the maintenance. 9. 2 Gateway ============ Let us summarize the role of a gateway: - Transform messages xAAL into messages of a protocol home automation builder(manufacturer); - Manage the appairage between herself(itself) and devices builder(manufacturer); - Manage the configuration of these devices (for example Z-Wave being bidirectional, It is the base(basis) Z-Wave which pushes certain parameters towards devices: the gateway being then bases Z-Wave, She(It) manages these parameters Z-Wave but does not expose(explain) them on the xAAL bus); - Expose(explain) devices builder(manufacturer) on the xAAL bus with their xAAL address and their xAAL plan; - To make the mapping enters them xAAL address and the addresses builder(manufacturer); Let us note that this mapping can be interesting to help in the configuration of the base(basis) of metadatas (for example, When we reconnect the current having installed(settled) several equipments home automations: all are going to appear in the disorder on the bus. . . It is thus necessary to identify who is whom). We can thus question the gateway about this mapping. For every device, This mapping is typically a pair: xAAL address, Send builder(manufacturer). From a builder(manufacturer) to the other one, The notion of address can have a very variable shape (for example we sometimes have the notion of group). However, Json authorizing the dynamic typage, The size(format) of address for every builder(manufacturer) can be afterward defined. ( In minima it is the dictionary which contains the protocolName variable. ) - Make the translation between the functions(offices) of devices builder(manufacturer) and the methods described in plans xAAL; This translation is rather direct as a rule(in principle), The gateway being quasiement transparent from this point of view there. By construction a gateway appears as a composite device. It is the composite a little more sophisticated device that the simple composite device describes previously, But it is the device which exposes(explains) itself itself as such on the xAAL bus. Il y cas des passerelle qui vont gérer des équipements constructeurs qui sont eux-mêmes de composé de nature. Let us take the case of the " Sensor of opening 3 in 1 FIB-FGK-101 ". (3) This equipment Z-Wave makes: contactor of door, Thermometer, Relay of digital data (to connect it an extension). The gateway Z-Wave is thus going to expose(explain) on the xAAL bus: - A device contactor of door (with a plan " contactor of door " and its own xAAL address); This device has for parent(relative) the composite device described below. - A device thermometer (with the plan " thermometer " and its own xAAL address); this device has for parent(relative) the composite device described below. - A device " digital dated " (with a plan " digital dated " and its own xAAL address); this device has for parent(relative) the composite device described below. - A composite device (with the "composite" plan and its own xAAL address); This composite device has for embedded three devices the precedents. Furthermore, He(It) has for parent(relative) the gateway described below. - A device gateway (with the plan " gateway " and its own address). This composite device has for embedded four devices the precedents. He(It) has no parent(relative). 9. 3 virtual Device =================== In the functional xAAL architecture, The automatons of scenarios are the place favored to implement the services(departments) home automations "intelligent". For example: - In the reception of a command(order), Activate(Start) quite a series of action(share) (p. Eg. " Evening tv "); - Or on the contrary, By correlating a whole set of events, Synthesize an information (p. "Presence"). In so doing, The automaton appears then itself on the bus xAAL as being a device as such. It is a virtual device, But a device with its own methods, Notifications, Variables of state: in brief, He(It) is defined by a plan and the other entities can interact with him via the xAAL bus. 9. 4 Device overloading an other one ================================= During an installation home automation we can resort(turn) to multifunction equipments. Let us consider for example the Z-Wave Interrupteur " micro-module one / off FGS-211 ". (4) This equipment has a size studied to be able to skip into a wall grip(taking) and command(order) any electric device (lamp, Ventilator, Roller blind, Etc. ). This type(chap) of micro-module, More and more common(current), Offer of the complex features. This is what says the catalog about this one: - Functions(offices) one / off (relay) commanded(ordered) by Z-Wave or by the connected buttons. - Can use 1 or 2 buttons in the choice (the second button can command(order) one or several other modules associated by Z-Wave). - Buttons can be bistable (one / off) or monostable (impulse by push-button). - Return of state towards Zwave. Consequently, The gateway Z-Wave which takes care of him(it) is going to expose(explain) on the xAAL bus the following devices: - A device of type(chap) relay with return of state (with the plan " relay ", And his(her,its) own address), Corresponding to the trendy device above and so commanded(ordered) by this micromodule (but at this level there we do not say if it is more a lamp than a ventilator or a roller blind); - A device of type(chap) button (or with the plan "bistable", Let be the "monostable" plan following the chosen configuration), And correspondent in the second button, The possible first button being used for the manual command(order) of the relay; - And additionally a composite device embarking both precedents. On the other hand, We miss the information of configuration saying that behind this module it is good a lamp which we check(control) and not a ventilator or a roller blind. To do it, We are going to resort(turn) to a xAAL entity, A new device which is going to expose(explain) the type(chap) "lamp" and to make the translation between the actions(shares) on this device and the actions(shares) on the device " relay in return of state " described higher. But especially he(it) comes to overload the generic device. We can then qualify him(it) as device of overload. ( And one xAAL point of view, He(It) will have for parent(relative) the generic device. ) Let us note that, Because it is the gateway which exposes(explains) this new device of overload, This gateway is not completely transparent any more in our architecture: it is necessary to configure her(it) to declare how is specialized the generic devices. El sentido común estimons que ce paramétrage la l à doit se faire au niveau de la la entrada et no la primacía au niveau (la par exemple) de la se basa de métadonnées. Indeed, Il s'agit du paramétrage du fonctionnement intrinsèque de dispositif, And not of an attribute from which we come to enrich him(it). In any rigor, A gateway which has to manage a generic micromodule is thus going to expose(explain) on the xAAL bus devices two: the one credits(generic medicine), Other one of the overload. However, For questions of simplicity of implementation (and also because we well know how are developers), It is completely acceptable that the gateway saves the generic device and exposes(explains) on the xAAL bus only the device of overload. 9. 5 Device hidden ================== Some devices do not have authority to be presented in user interfaces. It is the case of gateways, Composites, Engines of scenarios, Bases of metadatas, Masks(Hiding places), Interfaces themselves, The generic devices which are masked by a device of overload, Etc. You should not make of prejudice on the hidden character or not devices, It has to remain an explicit tag in the base(basis) of metadatas (possibly with a default value following the class of the plan, But who can be afterward modified). User interfaces know all the devices (hidden or not), But choose to present only those who are not hidden, Unless the user asks for it explicitly (a little as in his administrator of files on his PC we can choose " to post(show) hidden files "). This information (to specify that a device is hidden or not) pourraît to be a purely local property in an IHM, And be managed locally by the IHM. However we consider that it is a characteristic appropriate(peculiar) to the installation home automation and that must be thus stored in the base(basis) of metadatas and available to all. In Drafts of plans * = * = * = * = * = * = * = * = * = * = * = * = * At the moment, The formalization of plans was not still cut. Nevertheless, Here are some general ideas on what could contain these plans. < < Note: - P:paramètres intern - V:variables of state - M:méthodes - N:notifications Generic ======= P:devType P:address P:parent N:alive () N:stateChange (out v: +) N:error (out description, Out code) M:isAlive () M:getDescription (out vendorId, Out productId, Out version, Out adorn(counter)) M:getState (out v: *) M:getBusConfig (in / out busAddr, In / out busPort, In / out TTL) Lamp. BASIC (extends generic) ========== M:powerSwitch (in / out bool target) Lamp. Queryable (extends lamp. BASIC) ============== V:enlighten bool ) Lamp. Dimmer (extends lamp. Queryable) =========== V:level (float, Precent) M:dimmer (in / out float level) Lamp. Rgb (extends lamp. Queryable) ======== V:level {red, Green, Blue} (float, Precent) x3 V:mode [fixed, Shuffle]??? M:dimmer (in / out float red, Green, Blue) M:setMode ( fixed|shuffle ) Shutter. Simple (extends generic) ============== M:up () M:down () M:stop () Shutter. Queryable (extends shutter. Simple) ================= V:position ( open|closed|opening|closing ) Door. Simple (extends generic) =========== V:position ( open|closed ) Door. Locker (extends generic) =========== V:position ( locked|unLocked ) M:lock () M:unLock () Media. Simple (extends generic) ============ V:activity ( play|pause|stop ) V:volume {left, Right} (float drill(leak out) / db?) M:play () M:pause () M:next () M:previous () M:stop () Media. Spotify (extends media. Simple) ============= V:url M:setUrl?? Composite. Simple (extends generic) ================ V:embedded. . . Composite. Gateway (extends composite. Simple) ================= Doh be done. . . > > ---- This document was translated by LATEX by HEVEA ( 5 ) ---- (1) Https: // datatracker. Ietf. Org / doc / draft-ietf-core-coap/ (2) Http: // upnp. Org/specs/arch/UPnP-arch-DeviceArchitec ture-v1. 1. Pdf, Chapter 2. (3) Http: // www. Planet-home automation. Com/autres/par-technologie/zwave/capteu r-d-ouverture-3-en-1-fibaro. Html (4) Http: // www. Home automation-blind. Fr/domotique/modules-par-types/micro-mo dules/19-fibaro-fgs-211-relay-switch-mo dule-imple-on-off. Html