Error with DecimalType

I have a problem with this rule…
In the log the following error comes up and I can´t solve it, hope someone can help :blush:

Rule 'Set alarm timers': org.eclipse.smarthome.core.library.types.DecimalType

import org.eclipse.smarthome.core.library.types.DecimalType
import org.eclipse.smarthome.model.script.actions.Timer
import org.joda.time.DateTime

var Timer thermostatTimer = null
var Timer testTimer = null
rule “Set alarm timers”
when
Item heiz_wecker_joerg_timer received command
then
var int zeit = (heiz_wecker_joerg_timer.state as DecimalType).intValue

val alarmDT = new DateTime(now.plusSeconds(60))
heiz_wecker_joerg.sendCommand(alarmDT.toString)

  if(testTimer != null) testTimer.cancel
  testTimer = createTimer(now.plusSeconds(zeit), [ |
      heiz_handtuch_bad.sendCommand(ON) 
      testTimer = null
  ])

end

Items:

String heiz_wecker_joerg “Wecker Heizung Jörg [%s]”
String heiz_wecker_joerg_timer “Timer Heizung Jörg [%s]”

What is the error message?

Silly me… see first line… duh…

It is already above :wink:

heiz_wecker_joerg_timer is defined as a string, not a number

Typical parsing example here

1 Like