[PLUGIN] Pandora Plugin 2.0

I’m pretty sure you need the actual path to your home assistant configuration directory. In my case, it is /etc/hass/config/bin. This is in the shell_command/shell_command_volumio.yaml file.

If I’m not mistaken, you need those. However, I have not looked at this code in over a year.

2022-05-01 13:08:58 ERROR (MainThread) [homeassistant.components.shell_command] Error running command: /config/socketio_send_volumio_cmd.py pandora clearAndPlayStation '{ "stationName": "{{ newStation }}" }', return code: 1

A return code of 0 (zero) means the command worked. Anything else is an error. This may be related to your path of /config

Version 2.10.3 pushed to my repo. The Pandora icon is now black and white, not grayscale, to fit the Volumio standards. I had been notified of this a few months ago and didn’t see the comment.

Users may have to clear their browser caches to see the change. One can try switching the plugin off and then back on (I think). If that doesn’t work, follow the advice left by @davestlou and @HeadGeek a few posts ago.

Updated to 2.10.3 and confirmed icon change to B/W: image
There must be image caching in the iOS app, and I don’t see how to refresh without a reinstall. Flushing the cache works fine with the web client.

@truckershitch, again thanks for all the help!!

I finally had time to implement the “On Demand” Thumbs down. What I am doing is changing the setting in the plugin configuration and then sending the “next” command then reverting the config setting after so it no longer the default action. I do this in my custom interface (Python Flask & JavaScript) when I drag the current song into the trash bin. Here is the code if it helps anyone and maybe you can expose the thumbs down function at some point.

elif service == "pandora":
    maxStationTracks = "maxStationTracks"
    nextIsThumbsDown = "nextIsThumbsDown"
    print("============================ PANDORA THUMBSDOWN =============================="    )
    #Change the thumbsdown action in "Plugin Playback Options" to True
    #maxStationTracks must be set in order to not throw an error
    sio.emit("callMethod",{"endpoint":"music_service/pandora","method":"setPlaybackOptionsConf","data":{nextIsThumbsDown: True, maxStationTracks: 16}})
    time.sleep(1.5)
    #sio.emit("next")
    sio.emit("callMethod",   {"endpoint":"music_service/pandora","method":"next"})
    #Return the thumbsdown action in "Plugin Playback Options" to False
    sio.emit("callMethod",{"endpoint":"music_service/pandora","method":"setPlaybackOptionsConf","data":{nextIsThumbsDown: False, maxStationTracks: 16}})
    r = title + " removed from queue and " + strPlaylist

@GlennBurnett

Try this out. Append these lines to /data/plugins/music_service/pandora/index.js:

ControllerPandora.prototype.thumbsDown = function () {
    var self = this;
    const fnName = 'thumbsDown';

    self.pUtil.announceFn(fnName);

    return self.pandoraHandler.thumbsDownTrack(self.getQueueTrack());
};

After that, you should be able to use callMethod to hit the thumbsDown() function. That function does not take an argument and would “demote” the currently playing track.

You may want to consider writing your own interface. You could get much more information than this plugin gathers if you need it. My plugin uses the anesidora nodeJs library to access the API below.

https://6xq.net/pandora-apidoc/json/

@truckershitch , that worked perfectly! Looks like the callMetod call is working:
image
However I am not seeing on my thumbs down list in Pandora. It should be at the top of the list on Pandora’s site.
image
Thanks again!! Ill look into the anesidora API.

Glenn

I see one possible error in pandora_hander.js. I have not tested it but I will after lunch, and I’m going to add future support for thumbsUp as well.

in the very bottom of pandora_handler.js there is this:

PandoraHandler.prototype.thumbsDownTrack = function (track) {
    const self = this;

Try changing that to
var self = this;

That may be it right there. Javascript skips errors sometimes by design.

At any rate I’ll have a look at it in a couple of hours.

That did not work for me. Still get a successful notification from Volumio, but still doesn’t actually thumbs down the track.

Thanks!!

@GlennBurnett PM sent

Hi folks :smiley:

I don’t know how many of you read this, but the Pandora plugin is now in the Plugin Store in Volumio. You can just download it like any regular plugin.

Current version is 2.11.2

There have been a couple of small changes. One bug that I had overlooked for some time fixed the initial installation. If there is no login / password entered, the plugin will go to a browse screen that directs the user to enter this information in the Plugin Settings instead of searching until the cows come home.

There are a few other changes and they can be found in the Readme.md file that gets installed. That file is also on the Github site linked at the top of this thread.

I try to help people with issues as best I can, so don’t hesitate to post a bug or a feature request.

Rock on.

1 Like

truckershitch

Saw that the plugin is now “official” :grinning: - thanks for the great work :+1:t5:

Regards

@truckershitch ,

Thanks for all the help and great work!!

@HeadGeek @GlennBurnett and everyone else: No problem. This has been a great learning experience on my end.

I’m glad folks are enjoying the plugin.

Hi @truckershitch

Is it possible to switch Pandora Modes in the plugin?
https://help.pandora.com/s/article/Tips-to-improve-stations-1519949305949?language=en_US

If not, are there any plans to support these modes?

Thank you!

Hi @aleksmath

Unfortunately, the plugin’s capabilities are limited by the Unofficial Pandora API. It does not get frequent updates, and Pandora Modes are not (currently) supported.

If you change the mode in another client or on the Pandora website, the mode of the station should change.

Thanks!

@truckershitch

I didn’t realize that the modes are saved between clients. That’s good to know. I’ll check how it works.

Thank you for the information.

Has anyone gotten pandora to play automatically on start up? Currently using painobar and patiobar on another setup but want to accomplish similar setup with volumio.

Hey @toasterboy1

I’m sorry for the late reply – I’m not sure how to automatically start a plugin when Volumio begins. That is one issue.

Then other issue: when this plugin loads, you have to select a station manually. Currently, it will not start playing when it loads up. I have not explored this option.

Version 2.12.1 is now available in Volumio.
The changes are found at the end of the Readme.md file.

The installation instructions at the top may be disregarded – they are for a manual installation of the plugin. This is unnecessary for regular releases.

Hows this working for everyone? I get errors whenever trying to open a station of : Error: No Results