LogReader Doc: newErrorEvent or lastErrorEvent?


(Max G) #1

In https://www.openhab.org/addons/bindings/logreader/
example.rules says:

rule "LogReader"
    when
        Channel "logreader:reader:openhablog:newErrorEvent" triggered
    then
        // do something
    end

… which calls upon newErrorEvent; however, this is not defined as an item in example.items.

Do I need to define newErrorEvent (if it even exists) in items, or should the rule refer to lastErrorEvent?

[later edit] Also, I just noticed that filePath to ${OPENHAB_LOGDIR}/openhab.log is a `required** parameter in the thing definition. However, the example.things does not list it.

I have defined the thing as shown in the example, and it seems to work; hence, the “parameter required” field should change to “no”?!


(Pali) #2

newErrorEvent is a trigger channel, which is always available (doesn’t need any defination).

filePath is mandatory/required parameter and default value in thing definition is ${OPENHAB_LOGDIR}/openhab.log. If user doesn’t define it, openHAB framework provides the default value and binding doesn’t need to care if parameter is defined or not.