Quick Start – configure Spy mode

You need to complete the Initial Configuration Wizard before proceeding with the following steps.

Now that the Observe & Detect component is running, the first steps are:

  • check whether the Observe & Detect component is able to find your Sonos zones
    • double click the Control Spy shortcut which has been installed wherever you requested during the install step (ie. the desktop or the Windows tool bar)
    • a control menu for the Spy component is opened inside your browser
    • the browser's Spy control menu
    • run option List known zones
    • this should list all of your Sonos zones (if the report looks scrambled up, press F5 a few times to force the browser to refresh the report)
  • check whether the Observe & Detect component is able to see your track plays
    • start playing a track using a Sonos zone
    • then run option Recent track starts from the control menu in the browser mentioned above
    • you should see the track that you just started at the top of the list

If you don’t see the track that you just played, there is no point proceeding until you have resolved whatever issue is causing this.

If the above all checks out OK, the next thing to do is to configure the Play Counts component of AlbumPlays so that it is able to receive communications from the Observe & Detect component. The Play Counts component is that which we have been calling Last.fm mode up until now.

Presuming that you have already been successfully using AlbumPlays in LFM mode, you have not too many options to set.

Firstly run a final cycle of AlbumPlays using Last.fm mode. ie. Run a Get and an Approve action to flush out your last remaining scrobbles from Last.fm before converting to Spy mode.

Initially focus upon the following (as further documented here). You access these configuration options via the Configuration (MyScrobble.ini) shortcut :

  1. define the disk location where the components can communicate with each other; set option _nas_path to point to the same location that you specified here for the Observe & Detect component
  2. if you are using the database method to communicate, set option _external_SPY_database to point to the transfer database that you created during the previous step
  3. list the Listener IDs for whom the Observe & Detect component is collecting spy observations; _lfm_id_list

    • I suggest that you start off with a single listener
    • this must be your AlbumPlays Listener ID, which may not be the same as your Last.fm account name.
    • The ID is already recorded in this configuration file’s [general section] in the _user option
    • nb: it is important that any listeners are identified by exactly the same ID in each of the two AlbumPlays components
    • if you duplicate the _lfm_id_list option line into the [general section] of the configuration file for the Playcounts module of AlbumPlays, the next time that you start that component, it will verify that you have used identical IDs across both components .
  4. Finally put this Play Counts component into Spy mode

  • set option _source_lfm to _source_lfm=N (or comment out the line by putting a # character into column 1)
  • if AlbumPlays is already running, stop and restart it (use the normal Scrobbles shortcut to restart it)

 
Then run a Get action with the source set to Spy, see here for an illustration of how to run Spy mode, and for an example of the expected output

Spy mode component needs to be left running whenever you are playing music on your Sonos. If you have elected to install this cmponent on a PC it may be configured to auto-start whenever the PC is turned on.

Example configuration file recipes

Spy Observe & Detect is running on a NAS or a Server; MediaMonkey and the rest of AlbumPlays is on your PC

Play Counts module (aka Last.fm mode): – running on your PC

[general section]
_database=~/AppData/Roaming/Python/sonos_scrobbles/AlbumPlays.db
_external_SPY_database=albumplays_spy.db
_nas_path=//Your_NAS/your_share/
_user=BJM
#_source_lfm=y
[get]
[massage]
[crunch]
[gui]
_scrobble_mode=user

Observe & Detect mode: – running on your NAS

[sonos_observer]
_nas_path=//Your_NAS/your_share/
[detect_spy]
_lfm_zone_default_id=BJM
_out_text=Y
_database=albumplays_spy.db

Notes:

  • the NAS share that you have allocated is the default location for communications between the two AlbumPlays components
  • Spy observations are transferred between the AlbumPlays components using the transfer database, and the text file transfer method is also enabled as a backup of your fresh Spy observations
  • AlbumPlays is running in Spy mode, ie. Sonos track plays are being obtained directly from your Sonos zones themselves. … nb: you are in Spy mode if _source_lfm option is commented out (as shown above), or is absent, or is set to _source_lfm=N

  • the primary AlbumPlays database is stored within a Windows data directory for your user profile. … You should turn on the built-in application backup facility to further protect this database, otherwise if would be best to relocate the database to somewhere which gets backed up, like My Documents perhaps (?)). … AlbumPlays will perform best if the primary AlbumPlays database is located on the same computer as MediaMonkey and the Play Counts component of AlbumPlays

  • create the share on your NAS:

  • the transfer database is stored on the allocated NAS share

  • the following will also be found within the NAS share:
    • the MissedTracks playlist
    • the html menu allowing you to control the Observe & Detect component
    • the log file from the Observe & Detect component, when requested using the above control menu using your browser
    • the location used when when exporting the text file backup copy of Spy observations, accessible via the same control menu using your browser

click here to close

Everything is running on the same PC: ie. MediaMonkey and both AlbumPlays components

Play Counts module (aka Last.fm mode)

[general section]
_database=~/AppData/Roaming/Python/sonos_scrobbles/AlbumPlays.db
_nas_path=~/Documents/AlbumPlays
_external_SPY_database=~/AppData/Roaming/Python/sonos_spy/albumplays_spy.db
_user=BJM
#_source_lfm=Y
[get]
[massage]
[crunch]
[gui]
_scrobble_mode=user

Observe & Detect mode

[sonos_observer]
_nas_path=~/Documents/AlbumPlays
[detect_spy]
_lfm_zone_default_id=BJM
_out_text=Y
_database=~/AppData/Roaming/Python/sonos_spy/albumplays_spy.db

Notes:

  • the default location for communications between the two application components has been overidden to an AlbumPlays folder, which I have created in the My Documents folder nb. the My Documents folder is a special Windows folder; Windows refers to internally just as Documents
  • Spy observations are transferred between the AlbumPlays components using the transfer database, and the text file transfer method is also enabled as a backup of your fresh Spy observations
  • AlbumPlays is running in Spy mode, ie. Sonos track plays are being obtained directly from your Sonos zones themselves. … nb: you are in Spy mode if _source_lfm option is commented out (as shown above), or is absent, or is set to _source_lfm=N

  • the transfer database location has been overridden to keep it out of the way and protect it; inside the AlbumPlays working directory (Windows 7: C:\Users\\AppData\Roaming\Python\sonos_spy).

  • the primary AlbumPlays database is also protected by being hidden away inside the working directory for the LFM module. … You should turn on the built-in application backup facility to further protect this database, otherwise if would be best to relocate the database to somewhere which gets backed up, like My Documents perhaps (?)).

  • use the Windows Explorer to create the directory My Documents\AlbumPlays

  • for ease of access, the following will be found in My Documents, inside the AlbumPlays folder:

    • the MissedTracks playlist
    • the html menu allowing you to control the Observe & Detect component
    • the log file from the Observe & Detect component, when requested using the above control menu using your browser
    • the location used when when exporting the text file backup copy of Spy observations, accessible via the same control menu using your browser

click here to close


Once you have Spy mode running you should read this section to ensure that the default settings are enabling AlbumPlays to use track location to successfully match your Sonos local library plays back to your MediaMonkey database.

There are further configuration options; eg. you may now want to modify this configuration file to assign Sonos zones to household members.

Related steps