# RefreshTypes not working with OH 3

**URL:** <https://community.openhab.org/t/refreshtypes-not-working-with-oh-3/114715>\
**Category:** Scripts & Rules\
**Created:** [January 19, 2021, 8:08am UTC](https://community.openhab.org/t/refreshtypes-not-working-with-oh-3/114715 "2021-01-19T08:08:05Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![chill.kroete](https://community.openhab.org/user_avatar/community.openhab.org/chill.kroete/32/101222_2.png) [@chill.kroete](https://community.openhab.org/u/chill.kroete)\
**Post date:** [January 19, 2021, 8:08am UTC](https://community.openhab.org/t/refreshtypes-not-working-with-oh-3/114715/1 "2021-01-19T08:08:05Z")

</div>

Hi,

I updated from 2.5.9 to 3.0 yesterday.  
I am using a rule to detect whether my CCU3 is working, which I originally copied from some post here I guess.  
Since the update I am receiving:

> The name ‘RefreshType’ cannot be resolved to an item or type

Searching for “RefreshType” did not get any results with this problem for me.

So how can I force the refresh of an item in OH 3?

---

<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:** [January 19, 2021, 11:51am UTC](https://community.openhab.org/t/refreshtypes-not-working-with-oh-3/114715/2 "2021-01-19T11:51:43Z")

</div>

> [@chill.kroete](#):
>
> I am using a rule

We might want to see that. Are you trying to import the type? Not necessary I think.

---

<div class="post-metadata">

**Author:** ![chill.kroete](https://community.openhab.org/user_avatar/community.openhab.org/chill.kroete/32/101222_2.png) [@chill.kroete](https://community.openhab.org/u/chill.kroete)\
**Post date:** [January 19, 2021, 4:56pm UTC](https://community.openhab.org/t/refreshtypes-not-working-with-oh-3/114715/3 "2021-01-19T16:56:22Z")

</div>

Hi,

I thought this was a general issue so I did not include my code, but here you go:

```
rule "Trigger CCU3 Variable refresh"
when
    Time cron "0 1,16,31,46 * 1/1 * ? *"
then
    CCU3_Connection_Test.sendCommand(RefreshType.REFRESH);

    val lastResetString = CCU3_Connection_Test.state.toString();

    if (lastResetStringPreviousValue != lastResetString) {
        lastResetStringPreviousValue = lastResetString;
        if (Status_CCU3_Available.state != ON) {
            Status_CCU3_Available.sendCommand(ON);
        }
    } else {
        logDebug("ccu3.rules", "No update was made by CCU3 - last update: " + lastResetStringPreviousValue);
        if (Status_CCU3_Available.state != OFF) {
            Status_CCU3_Available.sendCommand(OFF);
        }
    }
end

```

As I mentioned above I copied from somewhere and it worked before the update.

---

<div class="post-metadata">

**Author:** ![chill.kroete](https://community.openhab.org/user_avatar/community.openhab.org/chill.kroete/32/101222_2.png) [@chill.kroete](https://community.openhab.org/u/chill.kroete)\
**Post date:** [January 19, 2021, 8:18pm UTC](https://community.openhab.org/t/refreshtypes-not-working-with-oh-3/114715/4 "2021-01-19T20:18:19Z")

</div>

Hi,

I think I got it sorted out by correcting my import:  
`import org.eclipse.smarthome.core.types.RefreshType`  
became  
`import org.openhab.core.types.RefreshType`.  
The error does not occur anymore and my state item switched back to `ON` (which means the CCU 3 is available).

---

<div class="post-metadata">

**Author:** ![Malti1812](https://community.openhab.org/user_avatar/community.openhab.org/malti1812/32/68137_2.png) [@Malti1812](https://community.openhab.org/u/Malti1812)\
**Post date:** [January 19, 2021, 8:28pm UTC](https://community.openhab.org/t/refreshtypes-not-working-with-oh-3/114715/5 "2021-01-19T20:28:33Z")

</div>

For me the import is shown as an error in the rule  
import org.openhab.core.types.RefreshType.  
org highlighted in red

---

<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:** [January 19, 2021, 8:34pm UTC](https://community.openhab.org/t/refreshtypes-not-working-with-oh-3/114715/6 "2021-01-19T20:34:39Z")

</div>

> [@chill.kroete](#):
>
> `CCU3_Connection_Test.sendCommand(RefreshType.REFRESH)`

Have you tried just  
`CCU3_Connection_Test.sendCommand(REFRESH)`  
with no import

---

<div class="post-metadata">

**Author:** ![Malti1812](https://community.openhab.org/user_avatar/community.openhab.org/malti1812/32/68137_2.png) [@Malti1812](https://community.openhab.org/u/Malti1812)\
**Post date:** [January 19, 2021, 8:42pm UTC](https://community.openhab.org/t/refreshtypes-not-working-with-oh-3/114715/7 "2021-01-19T20:42:21Z")

</div>

Top
