Skip to content

jheyman/MMM-PIR-Sensor

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MMM-PIR-Sensor / jheyman minimal version

This an extension for the MagicMirror. Forked from the original MMM-PIR-Sensor extension, I trimmed it to fit my custom need (driving a single output GPIO based on the PIR signal)

Installation

  • Navigate into your MagicMirror's modules folder and execute git clone https://github.com/jheyman/MMM-PIR-Sensor.git.
  • Go the MMM-PIR-Sensor and type npm install to install the node dependencies.

Using the module

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

modules: [
	{
		module: 'MMM-PIR-Sensor',
		config: {
			// See 'Configuration options' for more information.
		}
	}
]

Configuration Options

The following properties can be configured:

Option Description
sensorPin The pin your PIR-sensor is connected to.

Possible values: int
Default value: 22
Note: Please use BCM-numbering.
relayPin If you want to use a relay to turn of the mirror provide the pin here. If no pin is provided HDMI is turned off instead.

Possible values: int
Default value: false
Note: Please use BCM-numbering.
powerSavingDelay Additional software side delay (in seconds) before the monitor will be turned off.

Possible values: int
Default value: 0
powerSavingNotification To display a notification before to switch screen off

Possible values: boolean
Default value: false
Note: Need the default module "alert" to be declared on config.js file.

Developer Notes

This module broadcasts a USER_PRESENCE notification with the payload beeing true or false you can use it to pause or disable your module.

Dependencies

  • onoff library to use the raspberry Pi's GPIO

The MIT License (MIT)

Copyright © 2016 Paul-Vincent Roll

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.

About

This module can monitor a PIR motion sensor and put your mirror to sleep.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%