Code Monkey home page Code Monkey logo

mmm-powernap's Introduction

MMM-powernap

This is a module for the MagicMirror².

You can display a Message on the MagicMirror, if someone in the household does currently a powernap! For this to work, you need a working instance of the homebridge software with the cmdSwitch2 module.

The shown message is a native MagicMirror alert message, which gets triggered trough a GET Request to the URL /MMM-powernap/show and removed with /MMM-powernap/remove. The On- and Off requests are triggered trough the cmdSwitch2 switch.

MagicMirror powernap-message

Homebridge Switch
powernap-message-homebridge

Installation

  1. Navigate into your MagicMirror's modules folder.
  2. Execute git clone https://github.com/Klizzy/MMM-powernap.git.

No npm install needed, because it uses currently no new dependencies

Using the module

To use this module, add the following configuration block to the modules array in the config/config.js file:

var config = {
    // Set your global MagicMirror config to the following values, to make it callable from homebridge
    address: "0.0.0.0", // to listen on all interfaces
    ipWhitelist: ["192.123.45.67"], // add the IP adress of your homebridge instance to the whiltelist, if homebridge runs on another machine. 
    
    modules: [
        {
            module: "alert",
            config: {
                alert_effect: "bouncyflip", // Set the animation you want
            }
        },
        {
            module: 'MMM-powernap',
            config: {
                // No additional config required
            }
        }
    ]
}

Configuration options

Option Description Options
icon Optional Icon to display before the message

Type: String (default: bed)
Any icon from font awesome v5
message Optional Message to be displayed in alert

Type: String (default: Powernap in progress!)
Any message you want

homebridge cmdSwitch2 config

Follow the cmdSwitch2 documentation and replace 123.456.78.90 with the IP of your machine, which runs the MagicMirror software.

{
//    ...
    "platforms": [
        {
            "platform": "cmdSwitch2",
            "name": "CMD Switch",
            "switches": [
                {
                    "name": "Powernap",
                    "on_cmd": "curl http://123.456.78.90:8080/MMM-powernap/show",
                    "off_cmd": "curl http://123.456.78.90:8080/MMM-powernap/remove"
                }
            ]
        }
    ]
}

License

The MIT License (MIT).

See LICENSE.txt for more details.

mmm-powernap's People

Contributors

klizzy avatar

Stargazers

 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.