Dear Community, I used OH 2.x in the past with some stable running rules in DSL and doing my first steps now on OH 3, where I want to change to ECMA for the rules. But the current huge issues are the triggers, that don’t work.
I could find a solution in the community yet.
openHAB 3.2.0. Release Build; APT installation on Debian 10/buster
For days I am fiddling around to get rules triggered by change of a state.
Tried rules in DSL, ECMA and Blockly - each trigger configured in the UI - none worked.
Here is a simple test rule where the trigger does not work. No entries in the logs caused by the triggered rule.
configuration: {}
triggers:
- id: "1"
configuration:
itemName: ch_BsmtSr_Plug_WaMa
type: core.ItemStateChangeTrigger
conditions: []
actions:
- inputs: {}
id: "2"
configuration:
type: application/javascript
script: >-
var logger =
Java.type('org.slf4j.LoggerFactory').getLogger('org.openhab.rule.' +
ctx.ruleUID);
logger.info('MB Rule Trigger Test ECMA START. Current power consumption: ' + itemRegistry.getItem('ch_BsmtSr_Plug_WaMa').getState() + " W");
type: script.ScriptAction
Only when I press the “Run Now” button I get the expected log entry. So the rule itself seems to work and the value of the plug (34 W) is there.
==> /var/log/openhab/openhab.log <==
2022-01-15 23:26:19.669 [INFO ] [org.openhab.rule.Trigger_Test_ECMA ] - MB Rule Trigger Test ECMA START. Current power consumption: 34 W
With another test rule I tried “Trigger at a specific time” - that didn’t work either.
The only rule that is running is triggered by “When the system has reached start level: 50”.
Thanks a lot - any hint is appreciated!