Skip to content
Snippets Groups Projects
Select Git revision
  • 6baa6e8bfee76a7909173599b09e76837b51a684
  • main default protected
  • devel
  • v0.4
  • v0.3
  • v0.2
  • v0.1
7 results

ragconnect-0.2.5.jar

Blame
  • Model-description.md 4.50 KiB

    Model description

    The latest version of the model: master | dev

    Below, all parts of the model are described in more detail. Each part resides in a separate grammar file.

    Main

    Root ::= OpenHAB2Model User* MqttRoot InfluxRoot MachineLearningRoot Rule* Location* ;

    • OpenHAB2Model: Content from openHAB
    • User*: Users in the system (work in progress)
    • MqttRoot: Everything needed for MQTT (communication with openHAB)
    • InfluxRoot: Everything needed for Influx (time series database for item state history)
    • MachineLearningModelRoot: The learned models for activity recognition and preference resolving
    • Rule*: Self-made ECA rules
    • Location*: Locations associated with users, activities, preferences (work in progress)

    openHAB

    OpenHAB2Model ::= Thing* Group* ThingType* ChannelType* ChannelCategory* ItemCategory* /ActivityItem:Item/

    The structure is mostly extracted from openHAB. There are some abstract superclasses to share common token, such as ID, label or description. Some differences to openHAB include:

    • Links are not modelled explicitely, but instead the items are directly referenced within channels
    • Item type was reified instead of a token describing the type. This has the advantage, that the state can be used in a more type-safe way. On the downside, more code is required in some instances, such as for item history, and there is no easy getState method.

    Explainations for the other types:

    • Things represent physical entities, such as a Hue lamp, a complex (or simple) sensor, a monitor, a webservice. They are typed and described by ThingTypes.
    • ThingTypes describe the blueprint for a Thing, like a class does for objects in OO languages. They also have ChannelTypes describing possible capabilities.
    • Items are the capabilities of the things, e.g., the color temperature of a lamp, the measured temperature value of a sensor, a method of a webservice (the last one is probably a bad design). They have a type as described above.
    • Things have Channels (one for each ChannelType of their ThingType) linking their effective capabilities to items via Links, such that those items represent the current value of this capability. A channel has a ChannelCategory describing the capability, e.g., BatteryLevel, Switch, Presence
    • Groups contain other groups, and other items

    MQTT

    • Topics are a flat list, referencing items to be updated upon a message in this topic
    • All topics have one common prefix to subscribe to topics, and another common prefix to publish topics

    Influx

    Basically, here are just some tokens containing information for connection to Influx, such as username, password, host

    Machine Learning

    Handling of machine learning models currently undergoes a change.

    There is a distinction between internal and external models, both implement a encoder interface to get data into those models, and decoder interface to extract data from the models. There are two internal models which are supported: decision trees and neural networks.

    Decision tree are modelled straight-forward, there are inner nodes and leafs. Inner nodes reference an item and check a certain condition for this item to decide whether to follow the left or the right path of the inner node. The classification is equal to the leaf node at the end of the path.