Hello there! I am trying to integrate snips with openhab and I am trying to control my multi room chromecast system speakers!
I am able to change song (using spotify binding), via sitemap i can control audio volume by single rooms and by groups (using the slider) but I don’t know how to manage it in a rule! (not so much documentation for chromecast binding…)
using: sendCommand(Music,PAUSE)
I can pause music and it is a starting point, but using: VolumeCasa.sendCommand(INCREASE)
doesn’t work…
I even tried: VolumeCasa.sendCommand(new PercentType(snipsSlot3Value))
with no luck…
“VolumeCasa” and “Music” are in .item file: Dimmer VolumeCasa (gAudio) { channel="chromecast:audiogroup:Casa:volume" } Player Music (gAudio) { channel="chromecast:audiogroup:Casa:control" }
As far as I’m aware, a dimmer item is looking for a number from 0-100, so you can’t send a string (“increase”) to it.
What you could do is use a virtual item to trigger a rule that reads the current volume level into a variable, increases it by x, and sends the new value as a command.
The question I have is, how are you triggering this rule? I would think the slider on your sitemap takes care of manual control, so I’m curious as to how you’re using a rule that will always increase the volume, regardless of what the previous volume is.
That is not true. You are able to send INCREASE/DECREASE commands to a Dimmer Item. But the Bindings have to implement the handling for it on the target Channel. This was not the case for the Chromecast Binding. I added the feature some time ago. It should be available in OH 2.5.0.M1 (milestone build).
I do that too, but it sounds like @Danielsan’s goal was to send commands via an offline voice assistant. When I think about it, I mostly use Google Assistant to control the volume on my Chromecasts.
Good point by @cweitkamp to add upper/lower boundaries with some if statements. I don’t know anything about Snips, but maybe you could even pass a value in the voice command (“set volume to X”).