Select Git revision

René Schöne authored
DSL.md 4.95 KiB
The eraser-DSL
Find a general description in the Model description page, and the parser (dev, master) and printing (dev, master).
The DSL is line-based, so on each line, one model element will be defined.
All shown specifications for one element are optional and can be reordered, but at least id
must be present to identify the element.
References to other elements are done by using their IDs as strings, and can be forward references.
The following elements can be described (in the master branch if not otherwise noted):
ChannelType
ChannelType: id="" label="" description="" itemType="" category="" readyOnly;
- The item type has to be one of the item names defined for Eclipse Smart Home
- The category can either be one of the categories defined for Eclipse Smart Home, or a custom one.
- Both item type and category are defined as enums (dev, master)
- The flag
readOnly
is currently without any effect
Channel
Channel: id="" type="" links=["ITEM_ID", "ITEM_ID"];
-
type
must reference a ChannelType, and must be set -
links
must reference items
Group
Group: id="" groups=["GROUP_ID", "GROUP_ID"] items=["ITEM_ID", "ITEM_ID"] aggregation=AGG;
-
groups
must reference other groups -
items
must reference items -
AGG
inaggregation
can either be one ofEQUALITY
,AVG
,MAX
,MIN
,SUM
; or one ofAND
,OR
,NAND
,NOR
, followed by a list of arguments surrounded by round brackets, e.g.,aggregation = AVG
oraggregation = AND ("off", "on")
. The semantics are described in the openHAB docs
Item
ITEM_TYPE Item: id="" label="" state="" category="" topic="" controls=["ITEM_ID", "ITEM_ID"] metaData={"key":"value"};
-
ITEM_TYPE
can be one of the following:Color
,Contact
,DateTime
,Dimmer
,Image
,Location
,Number
,Player
,RollerShutter
,String
,Switch
. If left out, the item will behave as ifString
was used. -
state
is given as a string and will be interpreted depending on the type of the item -
topic
implicitely defines a MQTT topic which is used to update the item in both directions. The full topic is prefixed withincoming
-prefix if receiving updates from openHAB, andoutgoing
-prefix if sending updates to openHAB -
category
is currently not used -
controls
is only available ondev
. It defines connection of one item controls the state of another item as the state of the first item changes. -
metaData
contains key-value-pairs comprising its meta data
Parameter
Parameter: id="" label="" description="" type="" default="" required;
-
type
has to be one of the following:Boolean
,Decimal
,Integer
,Text
-
default
is currently an arbitrary String, thus it is not checked whether it matches the type
ThingType
ThingType: id="" label="" description="" parameters=["PARAM_ID", "PARAM_ID"] channelTypes=["CHANNEL_TYPE_ID", "CHANNEL_TYPE_ID"];
-
parameters
must reference parameters -
channelTypes
must reference channel types
Thing
Thing: id="" label="" type="" channels=["CHANNEL_ID", "CHANNEL_ID"] ;
-
type
must reference a thing type, and must be set -
channels
must reference channels
Mqtt
Mqtt: incoming="" outgoing="" host="";
- MQTT is used to communicate/synchronize with openHAB
-
incoming
defines the prefix for received MQTT messages, see topic description in item. Defaults to an empty string, which should be avoided. -
outgoing
defines the prefix for sent MQTT messages, see topic description in item. Defaults to an empty string, which should be avoided. -
host
defines the URL of the host running an MQTT broker. The port will be set to1883
and cannot be changed.
Influx
Influx: user="" password="" dbName="" host="" ;
- Influx is used to store historical item states
-
user
andpassword
define connection credentials -
dbName
defines the name of the database to use -
host
defines the URL of the host running an InfluxDB. The port will be set to8086
and cannot be changed.