Properties
mmrc
/device ID
/node ID
/property ID
: this is the base topic of a property. Each property must have a unique property ID on a per-node basis which adhere to the ID format.A property payload (e.g. a sensor reading) is directly published to the property topic, e.g.:
Property Attributes
mmrc
/device ID
/node ID
/property ID
/$property-attribute
:
The following attributes are required:
Topic | Description | Payload type |
---|---|---|
$name | Friendly name of the property. | String |
$datatype | The data type. See Payloads. | Enum: [integer, float, boolean,string, enum, color] |
The following attributes are optional:
Topic | Description | Payload type |
---|---|---|
$format | Specifies restrictions or options for the given data type | See below |
$settable | Settable (true ). Default is read-only (false ) | Boolean |
$retained | Non-retained (false ). Default is Retained (true ). | Boolean |
For example, our temperature
property would send:
Settable and retained:
Properties can be settable. For example, you don't want your
temperature
property to be settable in case of a temperature sensor (like the car example), but to be settable in case of a thermostat.Properties can be retained. A property is retained by default. A non-retained property would be useful for momentary events (door bell pressed).
A combination of those flags compiles into this list:
- retained + non-settable: The node publishes a property state (temperature sensor)
- retained + settable: The node publishes a property state, and can receive commands for the property (by controller or other party) (lamp power)
- non-retained + non-settable: The node publishes momentary events (door bell pressed)
- non-retained + settable: The node publishes momentary events, and can receive commands for the property (by controller or other party) (brew coffee)
Format:
- For
integer
andfloat
: Describes a range of payloads e.g.10:15
- For
enum
:payload,payload,payload
for enumerating all valid payloads. - For
color
:rgb
to provide colors in RGB format e.g.255,255,0
for yellow.hsv
to provide colors in HSV format e.g.60,100,100
for yellow.
Property command topic
mmrc
/device ID
/node ID
/property ID
/set
: The device must subscribe to this topic if the property is settable (in case of actuators for example).
A MMRC controller publishes to the set
command topic with non-retained messages only.
The assigned and processed payload must be reflected by the MMRC device in the property topic mmrc
/ device ID
/ node ID
/ property ID
as soon as possible.
This property state update not only informs other devices about the change but closes the control loop for the commanding controller, important for deterministic interaction with the client device.
To give an example: A kitchen-light
device exposing the light
node with a settable power
property subscribes to the topic mmrc/kitchen-light/light/power/set
for commands:
In response the device will turn on the light and upon success update its power
property state accordingly: