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