Skip to content

💤⚠️ Display a Message on the MagicMirror, if someone in the household does currently a powernap!

License

Notifications You must be signed in to change notification settings

Klizzy/MMM-powernap

Repository files navigation

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.

About

💤⚠️ Display a Message on the MagicMirror, if someone in the household does currently a powernap!

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published