I tried to implement the alarm clock (example III from the wiki.
Unfortunately here
var hour = alarmTimeHour.state as DecimalType
var minute = alarmTimeMinutes.state as DecimalType
if (hour < 10) { msg = "0" }
msg = msg + alarmTimeHour.state.format("%d") + ":"
The SmarHome Designer complains
[QUOTE]
Ambiguous binary operation.
The operator declarations
operator_lessThan(Number,
Number) in NumberExtensions and
operator_lessThan(Type, Number)
in NumberExtensions
both match.
[/QUOTE]
I already postet it on this thread, but I think that the problem there is a different one (?) so in hindsight posting there was not optimal.
What happens when you change the name of hour to something like alarmHour and minute to something like alarmMinute? It looks as though the use of the word hour is ambiguous.
The error is caused by the fact that DecimalType is a Number and a Type and the language can’t figure out which one you really want. If you just cast the state to Number or, as you saw, letting the language itself figure it out will fix the problem.