Skip to content

4.5. Conditions

John edited this page Dec 25, 2015 · 8 revisions

Conditions provide the possibility to enable/disable complete messages for a particular variant of a device.

A good example for this is a product line of heat pumps, each of which answers to the same query with different meanings of the returned values (e.g. evaporator temperature versus air outlet temperature).

In order to make a message definition conditional, the first field (the message type) has to be prefixed with one or more condition names in square brackets. The rough syntax of a conditional message definition is this:

[conditions part]message part,fields part

The conditions part consists of one or more condition names in square brackets, e.g.:

[airtowater][SW>201][HW>=100]r,ehp,prerun,,,08,B509,0D9E01,...

In this example, the message "prerun" for the circuit "ehp" is only valid, if the conditions named "airtowater", "SW>201", and "HW>=100" are all met, i.e. these are combined using a logical AND operator.

Condition definition

In order to use a named condition, it has to be defined in the same CSV file before the message using it. A condition definition line is prefixed with a "*" (just like a defaults row) and looks like this:

*[CONDITIONNAME],MESSAGECIRCUIT,MESSAGENAME,COMMENT,FIELDNAME,ZZ,VALUES

The individual columns are these:

  • CONDITIONNAME:
    The name of the condition.
  • MESSAGECIRCUIT:
    The circuit name of the message carrying the values the condition is composed of (defaults to the own circuit name derived from the CSV file name).
  • MESSAGENAME:
    The name of the message carrying the values the condition is composed of. If left empty, the condition references the scan of the own slave address or another.
  • COMMENT:
    An optional comment for the condition.
  • FIELDNAME:
    The name of the message field carrying the values the condition is composed of. If left
  • ZZ:
    The optional slave address from which to read the message (defaults to the own address).
  • VALUES:
    The values the references message field has to carry in order for the condition to be true. This can be either a single value, a value range, or a list of those. If left empty, the referenced message is only checked for having been seen.