{"action":"created","issue":{"url":"https://api.github.com/repos/openhab/openhab-core/issues/126","repository_url":"https://api.github.com/repos/openhab/openhab-core","labels_url":"https://api.github.com/repos/openhab/openhab-core/issues/126/labels{/name}","comments_url":"https://api.github.com/repos/openhab/openhab-core/issues/126/comments","events_url":"https://api.github.com/repos/openhab/openhab-core/issues/126/events","html_url":"https://github.com/openhab/openhab-core/issues/126","id":212958941,"number":126,"title":"Item received command in 2.1.0-SNAPSHOT seems to be broken","user":{"login":"Spybyte","id":5479103,"avatar_url":"https://avatars2.githubusercontent.com/u/5479103?v=3","gravatar_id":"","url":"https://api.github.com/users/Spybyte","html_url":"https://github.com/Spybyte","followers_url":"https://api.github.com/users/Spybyte/followers","following_url":"https://api.github.com/users/Spybyte/following{/other_user}","gists_url":"https://api.github.com/users/Spybyte/gists{/gist_id}","starred_url":"https://api.github.com/users/Spybyte/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Spybyte/subscriptions","organizations_url":"https://api.github.com/users/Spybyte/orgs","repos_url":"https://api.github.com/users/Spybyte/repos","events_url":"https://api.github.com/users/Spybyte/events{/privacy}","received_events_url":"https://api.github.com/users/Spybyte/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2017-03-09T07:44:23Z","updated_at":"2017-03-09T10:33:51Z","closed_at":"2017-03-09T10:12:17Z","body":"Today I installed the latest 2.1.0-SNAPSHOT and had some problems with rules. I broke it down to the following test scenario.\r\n\r\nItem\r\n`Switch Test`\r\n\r\nRules\r\n```rule \"Test Send Command\"\r\nwhen\r\n\tTime cron \"3/10 * * * * ?\"\r\nthen\r\n\tif (Test.state == ON) {\r\n\t\tlogInfo(\"Test Send Command\", \"Test Send Command - Sending command OFF to Test\")\r\n\t\tTest.sendCommand(OFF)\r\n\t} else {\r\n\t\tlogInfo(\"Test Send Command\", \"Test Send Command - Sending command ON to Test\")\r\n\t\tTest.sendCommand(ON)\r\n\t}\r\nend\r\n\r\nrule \"Test Log Command\"\r\nwhen\r\n\tItem Test received command\r\nthen\r\n\tlogInfo(\"Test Log Command\", \"Test Log Command - Test.state is {}\", Test.state)\r\nend\r\n```\r\n\r\nOften it works as expected. But sometimes I get the following output:\r\n\r\n```08:35:03.007 [INFO ] [thome.model.script.Test Send Command] - Test Send Command - Sending command ON to Test\r\n08:35:03.012 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'Test' received command ON\r\n08:35:03.018 [INFO ] [rthome.model.script.Test Log Command] - Test Log Command - Test.state is OFF\r\n08:35:03.024 [INFO ] [marthome.event.ItemStateChangedEvent] - Test changed from OFF to ON\r\n```\r\nThe rule is executed, because Test received ON but Test.state is still OFF. Afterwards the ItemStateChangedEvent applied.\r\n\r\nIf I use `changed`or `received update` on the `Item` it works as expected.\r\n\r\nIf this is the expected behavior, please let me know and I will close this topic.\r\n\r\nCheers\r\nBjörn"},"comment":{"url":"https://api.github.com/repos/openhab/openhab-core/issues/comments/285315725","html_url":"https://github.com/openhab/openhab-core/issues/126#issuecomment-285315725","issue_url":"https://api.github.com/repos/openhab/openhab-core/issues/126","id":285315725,"user":{"login":"maggu2810","id":204670,"avatar_url":"https://avatars1.githubusercontent.com/u/204670?v=3","gravatar_id":"","url":"https://api.github.com/users/maggu2810","html_url":"https://github.com/maggu2810","followers_url":"https://api.github.com/users/maggu2810/followers","following_url":"https://api.github.com/users/maggu2810/following{/other_user}","gists_url":"https://api.github.com/users/maggu2810/gists{/gist_id}","starred_url":"https://api.github.com/users/maggu2810/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maggu2810/subscriptions","organizations_url":"https://api.github.com/users/maggu2810/orgs","repos_url":"https://api.github.com/users/maggu2810/repos","events_url":"https://api.github.com/users/maggu2810/events{/privacy}","received_events_url":"https://api.github.com/users/maggu2810/received_events","type":"User","site_admin":false},"created_at":"2017-03-09T10:33:51Z","updated_at":"2017-03-09T10:33:51Z","body":"You should continue such discussion in the community forum... ;)\r\nYour assumption is correct, on an update the value could be unchanged (it makes sense to send such updates, as you e.g. know that the peer is still alive etc.), on a change the old state and the new state differ."}}
{"actor":{"display_login":"maggu2810"}}