This is an extension for the MagicMirror. It can toggle pins specified in the config.
You can specify any number of pins with different trigger messages. All messages will be registered with the MMM-Remote Module automatically to trigger the messages from the remote control web app but can be triggered from any other module, as well. It can also play sounds using MMM-Sounds module when a pin is toggled.
You should have MMM-Remote Module and MMM-Sounds installed and configured with your mirror to get the best out of this module ;) Special thanks therefore goes to Jopyth and jc21 for their amazing work!
- Navigate into your MagicMirror's
modules
folder and executegit clone https://github.com/ptrbld/MMM-Pins.git
. A new folder will appear navigate into it. - Execute
npm install
to install the node dependencies.
First of all connect some leds, etc. to your pins on the pi Raspberry PI. I am using this module currently to turn some 5v leds on and off with TIP120 darlington transistors.
To use this module, add it to the modules array in the config/config.js
file:
modules: [
{
module: 'MMM-Pins',
config: {
// See 'Configuration options' for more information.
}
}
]
The following properties can be configured:
Option | Description |
---|---|
pinConfiguration |
Array of pin objects you want to toggle by notification. Possible values: [{pin:5, direction:"out", notification:"MY_NOTIFICATION", sound:"ANY_SOUNDFILE" prettyName: "Test"}, ...]
|
Option | Description |
---|---|
pin |
The pin number you want to toggle |
direction |
If it is a input or output pin (values: "in" | "out" ) |
notification |
Any notification name that should trigger the toggle event. The notifications are additional registered with the MMM-Remote-Control module if present. |
sound |
Sound that should be played using the MMM-Sounds module when pin is triggered (filename) |
prettyName |
Name used in the remote view of the MMM-Remote-Control module |
- onoff (installed via
npm install
)
Copyright © 2016 PtrBld
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
The software is provided “as is”, without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall the authors or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the use or other dealings in the software.