Git Product home page Git Product logo

entry_music's Introduction

Entry Music

A python script to run entry music based on IPs entering/exiting the network.

Limitations

In order for this to work each IP needs to be static so that it won't change the next time it connects to the network. A simple way to do this is lock a device to an IP using the routers DHCP settings. Alternatively you can set a static IP in the devices wifi settings.

This has been tested to work on Mac OS X and linux running on a Raspberry Pi

Installation

Download the repository and run pip install -r stable-req.txt

run: python run.py to run

To run create a users.json file in the root with your users names and local static IP addresses eg:

[{
	"name" : "Jack",
	"ip" : "192.168.1.xxx"		
},
{ 
	"name" : "Jill",
	"ip" : "192.168.1.xxx"		
}]

Then create a themes directory and put in potential entry music based on the names. Eg. for jack you would create a directory: themes/Jack/

and put any song files in standard formats that you want in there for each user. mp3s, mp4as etc. If there are multiple songs in the folder it will pick one at random.

Config

Edit config.json to overide these settings

{ 	
	"song_timeout_secs" : 15,
	"away_timeout_mins" : 8
}

away_timeout_mins Is the number of minutes a person has to be "unpingable" before the music will play on their return. I advise setting this to be 8mins or more to avoid false positives

song_timeout_secs is the number of seconds the songs will play before they are cut off.

This project was inspired by Karl von Randow's setup at Cactus Lab as described here: http://blog.xk72.com/post/13313246225/the-coolest-thing-ever

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.