yes . write the item definition in items file exactly as listed.
the MotionLatch.sendCommand(ON) goes into a rule file which is triggered by however your motion detector indicates motion occurred. Guessing from your fragment it would be something like:
rule "Motion ON"
when
Item Living_Motion changed
then
if (DU1_E35_Motion.state == //however it indicates detected motion ){
Motion_Latch.sendCommand(ON)
end
You need to examine the events.log file and verify what commands are happening and when.
After calling:
MotionLatch.sendCommand(ON)
you should see a related entry:
…Item ‘MotionLatch’ received command ON` or it could be changed from OFF to ON
You’ve set a sensible short 10second timer for testing so waiting 10 seconds and you should see that event go through the events.log
…Item ‘MotionLatch’ received command OFF`
Verify the basic bits are working and move up from there. I find making lots of changes to items and rules can upset OH so also worth restarting the service sometimes to make sure all is well. Also as it starts monitor the openhab.log and make sure no errors are coming up.
Hey Ray, i reboot my raspberry many times and after than i don’t see in the event. log file:
MotionLatch.sendCommand(ON)
but I see :
2017-11-09 19:57:01.785 [ItemStateChangedEvent ] - Living_Motion changed from NULL to 0
2017-11-09 12:58:55.696 [ItemStateChangedEvent ] - Living_Motion_UTC changed from NULL to 2017-11-09 08:32:46
And in the Openhab.log i have many errors like:
2017-11-09 21:34:45.123 [WARN ] [el.core.internal.ModelRepositoryImpl] - Configuration model ‘HSLU_AAL.items’ has errors, therefore ignoring it: [4,28]: mismatched input ‘�’ expecting RULE_STRING
[4,29]: missing ‘}’ at ‘10s’
[4,32]: extraneous input ‘,’ expecting RULE_ID
What is in HSLU_AAL.items? Although OH has labelled it [WARN] it’s also clearly telling you that the file is being ignored due to problems found in it. It’s generally a bad idea to ignore errors, sure sometimes it’s not relevant and you can get away with it but looking at what has been suggested in this thread it is really a ‘simple rule’ and unlikely a bug in OH therefore you need to pay attention to the detail of your error logs.
[4,28] I think refers to line 4 column 28 so go fix it in HSLU_AAL.items. Get your start up clean and error free, make sure the items you’ve created are visible in PaperUI, sitemap, Habpanel or whatever GUI tool you’re using and then go back to testing the execution and monitor events.log for MotionLatch entries.