Skip to content

trapd00r/hass-mpd-ikea

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hass + mpd + ikea styrbar + webhook + beets

Various custom webhooks that I use together with homeassistant, mpd, plex(amp) and the ikea styrbar 5-button remote

First, grab the excellent webhook from here

We will execute it as follows in this directory once we are done with all the setup:

webhook -hooks hooks.json -verbose

homeassistant configuration.yaml:

rest_command:
  mpd_love_song:
    url: "http://192.168.1.12:9000/hooks/mpd_love_song"
  mpd_randomize:
    url: "http://192.168.1.12:9000/hooks/mpd_randomize"

Next, create an automation using this blueprint.

You can create the mappings using the webui, but here's what it looks like in yaml:

   action_button_up_long:
   - service: rest_command.mpd_love_song
     data: {}
   action_button_down_long:
   - service: rest_command.mpd_randomize
     data: {}

actual programs that will be executed on a webhook request

love

Love the currently playing song in mpd when I long-press the up button on my ikea 5-button remote.

A few things happen:

  • Love the song in pimpd2

  • Copy the song to a pre-defined directory where all loved songs reside

  • Add a new custom tag in beets, called loved; this allows for beet / beet2mpd to accept queries like:

    beet2mpd loved:1 albumtype:single

    Which will add all loved songs that are considered singles.

  • Update the smart playlists that beet handles.

  • Send a very beautiful notification to the desktop. It's red.

    screenshot

curl http://192.168.1.12:9000/hooks/mpd_love_song

mpd_randomize

Clear the playlist and add 250 random songs to the playlist with a long press on the down button

curl http://192.168.1.12:9000/hooks/mpd_randomize

mpd_add_recent

Clear the playlist and use beet2mpd to add the most recently imported files to mpd (12h period).

curl http://192.168.1.12:9000/hooks/mpd_add_recent

plexlove

Love the currently playing song in plex/plexamp, by using a global keyboard shortcut that's executed upon a webhook call.

curl http://192.168.1.12:9000/hooks/plexlove

plexnextalbum

Play the next album in plex/plexamp, by using a global keyboard shortcut that's executed upon a webhook call.

curl http://192.168.1.12:9000/hooks/plexnextalbum

About

hass + mpd + ikea styrbar + webhook

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages