Wrapper for PHPSonos
Switch branches/tags
Nothing to show
Clone or download
Latest commit f05b309 Jan 10, 2017
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
README.md Update README.md Apr 2, 2015
config.php Update config.php Jan 20, 2016
index.php
sonos.php Update sonos.php Jan 10, 2017

README.md

sonos a wrapper for PHPSonos

Introduction

sonos is a wrapper arround the php class PHPSonos to control sonos player via urls from a home automation server.

Installation

Checkout repository to a directory of your php enabled webserver (in this case 'sonos'). Download PHPSonos from here, extract the file scripts/PHPSonos.inc.php from zip and copy to same directory

Configuration

Configuration is done in config.php. Add your zones and favourite Radiostations. Config path for messages must be accesible from sonos player.

Be sure your webserver can write in this directory (here 'sonos'), current playing radiostation is saved in a text file.

Usage

(for url compatibility to my old script 'action' can also be 'do')

###Play

http://yourserver/sonos/index.php?zone=kitchen&action=Play 

###Stop

http://yourserver/sonos/index.php?zone=kitchen&action=Stop 

###Toggle between play and stop

http://yourserver/sonos/index.php?zone=kitchen&action=TogglePlayStop 

###Volume up / down

http://yourserver/sonos/index.php?zone=kitchen&action=VolumeUp
http://yourserver/sonos/index.php?zone=kitchen&action=VolumeDown

###Mute

http://yourserver/sonos/index.php?zone=kitchen&action=Mute 

###Next radio from list

http://yourserver/sonos/index.php?zone=kitchen&action=nextRadio 

###Play message

http://yourserver/sonos/index.php?zone=kitchen&action=sendMessage&messageId=1&volume=20

Stops current playing radio/list, plays the message 1.mp3, continues previously played radio/list

http://yourserver/sonos//index.php?zone=kitchen&action=sendMessage&message=Hello world&volume=55&lang=en

Stops current playing radio/list, plays the message "Hello world", continues previously played radio/list

Bugs

None (feel free to write pull requests if you found bugs)

To Do

*write tests

Credits