Raspberry Pi 4 Model B Rev 1.1 / 4GB
openHAB 3.1.0.M4
I’m in the weeds trying to understand writing a Jython Rule … I’m sure I have many issues but I’m currently trying to understand something very basic with the following code:
from core.rules import rule
from core.triggers import when
@rule("Hall Bath Motion test", description="Turn on the Hall bath light when motion detected")
#@when("Item Kitchen_Motion received update")
@when("Item Hall Bath Motion received update")
def Hall_Bath_Motion(event):
Hall_Bath_Motion.log.info("Hall Bath Motion Detected")
Generates the following error:
2021-05-07 10:55:39.640 [DEBUG] [jsr223.jython.core.rules ] - Added rule 'Hall Bath Motion test'
2021-05-07 10:55:39.643 [ERROR] [ore.common.registry.AbstractRegistry] - Cannot inform the listener "org.openhab.core.automation.internal.RuleEngineImpl$2@421885" about the "ADDED" event: Value not a number in cron expression 'Item Hall Bath Motion received update' in field 'DayOfWeek': For input string: "UPDATE"
But if I use
@when("Item Kitchen_Motion received update")
instead of
@when("Item Hall Bath Motion received update")
Everything works as expected … so, the question is … what could possibly be different between the two Items (Hall Bath Motion and Kitchen_Motion)? There are both Zigbee devices and work fine in other scripts.
Any guesses?