Item not 'accepted' in rules file

Hi all

I’m slowly expanding my OH2 configuration, and just added an Ikea Trådfri Gateway and just one light bulb.
The binding installed nicely, and my light bulb was found.
I added the light into my items file,

Switch IKEA_1 "IKEA 1" <light> { channel="tradfri:0100:gwb072bf258703:65537:brightness"}

and also into my sitemap file,

Switch item=IKEA_1 label="IKEA 1"

This simple setup lets me switch the light on and off with the switch on the BasicUI page, and specifically the IKEA_1 item seems to be ok.

If I add this simple rule to my rules file,

rule "IKEA_1 ON"
when
  Time cron "0 0 22 * * ?" 
then
  IKEA_1.sendCommand(ON)
end

it doesn’t work.
In ESH Designer, it marks IKEA_1 with error “The method or field IKEA_1 is undefined”, and in the OH log it states

2017-07-20 11:07:34.059 [WARN ] [el.core.internal.ModelRepositoryImpl] - Configuration model 'default.rules' is either empty or cannot be parsed correctly!

The exact same configuration approach works fine for my z-wave power outlet, so I was expecting this to work as well, but no…

Any suggestions?
(Apart from reading docs. I’ve tried…)

/Olof

If I remember well: If you open the entire OPENHAB_CONF folder in ESHD (including the items folder) it will recognize the item name and will not display this error.

Your rule looks fine. I don’t know what could be wrong…

Maybe try to use another text editor?
How are you saving the rules file to your OH2 system?
(are you using Samba shares?)

It turned out that a restart of ESHD got it to understand the IKEA_1 item.

The warning in the log about problem parsing the file is still there though.

The rules work however, so it seems that it is parsed correctly after all.

Strange…

If you are using Samba shares to store the config files, check this:

Yes, I use Samba shares, editing the files in ESHD on Win10 while the OH2 is running on an RPi3.
So I guess the parsing “problem” is exactly what’s described in your answer.

Thank you!

/Olof

1 Like