Possible to Get Pandora Working on Home Assistant OS?

I am using the x86 flavor of Home Assistant OS and would like to get Pandora (pianobar) working. I see in the documentation this is likely not possible (Pandora - Home Assistant), but wasn’t sure if anything has changed, this is out of date, or if there is a workaround. I did add the pandora media player and it seems to add the entity but just can’t login because Pandora credentials were never added to the config file. If there is another approach to getting Pandora working in HA as well, it would be great to know.

Thanks!

Our documentation is not out of date on this, the documentation is correct.

If you happen to have a spare raspberry pi laying around you can use that. I have a raspberry pi 3b with a hifi berry amp2 driving my outdoor speakers. I created a python script/service to run and control pianobar via MQTT. I then made a custom component media player for Home Assistant to control everything. Seems to work great for me so far.

Really old post, but in my searches for similar this post came up a lot, so providing “another approach” as requested. My solution was to install Pandora on the Logitech Media Server (so it handles all credentials), then use telnet to open the LMS CLI and send the desired commands based on a user pressing a Button on the Hass.io UI. I rarely add to Pandora’s “Your Stations”, so static links are sufficient. And, while more time consuming to setup, I have a Switch for every Pandora Your Station and Squeezebox where I want to play media (so there are duplicates (only the MAC changes) where I want to play the same station on different Squeezeboxes).

In code:

  • Open Putty (or your preferred Telnet service) and Telnet into the LMS (by default it’s at port 9090)- an empty terminal window will open.
  • Open the LMS interface and start playing one of Pandora’s Your Stations.
  • Click “Settings” in the LMS interface, click the “Information” tab, and record the “Player MAC Address” for the device you want to load a stream. (Perhaps this can be done dynamically later or with additional plugins, but my goal is to stick with a stock Hass.io without Add-ons other than ‘File editor’). And, side note, while your MAC is likely how your Server talks to the Squeezeboxes, I think there are instances where that’s not universally correct.
  • Empty terminal window and enter the command:
<Player MAC Address> playlist path ?

So, for me, I entered:
b8:27:eb:78:ee:ba playlist path ?
  • The output will reference the unique *.mp3 address for Your Station (repeat the above for each station you want to play):
b8%3A27%3Aeb%3A78%3Aee%3Aba playlist play pandora%3A%2F%2F4520457780289766275.mp3
  • Test your configuration by changing the currently playing Your Station (in LMS), and entering the output command into Telnet after substituting the %3A in the MAC with colons, and verifying the music plays:
b8:27:eb:78:ee:ba playlist play pandora%3A%2F%2F4520457780289766275.mp3
  • Then, add a telnet service and switches for each station you want to add in your configuration.yaml. Change the names to identify the items in your installation, and resource to match the IP address of your Logitech Media Server:
switch:
  - platform: telnet
    switches:
      kitchensqboxmodernrock:
        name: modernrockmusic
        resource: 192.168.1.15
        port: 9090
        command_on: "b8:27:eb:78:ee:ba playlist play pandora%3A%2F%2F4520457780289766275.mp3"
        command_off: ""
  • Last, add Buttons to your UI to each Switch, here’s an excerpt:
type: vertical-stack
cards:
  - type: horizontal-stack
    cards:
      - show_name: true
        show_icon: false
        type: button
        tap_action:
          action: call-service
          service: switch.turn_on
          data: {}
          target:
            entity_id: switch.kitchensqboxmodernrock
        entity: switch.kitchensqboxmodernrock
        show_state: false
        name: Modern Rock Music
  • Now, I have a grouping of Buttons on my UI that, when pressed, changes the station on each Squeezebox.
1 Like

I use Volumio with Pandora Premium account plug-in. Then in the GUI I just use an iframe to display and control Volumio … which gives me Pandora, Spotify, DLNA servers, NAS (local music). Old laptop or PI is all you need. Audio stereo output goes to input to my Dayton Audio Dax88 in one of the 7 input zones.

1 Like

This should absolutely be possible. Here is the alpine package:
https://pkgs.alpinelinux.org/package/edge/community/x86/pianobar

I successfully installed it on Home Assistant Green via the terminal. I was able to login and choose a station.

However, it complained about not being able to access the default ALSA audio device, which I guess is because HASSOS runs audio in a separate docker container?

Update: Got it working. First with an addon, but no UI access. Then, with little more than adding apk add pianobar pulse, I got it working in the official integration.

Final hurdle is that the output is currently only the left speaker, which happened in addon form too.

i’m getting this error when trying to add the repository

Sorry, the addon isn’t usable (except to play a single station) because, again, I got it to work with the official integration. So no addon needed.

For now, here’s the lines I added to the official component, it’s all in this one file:

So if you really want it now, you can copy the pandora component to your custom folder and make that change, substituting your own email and password.

Hmmm, I could copy your efforts there, but it seems like it’d be more ideal to execute it fully as an addon without any terminal effort to make it fairly click-button to use and along with best practices.

Can you provide some extra detail about why it would only be usable as a single station using the addon? I’m thinking it shouldn’t be terrible to make a little daemon process that accepts REST requests from HA and invokes pianobar properly. Thoughts?