# Problems with item changed and-received-update

**URL:** <https://community.openhab.org/t/problems-with-item-changed-and-received-update/100026>\
**Category:** Scripts & Rules\
**Created:** [June 3, 2020, 12:35pm UTC](https://community.openhab.org/t/problems-with-item-changed-and-received-update/100026 "2020-06-03T12:35:28Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![milo](https://community.openhab.org/letter_avatar_proxy/v4/letter/m/85e7bf/32.png) [@milo](https://community.openhab.org/u/milo)\
**Post date:** [June 3, 2020, 12:35pm UTC](https://community.openhab.org/t/problems-with-item-changed-and-received-update/100026/1 "2020-06-03T12:35:28Z")

</div>

Hello all,  
I have an issue with a rule triggered after some time round about 2h.

I have an esp8266 dash button which send via mqtt a mesage to a item. If this item is changed it should trigger a rule but after around 2 hours silence of this button the item is changed but the rule is not triggered

here is the code

```csv
MQTT
Thing mqtt:topic:button (mqtt:broker:mosquitto) {
Type string : JSONstate_value "JSONstate_value" [stateTopic="button/state/json", transformationPattern="JSONPATH:$.value"]
}

String	string_button_statejsonvalue "button JSON State Value" <mobile> {channel="mqtt:topic:button:JSONstate_value"}

rule "Handle button"
when
    Item string_button_statejsonvalue changed
then

```

is there a better way or any issues with my code???

---

<div class="post-metadata">

**Author:** ![rossko57](https://community.openhab.org/user_avatar/community.openhab.org/rossko57/32/70263_2.png) [@rossko57](https://community.openhab.org/u/rossko57)\
**Post date:** [June 3, 2020, 1:36pm UTC](https://community.openhab.org/t/problems-with-item-changed-and-received-update/100026/2 "2020-06-03T13:36:20Z")

</div>

> [@milo](#):
>
> the item is changed

Can you show us that in your `events,log` ?  
What un-changed the Item from a previous button press?

> [@milo](#):
>
> but the rule is not triggered

How do you know?  
The rule shown is incomplete.  
Does your rules file load? (look in your `openhab.log`)

---

<div class="post-metadata">

**Author:** ![milo](https://community.openhab.org/letter_avatar_proxy/v4/letter/m/85e7bf/32.png) [@milo](https://community.openhab.org/u/milo)\
**Post date:** [June 3, 2020, 2:04pm UTC](https://community.openhab.org/t/problems-with-item-changed-and-received-update/100026/3 "2020-06-03T14:04:51Z")

</div>

attached the log

```csv
2020-06-03 16:00:51.992 [vent.ItemStateChangedEvent] - string_button_statejson changed from {"event":"p[6].b[4].val", "value":0} to {"event":"p[6].b[4]", "value":"ON"}

2020-06-03 16:00:51.994 [vent.ItemStateChangedEvent] - string_button_statejsonvalue changed from 0 to ON

```

and the rule

```csv
rule "Handle Master"
when
    Item string_button_statejsonvalue changed
then
    logInfo ("Handle ", "triggerd")
    //parse out data from JSON string (page, button, value)
    var String eventpage = string_button_statejsonevent.state.toString.split("\\[").get(1).split("\\]").get(0)
    var String eventbutton = string_button_statejsonevent.state.toString.split("\\[").get(2).split("\\]").get(0)
end

```

the loginfo is not written that’s why i know it is not triggerd

---

<div class="post-metadata">

**Author:** ![rossko57](https://community.openhab.org/user_avatar/community.openhab.org/rossko57/32/70263_2.png) [@rossko57](https://community.openhab.org/u/rossko57)\
**Post date:** [June 3, 2020, 2:17pm UTC](https://community.openhab.org/t/problems-with-item-changed-and-received-update/100026/4 "2020-06-03T14:17:52Z")

</div>

> [@rossko57](#):
>
> Does your rules file load? (look in your `openhab.log` )

Have you ensured the rle “name” is unique across all your rules files?

---

<div class="post-metadata">

**Author:** ![milo](https://community.openhab.org/letter_avatar_proxy/v4/letter/m/85e7bf/32.png) [@milo](https://community.openhab.org/u/milo)\
**Post date:** [June 3, 2020, 2:18pm UTC](https://community.openhab.org/t/problems-with-item-changed-and-received-update/100026/5 "2020-06-03T14:18:39Z")

</div>

yes

---

<div class="post-metadata">

**Author:** ![rossko57](https://community.openhab.org/user_avatar/community.openhab.org/rossko57/32/70263_2.png) [@rossko57](https://community.openhab.org/u/rossko57)\
**Post date:** [June 3, 2020, 2:28pm UTC](https://community.openhab.org/t/problems-with-item-changed-and-received-update/100026/6 "2020-06-03T14:28:44Z")

</div>

Unless you have some other very badly behaved rules hogging all the execution threads, there’s nothing wrong. You’ve missed something somewhere.

Make yourself another rule as well

```php
rule "Extra diagnostic"
when
    Item string_button_statejsonvalue changed
then
    logInfo ("diag", "triggered")
end

```

After editing, look in your `openhab.log` for a rules file refreshed message.

---

<div class="post-metadata">

**Author:** ![milo](https://community.openhab.org/letter_avatar_proxy/v4/letter/m/85e7bf/32.png) [@milo](https://community.openhab.org/u/milo)\
**Post date:** [June 3, 2020, 2:35pm UTC](https://community.openhab.org/t/problems-with-item-changed-and-received-update/100026/7 "2020-06-03T14:35:40Z")

</div>

Done this but this time the new function is not triggered only my old one

---

<div class="post-metadata">

**Author:** ![rossko57](https://community.openhab.org/user_avatar/community.openhab.org/rossko57/32/70263_2.png) [@rossko57](https://community.openhab.org/u/rossko57)\
**Post date:** [June 3, 2020, 2:51pm UTC](https://community.openhab.org/t/problems-with-item-changed-and-received-update/100026/8 "2020-06-03T14:51:21Z")

</div>

Okay, that does sound like you’ve got other rules blocking new rule starts.

---

<div class="post-metadata">

**Author:** ![milo](https://community.openhab.org/letter_avatar_proxy/v4/letter/m/85e7bf/32.png) [@milo](https://community.openhab.org/u/milo)\
**Post date:** [June 3, 2020, 2:51pm UTC](https://community.openhab.org/t/problems-with-item-changed-and-received-update/100026/9 "2020-06-03T14:51:58Z")

</div>

how can I check this?

---

<div class="post-metadata">

**Author:** ![rossko57](https://community.openhab.org/user_avatar/community.openhab.org/rossko57/32/70263_2.png) [@rossko57](https://community.openhab.org/u/rossko57)\
**Post date:** [June 3, 2020, 2:54pm UTC](https://community.openhab.org/t/problems-with-item-changed-and-received-update/100026/10 "2020-06-03T14:54:02Z")

</div>

Easy way probably to disable other rules by renaming files xxx.rules to xxx.rules.bak or something. You’d then need to restart openHAB to kill any rules already running and looping.

---

<div class="post-metadata">

**Author:** ![milo](https://community.openhab.org/letter_avatar_proxy/v4/letter/m/85e7bf/32.png) [@milo](https://community.openhab.org/u/milo)\
**Post date:** [June 3, 2020, 2:55pm UTC](https://community.openhab.org/t/problems-with-item-changed-and-received-update/100026/11 "2020-06-03T14:55:28Z")

</div>

means i need to disable every rule file and enable it one by one?

---

<div class="post-metadata">

**Author:** ![rossko57](https://community.openhab.org/user_avatar/community.openhab.org/rossko57/32/70263_2.png) [@rossko57](https://community.openhab.org/u/rossko57)\
**Post date:** [June 3, 2020, 3:06pm UTC](https://community.openhab.org/t/problems-with-item-changed-and-received-update/100026/12 "2020-06-03T15:06:34Z")

</div>

Only if you want to eliminate them as suspects.

---

<div class="post-metadata">

**Author:** ![milo](https://community.openhab.org/letter_avatar_proxy/v4/letter/m/85e7bf/32.png) [@milo](https://community.openhab.org/u/milo)\
**Post date:** [June 11, 2020, 2:14pm UTC](https://community.openhab.org/t/problems-with-item-changed-and-received-update/100026/13 "2020-06-11T14:14:24Z")

</div>

> [@Rule execution lags, possibly Java GC](https://community.openhab.org/t/rule-execution-lags-possibly-java-gc/98095/50):
>
> @milo To to summarize, you’re getting a delay on actions/rules processing…not just on the 1st time a rule runs, but intermittently after the rule hasnt been run e.g. the system has been booted for 24+ hours… the rule you are experiencing the delay with HAS been run before in that 24 hours… but now its being slow/delayed again? If thats what you’re experiencing, obviously there are a ton of variables involved e.g. have you a massive rule-set etc… but for the purposes of this reply, Ill just ass…
