Delay in rules

Hi guys!

I have a problem I can’t figure out on my own. I’m using the HTTP binding to get some information from my wireless speakers (BlueSound). I put the volume in an item like this:

Number blueVolume { http="<[blueKitchenStatusCache:1000:XSLT(blue_status_volume.xsl)]" }

My transform looks like this:

<xsl:stylesheet version='2.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
    <xsl:output method='text' indent='no'/>
    <xsl:template match='/'>
        <xsl:value-of select="SyncStatus/@volume" />
    </xsl:template>
</xsl:stylesheet>

While debugging I have stripped down my rules a lot, they look like this right now:

var Timer timer = null
val int timeoutMins = 15
var long last_motion = 0
var int counter = 0

var int MIN_VOLUME = -50
var int MAX_VOLUME = -10

rule "Bluesound Volume Change"
when
	Item blueVolume changed
then
	//if (Marantz_Mode.state == "Music") {
	var blueVol = (blueVolume.state as DecimalType).intValue
	var volume = MIN_VOLUME + (blueVol * (MAX_VOLUME - MIN_VOLUME) / 100)
		
	logInfo("Marantz", "Volume: {}", volume)
	
//	postUpdate(marantzVolume, volume)
	//}
end

When testing, I see in the log that my blueVolume item changes, but weirdly enough, it takes quite a while before I can see my debug print:

18:21:25.042 [INFO ] [marthome.event.ItemStateChangedEvent] - blueVolume changed from 19 to 39
18:21:35.353 [INFO ] [marthome.event.ItemStateChangedEvent] - blueVolume changed from 39 to 19
18:21:45.486 [INFO ] [marthome.event.ItemStateChangedEvent] - blueVolume changed from 19 to 0
18:22:09.512 [INFO ] [lipse.smarthome.model.script.Marantz] - Volume: -50
18:22:09.512 [INFO ] [lipse.smarthome.model.script.Marantz] - Volume: -50
18:22:09.512 [INFO ] [lipse.smarthome.model.script.Marantz] - Volume: -50

No one? :confused:

Weird, but today it’s working… Wonder whats causing that weird behaviour…

21:01:57.757 [INFO ] [marthome.event.ItemStateChangedEvent] - blueVolume changed from 28 to 11
21:01:57.760 [INFO ] [lipse.smarthome.model.script.Marantz] - Volume: -46
21:02:07.900 [INFO ] [marthome.event.ItemStateChangedEvent] - blueVolume changed from 11 to 24
21:02:07.901 [INFO ] [lipse.smarthome.model.script.Marantz] - Volume: -41
21:02:28.280 [INFO ] [marthome.event.ItemStateChangedEvent] - blueVolume changed from 24 to 11
21:02:28.281 [INFO ] [lipse.smarthome.model.script.Marantz] - Volume: -46
21:02:38.438 [INFO ] [marthome.event.ItemStateChangedEvent] - blueVolume changed from 11 to 32
21:02:38.439 [INFO ] [lipse.smarthome.model.script.Marantz] - Volume: -38
21:02:48.564 [INFO ] [marthome.event.ItemStateChangedEvent] - blueVolume changed from 32 to 24
21:02:48.567 [INFO ] [lipse.smarthome.model.script.Marantz] - Volume: -41