• Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
MagicMirror Forum
  • Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
A New Chapter for MagicMirror: The Community Takes the Lead
Read the statement by Michael Teeuw here.

27" custom framed magic mirror - fun to get done

Scheduled Pinned Locked Moved Show your Mirror
41 Posts 13 Posters 59.8k Views 17 Watching
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    iwaldrum @Jayh391
    last edited by May 31, 2017, 9:29 AM

    @Jayh391

    I used the MMM-Rest module to pull the device data via the rest api in Homeseer. Here is the section in my config file. Still work in progress…

    		module: 'MMM-Rest',
    		header: 'House Status',
    		position: 'top_right',	// This can be any of the regions.
    									// Best results in one of the side regions like: top_left
            config: {
                    debug: false,
                    mappings: {
                        on_off: {
                            true: 'on',
                            false: 'off',
                        },
                        temperature: {
                            1: 'cold',
                            2: 'warm',
                            3: 'HOT',
                        },
                    },
                    sections: [
                    {
                        format: '%d',
                        url: 'http://yourURLhere:port/HomeSeer_REST_API.aspx?function=getdevicestatusvaluebyid¶m1=108¶m2=value',
                    },
                    {
                        format: '%df',
                        url: 'http://yourURLhere:port/HomeSeer_REST_API.aspx?function=getdevicestatusvaluebyid¶m1=103¶m2=value',
                    },
                    {
                        format: '%d',
                        url: 'http://yourURLhere:port/HomeSeer_REST_API.aspx?function=getdevicestatusvaluebyid¶m1=128¶m2=value',
                    },
                    {
                        format: '%df',
                        url: 'http://yourURLhere:port/HomeSeer_REST_API.aspx?function=getdevicestatusvaluebyid¶m1=187¶m2=value',
                    },
                    {
                        format: '%d',
                        url: 'http://yourURLhere:port/HomeSeer_REST_API.aspx?function=getdevicestatusvaluebyid¶m1=118¶m2=value',
                    },
                    {
                        format: '%df',
                        url: 'http://http://yourURLhere:port/HomeSeer_REST_API.aspx?function=getdevicestatusvaluebyid¶m1=113¶m2=value',
                    },
                    {
                        format: '%df',
                        url: 'http://yourURLhere:port/HomeSeer_REST_API.aspx?function=getdevicestatusvaluebyid¶m1=92¶m2=value',
                    },
                    {
                        format: '%s',
                        mapping: 'temperature',
    		    url: 'http://yourURLhere:port/HomeSeer_REST_API.aspx?function=getdevicestatusvaluebyid¶m1=137¶m2=value',
                    },
                    {
                        format: '%d',
                        url: 'http://yourURLhere:port/HomeSeer_REST_API.aspx?function=getdevicestatusvaluebyid¶m1=108¶m2=value',
                    },
                    {
                        format: 'Lights %s',
                        mapping: 'on_off',
                        url: 'http://yourURLhere:port/HomeSeer_REST_API.aspx?function=getdevicestatusvaluebyid¶m1=108¶m2=value',
                    },
                ],
                output: [
                    ['<b>Location:</b>',,'<b>Temp:</b>'],
                    ['Family Room',,'@2'],
                    ['Living Room','@6'],
                    ['Upstairs','@4'],
                    ['Garage','@7'],
                ],
    	    },
    	},
    
    J 1 Reply Last reply May 31, 2017, 12:34 PM Reply Quote 0
    • I Offline
      iwaldrum @zdenek
      last edited by iwaldrum May 31, 2017, 9:58 AM May 31, 2017, 9:45 AM

      @zdenek

      I used wunderground.com to create the animated radar image and MMM-SimpleLogo to display it.

      Create your custom image at https://www.wunderground.com/weather-radar - looks like US, Canda & Australia only. Once created, copy the URL and place it in the MMM-SimpleLogo module.

      Wunderground updates the radar image every 10-20 minutes. Since I’m using FullpageOS as my mm frontend I have the page refresh every 30 minutes which then pulls an updated image.

          {
              module: 'MMM-SimpleLogo',
              position: 'top_right',    // This can be any of the regions.
              config: {
      		fileUrl: "https://radblast.wunderground.com/cgi-bin/radar/WUNIDS_map?station=DIX&brand=wui&num=1&delay=15&type=N0R&frame=0&scale=1.000&noclutter=0&showstorms=0&mapx=400&mapy=240¢erx=400¢ery=240&transx=0&transy=0&showlabels=1&severe=0&rainsnow=0&lightning=0&smooth=0&rand=24937062&lat=40.75000000&lon=-74.00000000&label=New+York%2C+NY",
      		width: "400px",
      		position: "center",
             }
          },
      
      C Z 2 Replies Last reply May 31, 2017, 10:28 AM Reply Quote 0
      • C Offline
        cmille34 @iwaldrum
        last edited by May 31, 2017, 10:28 AM

        @iwaldrum said in [27" custom framed magic mirror - fun to get done] Since I’m using FullpageOS as my mm frontend I have the page refresh every 30 minutes which then pulls an updated image.

        How is you have the page reload every 30 mins in fullpageOS? My calendar app doesn’t appear to be updating, I’m hoping a page reload every 30 mins will fix that.

        I 1 Reply Last reply May 31, 2017, 10:58 AM Reply Quote 0
        • I Offline
          iwaldrum @cmille34
          last edited by May 31, 2017, 10:58 AM

          @cmille34

          There is a refresh script included with fullpageOS. it’s located at /home/pi/scripts/refresh. I added it to the crontab to run every 30min. I also added a line to crontab to reboot at midnight. This helps keep the system fresh and free up any processes or used memory on the Pi.

          Here is my config
          0_1496228243752_fullpageos-reboot-refresh.jpg

          sudo nano /etc/crontab
          
          Add:
          0  0    * * *   root    reboot
          */30 *   * * *   pi     /home/pi/scripts/refresh
          
          C Z 2 Replies Last reply May 31, 2017, 11:18 AM Reply Quote 0
          • C Offline
            cmille34 @iwaldrum
            last edited by May 31, 2017, 11:18 AM

            @iwaldrum said in 27" custom framed magic mirror - fun to get done:

            sudo nano /etc/crontab
            
            Add:
            0  0    * * *   root    reboot
            */30 *   * * *   pi     /home/pi/scripts/refresh
            

            Brilliant! I forgot I was calling that script when I woke the screen with the motion sensor
            already. Hopefully adding it to cron every 30 minutes like you’ve shown will help get the calendar to update more regularly. Thanks for the quick help!

            I 1 Reply Last reply May 31, 2017, 11:44 AM Reply Quote 1
            • I Offline
              iwaldrum @cmille34
              last edited by May 31, 2017, 11:44 AM

              @cmille34

              I’d love to hear how you have your motion sensor setup with fullpageOS. On my todo list…

              C 1 Reply Last reply May 31, 2017, 12:27 PM Reply Quote 0
              • C Offline
                cmille34 @iwaldrum
                last edited by May 31, 2017, 12:27 PM

                @iwaldrum said in 27" custom framed magic mirror - fun to get done:

                @cmille34

                I’d love to hear how you have your motion sensor setup with fullpageOS. On my todo list…

                This is far from perfect but it appears to work for me. Generally the screen is dim when I look at the mirror from afar or an angle but if I walk near it, it comes to life. I’m using the cheapie ol’ HC-SR501 motion sensor for this. I think I got a 5 pack for like 5 bucks on eBay. I actually have my sensor dangling at the bottom of my mirror, essentially aiming at the floor. These things are pretty darn sensitive it seems.

                I essentially have the sensor hooked up to the Pi and and have converted the following Python script to a service that runs at startup. The monitor still has power but the HDMI signal is essentially disabled when motion isn’t detected with the tvservice command (whatever it is! ha).

                /home/pi/motiondetector.py

                import os
                import subprocess
                import time
                from gpiozero import MotionSensor
                
                pir = MotionSensor(4)
                while True:
                        pir.wait_for_motion()
                        print("Motion!")
                        subprocess.call(["/bin/sh","/home/pi/scripts/refresh"])
                        os.system("tvservice -p; fbset -depth 8; fbset -depth 16")
                        pir.wait_for_no_motion()
                        print("No motion...")
                        os.system("tvservice -o")
                

                The sources I used to cobble this together:

                Install gpiozero
                https://gpiozero.readthedocs.io/en/stable/

                I think I had some issue getting the gpiozero module to load, but this thread looks familiar. I think the issue is I started with Jessie Lite.
                https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=126320

                Script as service
                http://www.diegoacuna.me/how-to-run-a-script-as-a-service-in-raspberry-pi-raspbian-jessie/

                Sensitivity Adjustment (this takes some tinkering for sure)
                http://henrysbench.capnfatz.com/henrys-bench/arduino-sensors-and-input/arduino-hc-sr501-motion-sensor-tutorial/

                You could probably gather all this with a few minutes of googling but I figured I’d share what I’ve cobbled together so far. A short range IR type sensor may be better if you only want the screen to activate when you get right in front of it, if you just want some mostly automated way of turning the screen off, this should work though.

                1 Reply Last reply Reply Quote 1
                • J Offline
                  Jayh391 @iwaldrum
                  last edited by May 31, 2017, 12:34 PM

                  @iwaldrum

                  Thanks ! I will give it a try!

                  J 1 Reply Last reply May 31, 2017, 11:25 PM Reply Quote 0
                  • Z Offline
                    zdenek @iwaldrum
                    last edited by zdenek Jun 6, 2017, 7:36 AM May 31, 2017, 4:05 PM

                    @iwaldrum great, thanks. I’ll try. Any idea, how to refresh on “basic” Jess OS? Via cron? How?

                    unfortunately, on https://www.wunderground.com/weather-radar is just for US and so on, but Europe is not here. Please, any idea, how to add this
                    http://portal.chmi.cz/files/portal/docs/meteo/rad/data_jsradview.html
                    or better this
                    http://portal.chmi.cz/files/portal/docs/meteo/rad/inca-cz/short.html

                    in the worst scenario
                    http://portal.chmi.cz/files/portal/docs/meteo/rad/mobile/ra6_30min.gif

                    thanks, Zdeněk

                    1 Reply Last reply Reply Quote 0
                    • J Offline
                      Jayh391 @Jayh391
                      last edited by May 31, 2017, 11:25 PM

                      @Jayh391

                      Worked GREAT!

                      1 Reply Last reply Reply Quote 0
                      • 1
                      • 2
                      • 3
                      • 4
                      • 5
                      • 3 / 5
                      3 / 5
                      • First post
                        28/41
                        Last post
                      Enjoying MagicMirror? Please consider a donation!
                      MagicMirror created by Michael Teeuw.
                      Forum managed by Sam, technical setup by Karsten.
                      This forum is using NodeBB as its core | Contributors
                      Contact | Privacy Policy