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

    pablousavilla

    @pablousavilla

    9
    Reputation
    51
    Profile views
    5
    Posts
    0
    Followers
    0
    Following
    Joined
    Last Online

    pablousavilla Unfollow Follow

    Best posts made by pablousavilla

    • My new Magic Mirror

      Hi Team,

      After a couple months of playing around and testing different setups. I can show you what I’ve managed to put together.

      HW wise:

      • Raspberry Pi 4
      • Raspberry Camera
      • USB Mic
      • WM8960 Audio Board + speakers
      • Fan
      • Radar Sensor RCWL 0516 (movement to activate the display)
      • AOC 22B2H screen
      • MirrorView 4mm Glass from Glas-star.de
      • Humidity/Temperature Sensor DHT-11 (to measure room temp/humidity)

      Modules:

      • MMM-Strava
      • MMM-Face-Reco-DNN
      • MMM-Spotify
      • MMM-PIR-Sensor
      • MMM-Carousel
      • MMM-COVID19-AMPEL
      • MMM-Chart (data from http://opensensemap.org)
      • MMM-GoogleAssistant
      • MMM-MicVolume (mic deactivated until Face-Reco gets a positive detection, this disables the google assistant - for privacy)
      • mmm-systemtemperature
      • MMM-WiFiPassword

      Extras

      • Airplay
      • pi-fan-controller

      Here are a few pics:

      ABD1ACAB-79DC-450F-BD34-0CEFEE133FC3_1_105_c.jpeg

      F1CF7BE4-A35A-416C-9054-345ADBC3C292_1_105_c.jpeg

      9AD1E214-E31B-4A3F-B101-A673413391C0_1_105_c.jpeg

      Open issues:
      The camera has problems recognising through the glass, the image is too dark. It works… but it requires to a lamp to be on. I haven’t found a way to play with the amount of time it takes for the photo to be taken. The raspistill command does it automatically, but the Face-Reco module doesn’t allow an option for it that I can tell

      posted in Show your Mirror
      P
      pablousavilla
    • RE: My new Magic Mirror

      Thanks @MyMirror

      Sure, its a dirty hack as Im not a programmer, but it works.

      1. You need to download the data you want from a sensor, to do that, go to the site, select which sensor and data would you like to have and instead of clicking download, right click and copy the link, it would look something like this:
        Options selected: 24hrs data, 10 Minute Value, Arithmetic average, Temperature sensor -> https://api.opensensemap.org//statistics/descriptive?boxid=5b1421ce4cd32e00193f0983&columns=lat,lon,boxName,boxId,unit&download=true&format=csv&from-date=2021-01-03T10:36:32.413Z&operation=arithmeticMean&phenomenon=Temperatur&to-date=2021-01-04T10:36:32.413Z&window=10m

      You can later automate this process using wget and changing the date variables in that string

      1. The file is a csv file that needs to be changed to json in a format that looks like this:
        [[“DateTime1”, Value1 ], [“DateTime2”, Value2], … ]

      There is many python examples on how to do the conversion, but what I found is that they dont return the same format. For example: https://medium.com/@hannah15198/convert-csv-to-json-with-python-b8899c722f6d

      The output looks instead something like this:
      {
      “DateTime1”: “Value1”,
      “DateTime2”: “Value2”,
      …
      }

      1. So I take that and apply some command line to replace, move, etc… WIth the above format, you could use this:

      grep -v ‘“”’| sed ‘s/"temperatur_20/["20/g’ | sed ‘s/T/ /g’ | sed ‘s/Z"/"/g’ | sed ‘s/",/],/g’ |sed ‘s/": “/”, /g’ | sed ‘s/{/[/g’ | sed ‘s/}/]/g’ |grep 20 | head -c-3

      Dont forget to add the first and last [ ]

      1. And then you need to enable apache and copy to a location where MMM-Chart can find it

      This should do it. I hope it works for you!

      Cheers

      posted in Show your Mirror
      P
      pablousavilla

    Latest posts made by pablousavilla

    • RE: My new Magic Mirror

      Hi @emagic,

      To be honest, I just followed the instructions here:

      https://github.com/paviro/MMM-PIR-Sensor

      But something you could try is to turn it on and off in the command line just to make sure that the instruction is correct, as there are 2 possibilities:

      /usr/bin/vcgencmd display_power 0
      /usr/bin/vcgencmd display_power 1

      And
      echo ‘standby 0’ | cec-client -s -d 1
      echo ‘on 0’ | cec-client -s -d 1

      You can find them in the code: https://github.com/paviro/MMM-PIR-Sensor/blob/master/node_helper.js

      Depending on that, you need to modify your config.js options

      I hope that helps

      posted in Show your Mirror
      P
      pablousavilla
    • RE: My new Magic Mirror

      Hi @drewski3420,

      Thanks!
      I didnt use any special product, it has a small wooden frame + nails and some aluminium L profiles.
      When I ordered the mirror, I had added holes to the design so it would be easier to mount afterwards. You can see it in the pictures here:

      IMG_0082.jpeg

      IMG_0070.jpeg

      IMG_0138.jpeg

      How that helps
      Stay healthy!
      Cheers

      posted in Show your Mirror
      P
      pablousavilla
    • RE: My new Magic Mirror

      Thanks @MyMirror

      Sure, its a dirty hack as Im not a programmer, but it works.

      1. You need to download the data you want from a sensor, to do that, go to the site, select which sensor and data would you like to have and instead of clicking download, right click and copy the link, it would look something like this:
        Options selected: 24hrs data, 10 Minute Value, Arithmetic average, Temperature sensor -> https://api.opensensemap.org//statistics/descriptive?boxid=5b1421ce4cd32e00193f0983&columns=lat,lon,boxName,boxId,unit&download=true&format=csv&from-date=2021-01-03T10:36:32.413Z&operation=arithmeticMean&phenomenon=Temperatur&to-date=2021-01-04T10:36:32.413Z&window=10m

      You can later automate this process using wget and changing the date variables in that string

      1. The file is a csv file that needs to be changed to json in a format that looks like this:
        [[“DateTime1”, Value1 ], [“DateTime2”, Value2], … ]

      There is many python examples on how to do the conversion, but what I found is that they dont return the same format. For example: https://medium.com/@hannah15198/convert-csv-to-json-with-python-b8899c722f6d

      The output looks instead something like this:
      {
      “DateTime1”: “Value1”,
      “DateTime2”: “Value2”,
      …
      }

      1. So I take that and apply some command line to replace, move, etc… WIth the above format, you could use this:

      grep -v ‘“”’| sed ‘s/"temperatur_20/["20/g’ | sed ‘s/T/ /g’ | sed ‘s/Z"/"/g’ | sed ‘s/",/],/g’ |sed ‘s/": “/”, /g’ | sed ‘s/{/[/g’ | sed ‘s/}/]/g’ |grep 20 | head -c-3

      Dont forget to add the first and last [ ]

      1. And then you need to enable apache and copy to a location where MMM-Chart can find it

      This should do it. I hope it works for you!

      Cheers

      posted in Show your Mirror
      P
      pablousavilla
    • My new Magic Mirror

      Hi Team,

      After a couple months of playing around and testing different setups. I can show you what I’ve managed to put together.

      HW wise:

      • Raspberry Pi 4
      • Raspberry Camera
      • USB Mic
      • WM8960 Audio Board + speakers
      • Fan
      • Radar Sensor RCWL 0516 (movement to activate the display)
      • AOC 22B2H screen
      • MirrorView 4mm Glass from Glas-star.de
      • Humidity/Temperature Sensor DHT-11 (to measure room temp/humidity)

      Modules:

      • MMM-Strava
      • MMM-Face-Reco-DNN
      • MMM-Spotify
      • MMM-PIR-Sensor
      • MMM-Carousel
      • MMM-COVID19-AMPEL
      • MMM-Chart (data from http://opensensemap.org)
      • MMM-GoogleAssistant
      • MMM-MicVolume (mic deactivated until Face-Reco gets a positive detection, this disables the google assistant - for privacy)
      • mmm-systemtemperature
      • MMM-WiFiPassword

      Extras

      • Airplay
      • pi-fan-controller

      Here are a few pics:

      ABD1ACAB-79DC-450F-BD34-0CEFEE133FC3_1_105_c.jpeg

      F1CF7BE4-A35A-416C-9054-345ADBC3C292_1_105_c.jpeg

      9AD1E214-E31B-4A3F-B101-A673413391C0_1_105_c.jpeg

      Open issues:
      The camera has problems recognising through the glass, the image is too dark. It works… but it requires to a lamp to be on. I haven’t found a way to play with the amount of time it takes for the photo to be taken. The raspistill command does it automatically, but the Face-Reco module doesn’t allow an option for it that I can tell

      posted in Show your Mirror
      P
      pablousavilla
    • Issues enabling https on RP 4

      Hi all,

      I found myself working on my first Smart Mirror this week and I loved how easy it is to download new modules and have them running in no time.
      I was interested in enabling https by creating the certificates and changing the variable under config.js:

      useHttps: false -> useHttps: true

      Nevertheless I only got a black screen afterwards.

      I tried everything I could think of, but, being that Im not much of a programmer, it basically meant hitting the keyboard with one hand while having another coffee hoping that would do it.

      Eventually, I managed to find out that I could connect to the https://localhost:port via a browser, which made me realise the keyboard-hitting works… and that it was running… just not with electron.

      Well, tonight, after many an hour in front of this, I was able to get it to work, so I can narrow it down to the following:

      • Create your certificates correctly
      • Make sure you put the right address where they are located
      • Not enough coffee
      • There is a piece of code in electron.js that seems to be checking the wrong variable:

      // if (config[“tls”] !== null && config[“tls”]) {
      if (config.useHttps) {
      prefix = “https://”;
      } else {
      prefix = “http://”;
      }

      The line in “//” was commented out by me. I couldnt find much of a reference to tls anywhere.

      • Finally, as the certificate is self signed, these lines had to be added also to electron.js:

      app.on(‘certificate-error’, (event, webContents, url, error, certificate,
      callback) => {
      event.preventDefault();
      callback(true);
      });

      I hope it helps someone else!

      Thanks
      Regards
      JP

      posted in Troubleshooting
      P
      pablousavilla