Giter Site home page Giter Site logo

agp42 / mmm-sonos Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cfenner/mmm-sonos

0.0 2.0 0.0 116 KB

A module for the MagicMirror, to display informations about the currently playing songs on your Sonos system.

License: MIT License

JavaScript 90.04% CSS 9.96%

mmm-sonos's Introduction

code climate API License

MagicMirror-Sonos-Module

This is an adaption of the MagicMirror-SonosModule by Vaggan. It was modified to fit the new module system and got some enhancements in visualisation an configuration.

In order to limit RPI load and reduce network request, this module is not updated when the MMM-Sonos is not displayed on the mirror (hidden by MMM-Remote-Control or any Carousel module for example). It is also not updated in case the notification "USER_PRESENCE=false" is received. This notification can be send by the use of a PIR sensor and the module MMM-PIR-Sensor.

Sonos Module

Usage

Prerequisites

Installation

Navigate into your MagicMirror's modules folder:

cd ~/MagicMirror/modules

Clone this repository:

git clone https://github.com/CFenner/MMM-Sonos

Navigate to the new MMM-Sonos folder and install the node dependencies.

cd MMM-Sonos/ && npm install --production

Configure the module in your config.js file.

Configuration

To run the module properly, you need to add the following data to your config.js file.

{
	module: 'MMM-Sonos',
	position: 'top_right', // you may choose any location
	config: {}
}

You also can set some options to hide different parts of the module.

Option Description Default
showStoppedRoom Trigger the visualization of stopped rooms. true
showAlbumArt Trigger the visualization of the album art. true
showRoomName Trigger the visualization of the room name. true

Known Issues

The module may not be able to access the data of the sonos API due to a Cross-Origin Resource Sharing (CORS) issue. This could be solved by adding the following lines to the sonos-http-api.js just before res.write(new Buffer(jsonResponse)); in the sonos api. Remember to restart the service after the change.

  res.setHeader("Access-Control-Allow-Origin", "http://localhost");
  res.setHeader("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");

How to Install Sonos-API

To install the Sonos-API just clone the repository to your PI.

git clone https://github.com/jishi/node-sonos-http-api.git

Navigate to the new node-sonos-http-api folder and install the node dependencies.

cd node-sonos-http-api && npm install --production

Now you can run the service with:

npm start

I really recommend to use PM2 like it is described on the MagicMirror Wiki page.

cd ~/Sonos
npm start

mmm-sonos's People

Contributors

agp42 avatar cfenner avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.