Giter Site home page Giter Site logo

vaginessa / mmm-networkscanner Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ianperrin/mmm-networkscanner

0.0 1.0 0.0 98 KB

A module for MagicMirror which determines the status of devices on the network based on their MAC address

License: MIT License

JavaScript 100.00%

mmm-networkscanner's Introduction

MMM-NetworkScanner

A module for MagicMirror which determines the status of devices on the network based on their MAC address. It can also look up devices by IP addresses or hostnames. Static IP addresses work more consistently.

Installation

In your terminal, install arp-scan:

cd ~/
sudo apt-get install arp-scan   

In your terminal, go to your MagicMirror's Module folder:

cd ~/MagicMirror/modules

Clone this repository:

git clone https://github.com/ianperrin/MMM-NetworkScanner.git

Go to the modules folder:

cd MMM-NetworkScanner

Install the dependencies (sudo, ping):

npm install

Add the module to the modules array in the config/config.js file:

    {
        module: 'MMM-NetworkScanner',
        position: 'top_left', 
        config: {
            // Optional config options
        }        
    },

Config Options

Option Default Description
devices [] an array of device objects e.g. { macAddress: "aa:bb:cc:11:22:33", name: "DEVICE-NAME", icon: "FONT-AWESOME-ICON"}
network "" Local Network IP mask, i.e. "192.168.0.0/24"
showUnknown true shows devices found on the network even if not specified in the devices option
showOffline true shows devices specified in the devices option even when offline
showLastSeen false shows when the device was last seen e.g. "Device Name - last seen 5 minutes ago"
keepAlive 180 how long (in seconds) a device should be considered 'alive' since it was last found on the network
updateInterval 10 how often (in seconds) the module should scan the network
residents [] names of devices that should be monitored if they are in
occupiedCMD {notification: 'TEST', payload: {action: 'test-occupied'}} Notification to be sent when a resident returnes home e.g. {notification: 'REMOTE_ACTION', payload: {action: 'MONITORON'}} would turn the mirror on when a resedent returnes home.
vacantCMD {notification: 'TEST', payload: {action: 'test-occupied'}} Notification to be sent when all residents have left home.

Example Config

Scan every 5 seconds and only display the specified devices whether they are online or offline. Devices will be considered online for 5 mins after they are last seen:

    {
        module: 'MMM-NetworkScanner',
        position: 'top_left', 
        config: {
            devices: [
                    { ipAddress: "github.com", name: "Github", icon: "globe"},
                    { macAddress: "1a:1b:1c:1a:1b:1c", name: "Server", icon: "server"},
                    { macAddress: "2a:2b:2c:2a:2b:2c", name: "Desktop", icon: "desktop"},
                    { ipAddress: "10.1.1.10", name: "Laptop", icon: "laptop"},
                    { macAddress: "4a:4b:4c:4a:4b:4c", name: "Mobile", icon: "mobile"},
                ],
            showUnknown: false,
            showOffline: true,
            keepAlive: 300,
            updateInterval: 5,
            residents: "Mobile",
            occupiedCMD: {notification: 'REMOTE_ACTION', payload: {action: 'MONITORON'}},
            vacantCMD  : {notification: 'REMOTE_ACTION', payload: {action: 'MONITOROFF'}},

        }        
    },

Updating

To update the module to the latest version, use your terminal to go to your MMM-NetworkScanner module folder and type the following command:

cd ~/MagicMirror/modules/MMM-NetworkScanner
git pull
npm install

If you haven't changed the modules, this should work without any problems. Type git status to see your changes, if there are any, you can reset them with git reset --hard. After that, git pull should be possible.

mmm-networkscanner's People

Contributors

ben5756 avatar bennewsome avatar brobergp avatar ianperrin avatar leveneg avatar s-cotton avatar

Watchers

 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.