Question about values

maybe a stupid question
This one works:

			LivingSpotsDimmer.sendCommand(0)
			LivingLusterDimmer.sendCommand(0)
			LivingLedPlankjesDimmer.sendCommand(0)
			LivingLedTvDimmer.sendCommand(0)

This one don’t work: the send commands are inside a rule

		val Number valLivingSpotsDimmerOff=0
		val Number valLivingLusterDimmerOff=0
		val Number valLivingLedPlankjesDimmerOff=0
		val Number valLivingLedTvDimmerOff=0

			LivingSpotsDimmer.sendCommand(valLivingSpotsDimmerOff)
			LivingLusterDimmer.sendCommand(valLivingLusterDimmerOff)
			LivingLedPlankjesDimmer.sendCommand(valLivingLedPlankjesDimmerOff)
			LivingLedTvDimmer.sendCommand(valLivingLedTvDimmerOff)

What did i do wrong?

Try using var instead of val and post the complete rule if that does not work.

Rules DSL is a bit loose and weird about typing, and then sendCommand is picky about what it is fed.
On the face of it, commanding a Dimmer type with a Number should be fine, but I suspect it wants a DecimalType

A circumvention is to make it parse the command
LivingSpotsDimmer.sendCommand(valLivingSpotsDimmerOff.toString)

it was a solution… but a val Number and a var Number gives normally the same result

thx

1 Like

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.