Squeezebox trouble in openHAB2

Hi In Openhab 1.83 I used this line in a rule to alow streaming diffrent webradiostations and the rule whre trigger by a remotecontrol, this doesn’t seem to work at all in OH 2. I Installed squeexebox baddon linked channels and so on. I Can control volume of player but when i trie to excecute this rule logg says “reset_kitchen_3’: An error occured during the script execution: The name ‘squeezeboxPlayUrl(,,)’ cannot be resolved to an item or type.”

Rule
squeezeboxPlayUrl(“kok”, “http://opml.radiotime.com/Tune.ashx?id=s8291&formats=aac,ogg,mp3,wmpro,wma,wmvoice&partnerId=16&serial=01f7b9ee011ae344013ad42dc335e779”,100)

The binding changed, did you see the description of the new 2.0 binding here:
http://docs.openhab.org/addons/bindings/squeezebox/readme.html

It looks like the PlayUrl has been replaced by a channel called stream, you may want to review the table with all the new channels described in the link above

Ok thanks I’ve reead that but didn’t get any smarter, I tride to replace Play url wit streeam but it seems like I’ve donn’t know the correct syntax for channel streeam

stream(http://123.com/4.mp3) bad exampel but short how could I determine witch player it plays on and witch volume in one command?

With my apologies if I am reading it wrong, but it appears that you are still trying to configure your system with the OH1.8 philosophies in mind.
OH2.0 has drastically changed in the way it interacts with the things you want to control. If you are not familar with it yet, you will have to read up at http://docs.openhab.org/ about “things”, “channels”, “items”, etc
The definition are different (items) and new (things) so you cannot interact with your items the same way you used to do. You will have to define the things first (or use PaperUI), including the channels you need, before you can access them through items and rules.
PaperUI helps, but some things may need to be textually defined in .things files. If you start at the beginning above, it will make more sense. There is also a specific section on how to transition from 1.8 systems:
http://docs.openhab.org/tutorials/migration.html

I Think I got the things thats new with this, but still i beleive the binding wiki is missing some part or else i just missunderstood all the things and items description.

All I need too figure out is how to make switch1 for example play a specific url on a specific player I got 4 of them. Is there som way to find out things file with things and link created with paper ui? or are they going stright to db.

If you work with the PaperUI, things and items go straight to the DB. But you can see, interact and configure everything there too.
Go to the PaperUI and click on the things tab (under Configuration on the left side).
You will see a list of all things that you have defined in the PaperUI
Click on your squeezebox thing of interest and you should see something like this:


And of course more channels underneath the volume one
Note the “show more” button on the right, click that and scroll until you see the info for

That text under the heading Stream URL gives you the correct reference to this channel that you will need for your item definition.
Sorry but that is as far as I can take it, I am not using this function, so cannot help on how the exact syntax will need to read. But you can find more help on this forum, for example here:

Just make sure that the discussion is for the 2.0 binding and not the 1.8;

Now I did get it working I was obviously a bit confused with all new terms things bridges and channels, On generic question I’ve got right now is that the bridge for squeezebox got this long line squeezebox:squeezeboxserver:myServer but could I give thi another string or is this critical for its function.

Thanks for all help

You can define your own things in a textual way in the .things file. However, it either PaperUI or the textual configurations, you cannot have both, in other words, the if you start using textual definition in a .thing file, the PaperUI will not update this file.
Otherwise, the PaperUI offers easy copy and paste, so it may not matter that much.
Hope that helps

Hello

Now I’m starting to get a hold of it I believe but when I try to arrange items via textfile both of my player plays the same music.

.thing file I hope thi is right

Bridge squeezebox:squeezeboxserver:myServer [ ipAddress=“xxxxxxxxxx”, webport=9000, cliport=9090 ]
{
Thing squeezeboxplayer kok[ mac=“c4:e9:84:db:d4:89” ]
Thing squeezeboxplayer hallen[ mac=“60:e3:27:07:6f:0d” ]

.item file

Switch squeezeKokPower “Köket” (gPlayerPower) {channel=“squeezebox:squeezeboxplayer:myserver:kok:power”}

}

I Hope with this configuration not to need the mac adress in every channel link.

please correct me if I’m wrong

Hello

I have a new problem when i send a command to my string item to stream an url it starts playing on both my players

I’ve check an cannot find any missmatch between channel linking and players.

Sent command is below.

sendCommand(squeezeKokStream,“http://opml.radiotime.com/Tune.ashx?id=s17553&formats=aac,ogg,mp3,wmpro,wma,wmvoice&partnerId=16&serial=01f7b9ee011ae344013ad42dc335e779”)

I must reply to my own stupidity I’ve managed to group my players without knowing about it.

Problem solved.

Hello again I’ve got one further problem when I try to run openhab as doorbell I send this command

sendCommand(squeezeKokStream,“file:///etc/openhab2/sounds/doorbell.mp3”)

Player updates and chnages from paus to play and direct from play to pause I dont know if my string is correct should it be /// or //etc for instance or could it be that openhab dosen’t have permission to file witch would be strange since it’s a standard OH file.

Try this in your rule instead (replacing the string with your player thing UID).

var string player = "squeezebox:squeezeboxplayer:28C97261-5842-48AE-85C7-DE2E25AFC5D7:d8eb911a4bf9"
playSound(player, "doorbell.mp3")

I will try to understand this but I use my syntax for use with my HTTP server and there it works so I thought that file:// also should work. I have troubel to understand what you mean.

Your post with the file path implied that doorbell.mp3 is in your OH sounds directory. sendCommand() doesn’t serve up local OH2 files. To do this you have to use playSound() as suggested. The FILE:// syntax is used when playing from a remote player like LMS, not local.

Thanks for all help but now i’m into a new problem error messeag saying no audiosink I don’t know wath to choose since players ar several diffrent?

In PaperUI, Configuration, System, Audio you can select a default Audiosink.
In your rules you can use any Player you want, just as @mhilbush explained in his previous post:

I guess I might have figured out where my problem is but really dont now how to fix it I had default audio system spekaer with mp3 support in paper ui and added in textual cfg enchancedjava… or what’s supposed to be. But when i look att my player theres no UID in properties and in example there seems to be a uid in uppercase with - between series. What have I been doing wrong?

And heres how a channel is set up for the same player

Look what it says below the Channel “Volume” in your Screenshot, that is the UID and then do this:
Try this in your rule instead (replacing the string with your player thing UID):

var string player = "squeezebox:squeezeboxplayer:YOUR-UID"
playSound(player, "doorbell.mp3")

Yes this is my rule for now but still gets error no audio sink even though I set it bot textual and in paper ui. Is there om MP3 support och codec that could be mising, I usally only plays spotify and web radio.

rule "kitchen_door"
when
Item gDO_kokknapp changed from OFF to ON
then
if (gDO_bells.state==ON){
//sendCommand(gDO_kok, ON)
var string player "squeezebox:squeezeboxplayer:571ee880:c4e984dbd489"
playSound(player, “doorbell.mp3”)