[SOLVED] OH2 - Transform works only occasionally

All,
after using the transform files from OH1 in OH2 I just needed to change “-” with “NULL” which was obviously the major change regarding transformation in OH.

However, it seems that it’s not working reliably. Every now and then it seems that OH2 just cannot read the *.map files which leads to the following error messages:

2016-10-09 18:23:53.056 [WARN ] [rm.AbstractFileTransformationService] - Could not transform '-' with the file 'anaus.map' : Target value not found in map for '-'
2016-10-09 18:23:55.749 [WARN ] [rm.AbstractFileTransformationService] - Could not transform 'NULL' with the file 'abusMode.map' : Target value not found in map for 'NULL'

I also can observe this in the GUI (iOS), where “an” sometimes changes to “ON”.
Is this a known issue?

You say “every now and then.” Do you see a pattern when this occurs? Do you see any errors during startup complaining about the Map transform being unavailable?

I have a similar problem with XSLT when I first restart OH. It complains the XSLT transform is not installed and the first value it pulls down doesn’t get parsed. But each subsequent pull down of the data gets transformed without error. It appears to be a timing issue during startup where the HTTP binding starts pulling the data before the XSLT transform is available.

Hi @rlkoshak (again :wink:
You are very active helping me out here and I really appreciate your support.

That’s actually an excellent point.
You mean it might be related to a similar problem with rules not being found in older OH 1.x versions?
You are possibly right and I will check that.

Currently I am playing around with OH2 a lot, so a restart is frequently done.
That might have disguised the startup problem.

Consider it to be solved - I guess I need to be a little more patient during startup phase… :wink:

Obviously the problem is back and it’s definitely not related to startup.
The system was running for a more than a day without any changes when it occurred this morning again:
2016-10-19 06:31:00.444 [WARN ] [rm.AbstractFileTransformationService] - Could not transform ‘-’ with the file ‘anaus.map’ : Target value not found in map for '-'
According to the information about OH2 (I read it somewhere mentioned by Kai as far as I remember) I replaced “-” with NULL, but I guess this was a missunderstanding:
“uninitialized” was changed to “NULL”, but “-” should still be in the transformation file!?

I believe you still need to use “-” in your .map file for Uninitialized. One uses NULL when testing for Uninitialized in a Rule.

The big question is what is Hsiang to cause your Items to become Uninitialized. An Item with a State should only have the possibility of becoming Uninitialized again during an OH reboot or a change to any .items file.

I’ve found a similar transform ‘bug’ with OH2.1…

2017-07-03 08:37:17.927 [WARN ] [rm.AbstractFileTransformationService] - Could not transform ‘1’ with the file ‘status.map’ : Target value not found in map for ‘1’

The problem is it’s not reading the first line in the transform file. If I insert a carriage return for the first line of the transform file (in my case, my status.map file) it works fine, reading mappings from line 2 onwards. I’ve tested this by moving mappings around, putting for example mapping for ‘0’ on line 1 then saving the file, the error changes to “Could not transform ‘0’…”

You should file an issue at the Eclipse Smarthome github project.