Error on transform

Just can not get this error resolved

items this returns 45.34

Number node14temperature “node 14 Temp [°F %.2f]” (temperature,Node14) { mqtt="<[mosquitto:home/rfm_gw/nb/node14/dev48:state:default]" }

top of the rules. I think the
import org.openhab.core.transform.* imports all but not sure.

import org.openhab.core.library.types.*
import org.openhab.core.persistence.*
import org.openhab.model.script.actions.*
import org.openhab.action.squeezebox.*
import org.joda.time.*
import org.eclipse.xtext.xbase.lib.*
import org.openhab.model.script.actions.Timer

import org.openhab.core.transform.*
//import org.openhab.core.transform.actions
//import org.openhab.core.transform.TransformationException
//import org.openhab.core.transform.TransformationHelper
import org.openhab.core.transform.TransformationService
//import org.openhab.core.transform.internal.TransformationActivator

rule “scale and post temp to fiber light”
when
Item node14temperature changed
then
//logInfo(“Item B_led_1 changed”,“Item B_led_1”)

  var Number r = transform("SCALE", "fiberlightOutside.scale",node14temperature.state.toString)
  
  postUpdate(B_led_1, v)

logInfo(“Item Blue_1_scale changed”,“Scaled number” + r)
end

I have a fiberlightOutside.scale file in the transform folder with this -
[81,110]=20
[71,80[=50
[61,70[=100
[51,60[=150
[41,50[=200
[31,40]=250
[25,30]=254
[0,24]=255

And this is the error
Couldn’t resolve reference to JvmIdentifiableElement ‘transform’.

Stuck on this
Thanks for helping

Where does variable v come from? You might want to instead say

var r = transform("SCALE", "fiberlightOutside.scale",node14temperature.state.toString)
B_led_1.postUpdate(new DecimalType(r))

Assuming item B_led_1 is a Number item. Hopefully this helps, but it obviously doesn’t match the error you’re getting.

I still get the ‘transform’. error can this be a import error?

Couldn’t resolve reference to JvmIdentifiableElement ‘transform’.

v was r from trying other converter lines

I pasted the second line and got
Missig error message for org.eclipse.xtext.xbase.validation.IssueCodes.invalid_generic_argument_types

now this is the rule
rule “scale and post temp to fiber light”
when
Item node14temperature changed
then
//logInfo(“Item B_led_1 changed”,“Item B_led_1”)
var r = transform(“SCALE”, “fiberlightOutside.scale”,node14temperature.state.toString)
B_led_1.postUpdate(new DecimalType®)

// var Number r = transform(“SCALE”, “fiberlightOutside.scale”,node14temperature.state.toString)
// postUpdate(B_led_1, r)
logInfo(“Item Blue_1_scale changed”,“Scaled number” + r)
end

Thank you for looking

You don’t need to and should not import any action packages – they are added for you. Perhaps that is confusing the situation? From your imports, I would remove these lines:

import org.openhab.core.transform.* imports all but not sure.
import org.openhab.core.persistence.*
import org.openhab.model.script.actions.*
import org.openhab.action.squeezebox.*
import org.eclipse.xtext.xbase.lib.*
import org.openhab.model.script.actions.Timer

import org.openhab.core.transform.*
//import org.openhab.core.transform.actions
//import org.openhab.core.transform.TransformationException
//import org.openhab.core.transform.TransformationHelper
import org.openhab.core.transform.TransformationService
//import org.openhab.core.transform.internal.TransformationActivator

Possibly more imports should be removed as well.

I commented out all of them, and the only thing is I got a error on the timer rules so I added that one back.
import org.openhab.model.script.actions.Timer

I did save and the rule runs and the transform works but is still show as a error.

rule “scale and post temp to fiber light”
when
Item node14temperature changed
then
var r = transform(“SCALE”, “fiberlightOutside.scale”,node14temperature.state.toString)
B_led_1.postUpdate(new DecimalType®)
logInfo(“Item Blue_1_scale changed”,"Scaled number " + r)
end

Maybe this is like the squeezeboxPlayUrl I can not get that one to go away also.
with import org.openhab.action.squeezebox.*
But it seems like a line from the WIKI would not show a error without user error.
Thanks so much for your help

I fixed the bug in openHAB 1.8 where transform shows as an error in Designer, but as you saw it will still run in a rule anyway.

Thanks for your work. This is working now.

1 Like