I switch my sonos on by increasing the volume to a certain level with a delay of 5 sec between every increase and that is working fine.
Only I don’t understand why the volume is always 1 lower than I configure.
I the code below the value of HuidigKeukenRadioVolume = 11 and SonosPlay1KeukenVolume = 10.
SonosPlay1KeukenVolume.sendCommand (HuidigKeukenRadioVolume.state as Number)
HuidigKeukenRadioVolume.sendCommand (HuidigKeukenRadioVolume.state as Number + 1)
SonosPlay1KeukenVolume.sendCommand (HuidigKeukenRadioVolume.state as Number)
TimerRadioVolumeKeukenAan.sendCommand(ON)
after adding a delay it is working
HuidigKeukenRadioVolume.sendCommand (HuidigKeukenRadioVolume.state as Number + 1)
createTimer(now.plusSeconds(1),[|
SonosPlay1KeukenVolume.sendCommand (HuidigKeukenRadioVolume.state as Number)
TimerRadioVolumeKeukenAan.sendCommand(ON)
])
Can it be that the line
HuidigKeukenRadioVolume.sendCommand (HuidigKeukenRadioVolume.state as Number + 1) is not processed before SonosPlay1KeukenVolume.sendCommand (HuidigKeukenRadioVolume.state as Number) is processed?