Skip to main content
Latest PyPI version Travis CI build status Test coverage

Mopidy extension to automate music playback based on time of day.

Can be used in restaurants to play fitting music depending on time of day with no user input required.

Notice

  • Only tested with file:// backend.

  • This extension high-jacks many Mopidy events to control playback so it does not play well with other extensions.

Consists of a frontend and simple web client.

Frontend

If no tracks are playing and a play event is received, or if playback ends, a random album will be added to the tracklist and playback started.

Album is chosen from one of 3 sections, based on time of day. After an album has been played, it will not play again until all other albums in it’s section has been played.

If volume is set higher than what is configured for the section, it will be lowered before playback starts.

Web Client

The web client is reached on url /auto/. It shows which track, artist and album is playing.

It has 3 buttons: Play / Pause, skip to next track and skip to next album.

It also has a volume control.

By logging in with admin key current playing track or album can be deleted.

Installation

Install by running:

pip install Mopidy-Auto

Configuration

Before starting Mopidy, you must add configuration for Mopidy-Auto to your Mopidy configuration file:

[auto]
enabled = true

# Key required to access admin section
admin_key = 123

# URI where the sections folders are located. Should be same as '[file] media_dirs'
base_path = file:///media/Music/

# Max number of tracks that can be added from one folder. Set to 0 or lower to disable limit
max_tracks = 15

# Sections of different music activated depending on time of day. Currently locked to 3
# At what time this section gets active
s0_start = 00:00
# Folder name in where to find albums
s0_folder = Rap
# Decrease volume to this level if it is set higher when new folder is being played
s0_max_volume = 50

s1_start = 11:00
s1_folder = Trip Hop
s1_max_volume = 80

s2_start = 18:30
s2_folder = Rock
s2_max_volume = 80

Recommend File backend configuration

To make sure playback does not stop due to file types unhandled by Mopidy this exclude works well:

[file]
...
excluded_file_extensions =
  .nfo
  .ini
  .db
  .rtf
  .jpg
  .jpeg
  .png
  .gif
  .log
  .dat
  .txt
  .sfv
  .pls
  .m3u
  .wma
  .mpc
  .htm
  .html
  .aac
  .m4a
  .sfk
  .url
  .cue
  .pdf
  .m3u8
  .bmp
  .lnk
  .bc!
  .BMP
  .psp
  .ape
  .aif
  .rar

Project resources

Changelog

0.5.0

  • If folder was deeper than one level unique albums were thought to be depleted to early

  • Handle first section not starting at midnight by returning the last section

0.4.0

  • Handle empty folders gracefully - #15

  • Added move album - #12

0.3.0

  • Change start time setting from sX_hour + sX_minute to sX_start with format hh:mm

  • Change next track and album buttons

  • Change volume step to 5%

  • Fade out volume when changing track - #13

  • Added admin mode with restricted functions - #1

  • Added delete track - #2

  • Added delete album - #3

0.2.0

  • Display time of current playing track - #9

  • Play album from new section when its time is reached - #8

  • Added skip to next album - #5

  • History is stored per section - #6

0.1.0

  • Initial release.

Metadata

Release files for Mopidy-Auto 0.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for Mopidy-Auto 0.5.0
File Size Uploaded
Mopidy-Auto-0.5.0.tar.gz 35.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for Mopidy-Auto 0.5.0
File Interpreter ABI Platform
Mopidy_Auto-0.5.0-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 74.9 kB

Release files / Mopidy-Auto-0.5.0.tar.gz

Download URL Mopidy-Auto-0.5.0.tar.gz
Size 35.9 kB
Tags Source
SHA-256 checksum
How to use checksums
6e3fcf0dee9d46204de85d311ba3a176c09b1888e1eefb3dd664e25136a91982
BLAKE2b-256 checksum
How to use checksums
237369338f7d4a0ef6952b1636d799ea774a49252b5f2f7df5300003f3cbd2b2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / Mopidy_Auto-0.5.0-py2.py3-none-any.whl

Download URL Mopidy_Auto-0.5.0-py2.py3-none-any.whl
Size 38.9 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
87cafb35c2af5b7e2bdda9e487b698e31c0057eda27ce4d29ce5e80fb10564ff
BLAKE2b-256 checksum
How to use checksums
c2ee3f655317e96ce0b76ce506d85871df534a1b1053d1c6e55cd0e6d9a00903
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.5.0 This release

2 release files

0.4.0

2 release files

0.3.0

1 release file

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page