Calculate time on and energy use for an item/switch rule

This should be:

(RoofRuntimeMsec.state as DecimalType).longValue

An Item carries a State which in turn carries the Number which you can get at using longValue, intValue, doubleValue, etc.

This is because by default the Rules engine casts all numerical values to BigDecimal. So if you do something like the following it should eliminate that warning:

val double hours = (totalMsec/1000.0/60.0/60.0).doubleValue