Tried to set invalid state 0 (DecimalType) on item Lights [...] ignoring it

Tags: #<Tag:0x00007f7452e4ea58>

Hello!
I’m migrating my openHAB 1.8 to 2.2.0

Into my home.items I have this:

Group:Switch:OR(ON, OFF)        Lights          "Tutte le luci [(%d)]"                          (All)
Group:Contact:OR(OPEN, CLOSED)  Windows         "Finestre aperte [(%d)]"        <contact>       (All)
Group:Rollershutter             Shutters        "Tapparelle"                    <rollershutter> (All)
Group:Rollershutter             Skylights       "Lucernai"                      <rollershutter> (All)
Group:Rollershutter             Tenda           "Tenda ingresso"                <rollershutter> (All)

But after the upgrade the openHAB 2.2 show this:

2018-03-14 16:46:11.847 [ERROR] [pse.smarthome.core.items.GenericItem] - Tried to set invalid state 0 (DecimalType) on item Lights of type SwitchItem, ignoring it
2018-03-14 16:46:11.857 [ERROR] [pse.smarthome.core.items.GenericItem] - Tried to set invalid state 0 (DecimalType) on item Windows of type ContactItem, ignoring it
2018-03-14 16:46:11.866 [ERROR] [pse.smarthome.core.items.GenericItem] - Tried to set invalid state 0 (DecimalType) on item Shutters of type RollershutterItem, ignoring it
2018-03-14 16:46:11.875 [ERROR] [pse.smarthome.core.items.GenericItem] - Tried to set invalid state 100 (DecimalType) on item Skylights of type RollershutterItem, ignoring it
2018-03-14 16:46:11.884 [ERROR] [pse.smarthome.core.items.GenericItem] - Tried to set invalid state 60 (DecimalType) on item Tenda of type RollershutterItem, ignoring it

I’ve checked the migration tutorial (https://docs.openhab.org/tutorials/migration.html) without any good indication.

Could you help me?

Regards

I think in the group Group:Switch:OR(ON, OFF) Lights are different types of items (numbers, contacts, …)? Not all of them want to receive 0, some want OFF, OPEN, … Use only one type of item per such a group. I run into the same problem. In OH 1.x this was accepted, in OH2.2 not.

Please post your item-file.
This are group-item and you try to change it direct.

Mmm… I’m not sure.
For example “Rollershutter” are only “Rollershutter”…

This was the defaul “demo.items” from 1.x with the same sintax…

/* active groups */
Group:Switch:OR(ON, OFF)                Lights          "All Lights [(%d)]"                                                             (All)
Group:Switch:OR(ON, OFF)                Heating         "No. of Active Heatings [(%d)]"         <heating>               (All)
Group:Number:AVG                        Temperature     "Avg. Room Temperature [%.1f °C]"       <temperature>   (Status)
Group:Contact:OR(OPEN, CLOSED)          Windows         "Open windows [(%d)]"                           <contact>               (All)

Even if openHAB 2 report it as an error:

[ERROR] [pse.smarthome.core.items.GenericItem] - Tried to set invalid state 60 (DecimalType) on item Tend of type RollershutterItem, ignoring it

the “Group:xxxx” work correcty.

Isn’t it?

Regards

I think the problem is, that the rollershutter are configured in thing file as Dimmer items?

Can you post the complete item config. Which means all items that are in the groups from first post.

What is the rule triggering the error message in post 5
DecimalType is deprecated in OH2 and you need to use Number type

I’m not using DecimalType…
Here the LOG for “Skylights”

2018-03-16 12:35:52.591 [ERROR] [pse.smarthome.core.items.GenericItem] - Tried to set invalid state 75 (DecimalType) on item Skylights of type RollershutterItem, ignoring it

and here the .items

Rollershutter        L_1       "L1 [%d %%]"  <skylight>      (gM, Skylights)  { knx = ... }
Rollershutter        L_2       "L2 [%d %%]"  <skylight>      (gM, Skylights)  { knx = ... }
Group:Rollershutter  Skylights "L1-2"        <rollershutter> (Skylights)

As you can see I’ve changed

Group:Rollershutter  Skylights "L1-2"        <rollershutter> (All)

to

Group:Rollershutter  Skylights "L1-2"        <rollershutter> (Skylights)

without good results.

About .rules I’ve not errors.
The ERROR LOG is present only at every .items reload.

It looks like the group belongs to itself

Could it be a bug?

Hm,

just to sum up. You have a group:

Group:Rollershutter  Skylights "L1-2"        <rollershutter> (Skylights)

And only two rollershutter item in it? Nothing more in it?

What do you do that this error comes? click on the sitemap? If yes, can you send us the sitemap part too.

@vzorglub
“DecimalType is deprecated in OH2 and you need to use Number type”

Where have you found this? I used it a lot times in my rules and all is working and no such an error in log.

Number item RandomTimerTime

if((RandomTimerTime.state as DecimalType).intValue <= 30)

It won’t throw an error. I just through that it could be the case here but I don’t use rollershutters.

The group belongs to itself

Group:Rollershutter  Skylights "L1-2"        <rollershutter> // (Skylights)

Right!

Only during OH2 startup or after a change in .items

???

Configuration model 'home.items' has errors
    therefore ignoring it: [219,61]: missing EOF at ';'
Group:Rollershutter  Skylights "L1-2"        <rollershutter>

Remove the (Skylights) at the end, the group can’t belong to itself.
I have a suggestion.
Try:

Group:Rollershutter:AVG  Skylights "L1-2"        <rollershutter>

Always the same result…
Even if OH2 report this as an ERROR, it work correctly.
I give up… :smirk:

This is the wrong syntax, delete the ‘;’ at the end. In OH ‘;’ is not used except ‘return;’ in a rule

Group:Rollershutter  Skylights "L1-2"        <rollershutter> (Skylights)

I knew that!!! Sometimes I go blind and stupid:sunglasses: