MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    1. Home
    2. cruunnerr
    3. Best
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.
    Offline
    • Profile
    • Following 3
    • Followers 7
    • Topics 14
    • Posts 279
    • Groups 0

    Posts

    Recent Best Controversial
    • RE: My First Mirror... until now ^^

      @fischi87

      Just type a header in the config:

      {
          			module: "MMM-EasyPix",
      			header: "WLAN-Code",
      			position: "bottom_left",
      			config: {
      				picName: "guest_wifi_config.png", // Enter the picture file name.
      				maxWidth: "150px",      // Size picture precisely. Retains aspect ratio.
      			}
      		},
      
      posted in Show your Mirror
      cruunnerrC
      cruunnerr
    • RE: {HowTo} turn on/off your monitor (Time based, PIR/Button, App)

      @blebbens said in {HowTo} turn on/off your monitor (Time based, PIR/Button, App):

      Thanks for this tutorial…

      I am using a PIR. The monitor switches on immediately after detection of motion. I am looking for an option to switch on the monitor if a person stands in front of it for 10 seconds. Mine is a floor mirror, so some people are crossing the floor many times a day without looking at the mirror.

      If u use the external PIR script (point 2.2) u could try to change line 25 in the script and define a TURNON-DELAY.

      if turned_off and time.time() >= TURNON_DELAY:
      

      The whole script would look like this:

      #!/usr/bin/env python
      
      import sys
      import time
      import RPi.GPIO as io
      import subprocess
      
      io.setmode(io.BCM)
      SHUTOFF_DELAY = 120 # in seconds, how long the monitor will be on until next button press or PIR detection
      TURNON_DELAY = 10
      PIR_PIN = 22       # 15 on the board (this needn't to be a PIR. Can be a button also)
      LED_PIN = 16      # optional, don't use as Relay-PIN. It just shows detection time of the PIR without delay time
      
      def main():
          io.setup(PIR_PIN, io.IN)
          io.setup(LED_PIN, io.OUT)
          turned_off = False
          last_motion_time = time.time()
      
          while True:
              if io.input(PIR_PIN):
                  last_motion_time = time.time()
                  io.output(LED_PIN, io.LOW)
                  print ".",
                  sys.stdout.flush()
                  if turned_off and time.time() >= TURNON_DELAY:
                      turned_off = False
                      turn_on()
              else:
                  if not turned_off and time.time() > (last_motion_time + 
                                                       SHUTOFF_DELAY):
                      turned_off = True
                      turn_off()
                  if not turned_off and time.time() > (last_motion_time + 1):
                      io.output(LED_PIN, io.HIGH)
              time.sleep(.1)
      
      def turn_on():
      	subprocess.call("sh /home/pi/monitor_on.sh", shell=True)
      
      def turn_off():
      	subprocess.call("sh /home/pi/monitor_off.sh", shell=True)
      
      if __name__ == '__main__':
          try:
              main()
          except KeyboardInterrupt:
              io.cleanup()
      
      

      Don’t know if it will work. Just brainstorming cause i haven’t much time

      posted in Tutorials
      cruunnerrC
      cruunnerr
    • RE: MagicMirror and Domoticz

      change the port of domoticz or MM. I think they are using both 8080

      posted in Troubleshooting
      cruunnerrC
      cruunnerr
    • RE: Project overview - 09.02.2018 - revisited

      I totally agree with the “coffee is life” :D

      Looks good. Keep us up on date please ;)

      posted in Show your Mirror
      cruunnerrC
      cruunnerr
    • RE: {HowTo} turn on/off your monitor (Time based, PIR/Button, App)

      Hey dude,

      sorry for not answering, but i am only rarely here :(

      First i would try to edit the config file:

      sudo nano /boot/config.txt
      

      try to uncomment “hdmi_force_hotplug=1” and try to uncomment “config_hdmi_boost=4”

      maybe play around with some other settings.
      https://www.raspberrypi.org/documentation/configuration/config-txt/video.md

      Rebooting the pi once a day is not the best solution :/
      But however, if necessary:
      http://www.simsalabim-solutions.net/vademecum/raspberry_pi/setting_up_reboot_cron_job_on_pi

      posted in Tutorials
      cruunnerrC
      cruunnerr
    • RE: Temperature regulated fan on RPI

      @Peter

      why not just using a python script?

      found this one here:

      #!/usr/bin/env python3
      # coding: utf-8
      
      import os
      import time
      import signal
      import sys
      import RPi.GPIO as GPIO
      pin = 36 # The pin ID, edit here to change it
      maxTMP = 50 # The maximum temperature in Celsius after which we trigger the fan
      GPIO.setmode (GPIO.BOARD)
      
      def setup():
          GPIO.setmode(GPIO.BOARD)
          GPIO.setup(pin,GPIO.OUT)
          GPIO.setwarnings(False)
          return()
      def getCPUtemperature():
          res = os.popen('vcgencmd measure_temp').readline()
          temp =(res.replace("temp=","").replace("'C\n",""))
          print("temp is {0}".format(temp)) #Uncomment here for testing
          return temp
      def fanON():
          setPin(True)
          return()
      def fanOFF():
          setPin(False)
          return()
      def getTEMP():
          CPU_temp = float(getCPUtemperature())
      
          if CPU_temp>maxTMP:
              fanON()
      
          else:
              fanOFF()
      
          return()
      def setPin(mode): # A little redundant function but useful if you want to add logging
          GPIO.output(pin, mode)
          return()
      try:
          setup()
          while True:
              getTEMP()
              time. sleep(8) # Read the temperature every 5 sec, increase or decrease this limit if you want
      except KeyboardInterrupt: # trap a CTRL+C keyboard interrupt
      	GPIO.cleanup()
      
      posted in Troubleshooting
      cruunnerrC
      cruunnerr
    • RE: MMM-MyCommute

      For sure this is no problem. Take as much time as u need for your family. thats much more important!

      didn’t find a private message option, just a chat^^ sorry for that. I post my config right here.

      just for info: I didn’t touch the MMM-MyCommute.js, so its just this one i need: https://github.com/jclarke0000/MMM-MyCommute/blob/master/MMM-MyCommute.js

      So here is my full config:

      /* Magic Mirror Config Sample
       *
       * By Michael Teeuw http://michaelteeuw.nl
       * MIT Licensed.
       *
       * For more information how you can configurate this file
       * See https://github.com/MichMich/MagicMirror#configuration
       *
       */
      
      var config = {
      	address: "0.0.0.0", // Address to listen on, can be:
      	                      // - "localhost", "127.0.0.1", "::1" to listen on loopback interface
      	                      // - another specific IPv4/6 to listen on a specific interface
      	                      // - "", "0.0.0.0", "::" to listen on any interface
      	                      // Default, when address config is left out, is "localhost"
      	port: 8080,
      	ipWhitelist: ["192.0.0.0/3", "::fff:0.0.0.0/1", "::fff:128.0.0.0/2", "::fff:192.0.0.0/3", "::fff:224.0.0.0/4", "127.0.0.1", "::ffff:127.0.0.1", "::1"], // Set [] to allow all IP addresses
      	                                                       // or add a specific IPv4 of 192.168.1.5 :
      	                                                       // ["127.0.0.1", "::ffff:127.0.0.1", "::1", "::ffff:192.168.1.5"],
      	                                                       // or IPv4 range of 192.168.3.0 --> 192.168.3.15 use CIDR format :
      	                                                       // ["127.0.0.1", "::ffff:127.0.0.1", "::1", "::ffff:192.168.3.0/28"],
      
      	language: "de",
      	timeFormat: 24,
      	units: "metric",
      
      	modules: [
      		{
      			module: "alert",
      		},
      		{
              		module: 'MMM-Remote-Control'
              		// uncomment the following line to show the URL of the remote control on the mirror
              		// , position: 'bottom_left'
              		// you can hide this module afterwards from the remote control itself
          		},
      		{
      		module: 'MMM-SystemStats',
      		position: 'top_center', // This can be any of the regions.
      		classes: 'small dimmed', // Add your own styling. Optional.
      		config: {
      			updateInterval: 5000,
      			animationSpeed: 0,
      			align: 'right', // align labels
      			//header: 'System Stats', // This is optional
      			},
      		},
      		{
      			module: "updatenotification",
      			position: "top_bar"
      		},
      		{
      			module: "clock",
      			position: "top_left"
      		},
      		{
      			module: 'calendar',
      			header: 'Chris Kalender',
      			position: 'top_left',
      			config: {
      				calendars: [
      					{
      						symbol: 'calendar-check-o ',
      						url: '*private*'
      					},
      					{
                                                      symbol: 'calendar-check-o ',
                                                      url: 'http://i.cal.to/ical/61/nrw/feiertage/71e91ccb.83fad41c-d19fda68.ics'
                                              },
      
      				]
      
      			}
      		},
      		{
      			module: 'MMM-MyCommute',
      			position: 'top_left',
      			header: 'Verkehrslage',
      			classes: 'default everyone',
      			showSummary: 'true', 
      			config: {
      				apikey: '*private*',
          				origin: '*private*',  
      				destinations: [
            				{
              				destination: '*private*',
              				label: 'Arbeit',
              				mode: 'driving',
      					alternatives: 'true',
      					time: null
            				},
            				{
              				destination: '*private*',
              				label: '*private*',
              				mode: 'driving',
              				time: null
            				},
          				]
         			}
        		},
      //		{
      //			module: "compliments",
      //			position: "lower_third"
      //		},
      //		{
      //			module: "currentweather",
      //			position: "top_right",
      //			config: {
      //				location: "New York",
      //				locationID: "",  //ID from http://www.openweathermap.org/help/city_list.txt
      //				appid: "YOUR_OPENWEATHER_API_KEY"
      //			}
      //		},
      //		{
      //			module: "weatherforecast",
      //			position: "top_right",
      //			header: "Weather Forecast",
      //			config: {
      //				location: "New York",
      //				locationID: "5128581",  //ID from http://www.openweathermap.org/help/city_list.txt
      //				appid: "YOUR_OPENWEATHER_API_KEY"
      //			}
      //		},
      		{
      			disabled: false,
      			module: 'MMM-NOAA',
      			position: 'top_right',
      			config: {
      
      				apiKey: "*private*",    // https://www.wunderground.com/weather/api  select the middle plan... 
      				useAir: false,             // set to false if you do not want to use Air Quality Index
      				airKey: "*private*",    // IF you want Air Quality Index
      				pws: "*private*",         // go here to find your pws: https://www.wunderground.com/wundermap
      				showClock: false,           // Hides or shows clock
      				dformat: false,             // for M/D/YYYY format, false for D/M/YYYY
      				format: "24",              // 12 or 24 hour format.. will default to 12 hour if none selected.
      				ampm: false,                // to show AM and PM on Sunrise/Sunset time
      				showGreet: false,          // deafult is false - to show greeting under clock and above date
      				name: "",                  // Your name
      				showWind: false,
      				showDate: false,
      				showForecast: true,         //show bottom 3 day forecast
      				flash: true,                 //Today in forecast flashes halo
      				showUV: true,               //show UV index
      	      			showBar: true,             // show Barometer
      	    			showHum: true,              //show Humidity level
      				position: 'top_right',       //whatever you have in above position must also be here
      	      			alert: true                //show weather alerts default is true
      				}
      		},
      		{
      			module: 'MMM-Globe',
      			position: 'top_right',
      			config: {
      					style: 'natColor',
      					imageSize: 200,
      					ownImagePath:'',
      					updateInterval: 10*60*1000
      				}
      		},
      		{
      			module: "newsfeed",
      			position: "bottom_bar",
      			config: {
      				feeds: [
      					{
      						title: "Tagesschau Themen",
      						url: "http://www.tagesschau.de/xml/rss2"
      					}
      				],
      				showSourceTitle: true,
      				showPublishDate: true,
      				showDescription: true,
      				updateInterval: 25000,
      			}
      		},
      	]
      
      };
      
      /*************** DO NOT EDIT THE LINE BELOW ***************/
      if (typeof module !== "undefined") {module.exports = config;}
      

      Thank u very much for helping :)

      posted in Transport
      cruunnerrC
      cruunnerr
    • RE: {HowTo} turn on/off your monitor (Time based, PIR/Button, App)

      @Rec3ptor

      If u followed the guide i posted, your PIGPIOD installation path should be “/usr/local/bin/pigpiod”

      For autostart when booting u must edit the rc.local. Mine is like this:

      pi@MagicMirror:~ $ cat /etc/rc.local
      #!/bin/sh -e
      #
      # rc.local
      #
      # This script is executed at the end of each multiuser runlevel.
      # Make sure that the script will "exit 0" on success or any other
      # value on error.
      #
      # In order to enable or disable this script just change the execution
      # bits.
      #
      # By default this script does nothing.
      
      # Print the IP address
      _IP=$(hostname -I) || true
      if [ "$_IP" ]; then
        printf "My IP address is %s\n" "$_IP"
      fi
      
      iwconfig wlan0 power off &
      
      sleep 5 &
      
      /usr/local/bin/pigpiod
      
      sleep 10 &
      
      /usr/bin/python /home/pi/pir.py &
      
      exit 0
      

      So enter this via ssh:

      sudo nano /etc/rc.local
      

      and just put this into the file:

      /usr/local/bin/pigpiod
      
      posted in Tutorials
      cruunnerrC
      cruunnerr
    • RE: Trying to use MMM-MyCommute, config.js doesn't look right

      @deerbelac said in Trying to use MMM-MyCommute, config.js doesn’t look right:

      You’re my new best internet friend.

      LOL

      you are welcome mate ;)

      posted in Troubleshooting
      cruunnerrC
      cruunnerr
    • RE: MMM-GoogleMapsTraffic

      @sheddingmyskin said in MMM-GoogleMapsTraffic:

                                  lat: '30.00000',
                                  lng: '-90.000000',
      

      This is wrong. Must look like this:

      lat: 30.00000,
      lng: -90.000000,
      

      Without the ’

      posted in Transport
      cruunnerrC
      cruunnerr
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 7 / 8