[SOLVED] PercentType of sat is not updating

`rule "Wake-Up Start"
 when Time cron "0 26 19 ? * MON-FRI *"
 then
LichtSZLinks_Color.postUpdate(10,98,2);
logInfo("WakeUp","WakeUp: " + LichtSZLinks_Color.state.toString)
WakeUp.sendCommand(ON)

end

rule "Wake-Up Light"
when //Item WakeUp changed 
	Time cron "*/2 * * * * ?"
then
 
var DecimalType hue
var PercentType sat
var PercentType brightValue
var HSBType newHsb

if (WakeUp.state == ON) {
	//logInfo("WakeUp", "WakeUp started "+ LichtSZLinks_ColorTemperature)
	logInfo("WakeUp", "Licht Color " + LichtSZLinks_Color.state)
		//3,94,1 Anfang
	//14,70,100
	//20,62
	//43,33
	var hsb  	= LichtSZLinks_Color.state as HSBType
	hue 	 	= new DecimalType(10) //hsb.hue.intValue) //Farbwert
	sat 	 	= new PercentType(hsb.saturation.intValue - 1 ) //Farbsättigung
	brightValue = new PercentType(hsb.brightness.intValue % 100 + 1);
	
	//var PercentType bright = new PercentType(brightValue)
	newHsb = new HSBType(hue, sat, brightValue)
	LichtSZLinks_Color.sendCommand(newHsb);
	
	if (brightValue >= 100) {
		LichtSZLinks_Color.sendCommand(OFF)
		WakeUp.sendCommand(OFF)
	}
}
end
`
LichtSZLinks_Color.postUpdate(10,98,2);

in the error log I got this message: WakeUp: 39,99,10

and when I handle WakeUp per switch the next time I got WakeUp: 39,98,10, so the “default value” of LichtSZLinks_Color.postUpdate(10,98,2);
is not effectiv :frowning:

some one some hints?

greetings
Thomas

or how I set a default value for Color in a rule?

here we go… the right code :slight_smile:

LichtSZLinks_Color.sendCommand(new HSBType(new DecimalType(10), new PercentType(100), new PercentType(1)))

https://community.openhab.org/t/how-can-i-send-a-color-as-command/34241
thx this post :slight_smile:
now it works