Hello!
i have a hard time with a number that’s not really a number…
{"sessionId":"123","customData":null,"siteId":"default","input":"mach die musik um zehn lauter","asrTokens":[[{"value":"mach","confidence":1.0,"rangeStart":0,"rangeEnd":4,"time":{"start":0.0,"end":0.51}},{"value":"die","confidence":1.0,"rangeStart":5,"rangeEnd":8,"time":{"start":0.51,"end":0.51}},{"value":"musik","confidence":1.0,"rangeStart":9,"rangeEnd":14,"time":{"start":0.51,"end":1.02}},{"value":"um","confidence":0.96901065,"rangeStart":15,"rangeEnd":17,"time":{"start":1.02,"end":1.2027891}},{"value":"zehn","confidence":0.9816874,"rangeStart":18,"rangeEnd":22,"time":{"start":1.2027891,"end":1.5010988}},{"value":"lauter","confidence":1.0,"rangeStart":23,"rangeEnd":29,"time":{"start":1.5010988,"end":2.52}}]],"intent":{"intentName":"test12345:volume_up","confidenceScore":0.9739778},"slots":[{"rawValue":"zehn","value":{"kind":"Number","value":10.0},"range":{"start":18,"end":22},"entity":"snips/number","slotName":"amount","confidenceScore":0.9816874}]}
with " $.slots[0].value.value " i get the result “10.0”, but that’s as far as it gets…
i tried this one, but i’m not able to make any use of it…:
val amount = transform("JSONPATH", "$.slots[0].value.value", StringItem.state.toString)
NumberItem.postUpdate( amount )
logInfo("Test: ", (NumberItem)
comes to this error
2019-03-10 23:10:12.729 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule 'Snips Volume': An error occurred during the script execution: Could not invoke method: org.eclipse.smarthome.model.script.actions.LogAction.logInfo(java.lang.String,java.lang.String,java.lang.Object[]) on instance: null
in the end i would like to change the volume on my squeezebox:
squeezeboxVolume.sendCommand((squeezeboxVolume.state as DecimalType).intValue + "Value of my **** NumberItem")
this works for example
squeezeboxVolume.sendCommand((squeezeboxVolume.state as DecimalType).intValue + 3)
what am i doing wrong? i just lost 1.5 hours while trying everything i found on the forum. (please do not ask my WHAT i tried, bc in the end nothing worked and i didn’t write down everything )
good night!
narf!