# PIR sensor, timer rule won't work as intended

**URL:** <https://community.openhab.org/t/pir-sensor-timer-rule-wont-work-as-intended/39496>\
**Category:** Scripts & Rules\
**Tags:** rules, zwave1, pir\
**Created:** [February 1, 2018, 12:54pm UTC](https://community.openhab.org/t/pir-sensor-timer-rule-wont-work-as-intended/39496 "2018-02-01T12:54:07Z")\
**Posts on this page:** 1\
**Showing post:** 31

<div class="post-metadata">

**Author:** ![Curtis](https://community.openhab.org/user_avatar/community.openhab.org/curtis/32/65210_2.png) [@Curtis](https://community.openhab.org/u/Curtis)\
**Post date:** [February 6, 2018, 3:41pm UTC](https://community.openhab.org/t/pir-sensor-timer-rule-wont-work-as-intended/39496/31 "2018-02-06T15:41:22Z")

</div>

I’ve updated OpenHAB as a just in case and because I needed to do it anyway. I’ve also done some tweaking and Googling but I still have an error.😕

I wonder if it is anything to do with the following:

> [@Could not invoke method: org.eclipse.smarthome.model.script.actions.BusEvent.sendCommand(org.eclipse.smarthome.core.items.Item,java.lang.String) on instance: null](https://community.openhab.org/t/could-not-invoke-method-org-eclipse-smarthome-model-script-actions-busevent-sendcommand-org-eclipse-smarthome-core-items-item-java-lang-string-on-instance-null/36416):
>
> So I managed to update to snapshot and now I have a little quirk in one of my rules scripts. That’s the script part: case "xxxxxx" : { //double button, hallway, left if (HallwayDim.state \> 50) { if (sceneSwitch.state == 0) { if (isNight.state == ON) sceneSwitch.sendCommand(2) else sceneSwitch.sendCommand(4) } else if (sceneSwitch.state \> 0) sceneSwitch.sendCommand(sceneSwitch.state)…

---

_[View the full topic](https://community.openhab.org/t/pir-sensor-timer-rule-wont-work-as-intended/39496)._
