Hi all
Hope someone can help me here.
After the latest OH update I have problems with a rule, the rule have been working perfect for the last 1/2 year.
I get this error now:
07:24:06.186 [ERROR] [untime.internal.engine.RuleEngineImpl] - Rule 'Start Hue Colors fading in Triangle Window': An error occurred during the script execution: Couldn't invoke 'assignValueTo' for feature JvmVoid: (eProxyURI: hue.rules#|::0.2.16.2.0.0.2.0.0::0::/1)
My rule look like this
import org.openhab.core.library.types.*
import org.openhab.model.script.actions.*
import org.joda.time.DateTime
var int percent = 0
var Timer fade_Timer1 = null
var Timer fade_Timer2 = null
var Timer fade_Timer3 = null
var Timer fade_Timer4 = null
var Timer fade_Timer5 = null
var Timer fade_Timer6 = null
----------------------------------------------------------------------------
rule "Start Hue Colors fading in Triangle Window"
when
Item smarthouse_lux changed from OFF to ON
or
Item Light4_ON changed from OFF to ON
or
Item Light4_Toggle changed from OFF to ON
or
Item Light5_ON changed from OFF to ON
then
if (smarthouse_lux.state == ON) {
var Timer timer = null
// set a timer to sligtly change the color again and again
timer = createTimer(now, [|
Hue_Fade_Next.sendCommand(now.toString)
if (timer != null) {
timer.reschedule(now.plusSeconds(10))
}
])
}
else {
timer = null
}
end
// Fade a bit.
rule "Hue Fade Next"
when
Item Hue_Fade_Next changed
then
if (smarthouse_lux.state == ON) {
// get your current color
var hsb = Light4_Color.state as HSBType
// change it a little bit
var DecimalType hue = new DecimalType(hsb.hue.intValue % 360 + 1) // 0-360; 0=red, 120=green, 240=blue, 360=red(again)
var PercentType sat = new PercentType(hsb.saturation.intValue) // 0-100
var PercentType bright = new PercentType(100) // 0-100 (hsb.brightness.intValue)
var PercentType bright1 = new PercentType(40) // 0-100 (hsb.brightness.intValue)
var HSBType newHsb = new HSBType(hue,sat,bright)
var HSBType newHsb1 = new HSBType(hue,sat,bright1)
Light4_Color.send(newHsb)
Light5_Color.send(newHsb1)
}
end