A New Chapter for MagicMirror: The Community Takes the Lead
Read the statement by Michael Teeuw here.
  • MM-PIR-motion-poweron

    Development pir sensor shutdown power-saving
    1
    0 Votes
    1 Posts
    256 Views
    C
    I created powersaving program for automatically start the RaspberryPi, if a motion ist detected via PIR-sensor and shut down after a waiting time. It’s at Git and I want to share it with you. I would be happy if you give me Feedback. https://github.com/ChrisBaehrig/MM-PIR-motion-poweron
  • 0 Votes
    7 Posts
    2k Views
    H
    @hesspoint Update: There is actually a custom HA integration that is awesome: https://github.com/sindrebroch/ha-magicmirror So I switched form the REST API to that integration and it is even better
  • 0 Votes
    7 Posts
    5k Views
    J
    @bez252 Actually what they describe might also work for you, based on a quick glance through the setup code. To shutdown from the node_helper you need to change some code in the file(will be in MMM-Button/node_helper.js in your file system). Here is an example from my module to shut down the RPi, you can replace the self.sendSocketNotification(...) in the node_helper with a similar command: exec('sudo shutdown -h now', null); Also, at the beginning of the file you need to include the exec function, like here: const exec = require('child_process').exec;
OSZAR »