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

    Posts

    Recent Best Controversial
    • RE: Snilles Magic Mirror Project

      @cowboysdude Thank you!! :) The LEDs you say. :) Ok, for the moment, the mirror is not “aware” of the leds. This is something I’m planing to implement. But as it works now I’m using PixelWeb with Bibliopixel 2.x as a back end. Then I’m using the below sh script to trigger different (predefined so far) animations.

      #!/bin/bash
      #-----------------------------------------------------------------------------
      # 
      # Snilles MagicMirror Led Conrol Script.
      # Use in conjunction with PixelWEB.
      #
      #-----------------------------------------------------------------------------
      # Connfigure here!
      # URL to PixelWEB API On the MM.
      apiurl="http://x.x.x.x:8081/api";
      # Default program if no argument is set.
      defprog="back";
      # Default red amount if non is set.
      defred="45";
      # Default green amount if non is set.
      defgreen="30";
      # Default blue amount if non is set.
      defblue="0";
      # Default brightness amount.
      defamount="50";
      
      ## -------------------------- Dont edit below!! --------------------------- ##
      
      while [[ $# -gt 0 ]] ; do
      	case $1 in
      		-h|-\?|--help)
      			echo "Usage: mirrorleds.sh -p or --program [back, running, alarm, rainbow or thunder (rainbow and thunder needs no colors)] -r or -red [0-255] -g or --green [0-255] -b or --blue [0-255] -a or --amount [0-255]";
      			exit;
      			;;
      		-p|--program)            
      			if [ -n "$2" ]; then
      				program="$2"
      				shift
      			else
      				program="$defprog"
      			fi
      			;;
      		-r|--red)
      			if [ -n "$2" ]; then
      				if [[ "$2" == ?(-)+([0-9]) ]]; then
      					if [ "$2" -gt "255" ]; then
      						red="255"
      					elif [ "$2" -lt "0" ]; then
      						red="0"
      					else 
      						red="$2"
      					fi
      					shift
      				else
      					red="$defred"
      				fi
      			fi
      			;;
      		-g|--green)
      			if [ -n "$2" ]; then
      				if [[ "$2" == ?(-)+([0-9]) ]]; then
      					if [ "$2" -gt "255" ]; then
      						green="255"
      					elif [ "$2" -lt "0" ]; then
      						green="0"
      					else 
      						green="$2"
      					fi
      					shift
      				else
      					green="$defgreen"
      				fi
      			fi
      			;;
      		-b|--blue)
      			if [ -n "$2" ]; then
      				if [[ "$2" == ?(-)+([0-9]) ]]; then
      					if [ "$2" -gt "255" ]; then
      						blue="255"
      					elif [ "$2" -lt "0" ]; then
      						blue="0"
      					else 
      						blue="$2"
      					fi
      					shift
      				else
      					blue="$defblue"
      				fi
      			fi
      			;;
      		-a|--amount)
      			if [ -n "$2" ]; then
      				if [[ "$2" == ?(-)+([0-9]) ]]; then
      					if [ "$2" -gt "255" ]; then
      						amount="255"
      					elif [ "$2" -lt "0" ]; then
      						amount="0"
      					else 
      						amount="$2"
      					fi
      					shift
      				else
      					amount="$defamount"
      				fi
      			fi
      			;;
      	esac
      	shift
      done
      
      # Default program if non was given. 
      if [ -z "$program" ]; then
      	program="$defprog"
      fi
      
      # Default red amount if non was given. 
      if [ -z "$red" ]; then
      	red="$defred"
      fi
      
      # Default green amount if non was given. 
      if [ -z "$green" ]; then
      	green="$defgreen"
      fi
      
      # Default blue amount if non was given. 
      if [ -z "$blue" ]; then
      	blue="$defblue"
      fi
      
      # Default amount if non was given.
      if [ -z "$amount" ]; then
      	amount="$defamount"
      fi
      
      
      # Compose the colors
      colors="$red,$green,$blue";
      
      # 22 Pixel Alarm
      if [ "$program" == "alarm" ]; then
      	curl -H "Content-Type: application/json" -X POST --data '{"action":"startAnim","config":{"id":"ColorChase","config":{"end":-1,"start":0,"width":22,"color":['$colors']},"run":{"amt":1,"fps":300,"seconds":null,"max_steps":0,"untilComplete":false,"max_cycles":1}}}' $apiurl;
      fi
      
      # Rainbowalarm (multi color spinning)
      if [ "$program" == "rainbow" ]; then
      	curl -H "Content-Type: application/json" -X POST --data '{"action":"startAnim","config":{"id":"ColorPattern","config":{"colors":[[255,0,0],[255,165,0],[255,255,0],[0,255,0],[0,0,255],[128,0,128]],"width":20},"run":{"amt":1,"fps":300,"seconds":null,"max_steps":0,"untilComplete":false,"max_cycles":1}}}' $apiurl;
      fi
      
      # 1 Running Pixel
      if [ "$program" == "running" ]; then
      	curl -H "Content-Type: application/json" -X POST --data '{"action":"startAnim","config":{"id":"ColorChase","config":{"end":-1,"start":0,"width":1,"color":['$colors']},"run":{"amt":1,"fps":40,"seconds":null,"max_steps":0,"untilComplete":false,"max_cycles":1}}}' $apiurl;
      fi
      # Backlight
      if [ "$program" == "back" ]; then
      	curl -H "Content-Type: application/json" -X POST --data '{"action":"startAnim","config":{"id":"ColorPattern","config":{"colors":[['$colors']],"width":1},"run":{"amt":1,"fps":1,"seconds":null,"max_steps":0,"untilComplete":false,"max_cycles":1}}}' $apiurl;
      fi
      
      # Thunder
      if [ "$program" == "thunder" ]; then
      	curl -H "Content-Type: application/json" -X POST --data '{"action":"startAnim","config":{"id":"WhiteTwinkle","config":{"max_led":null,"speed":2,"density":1,"max_bright":'$amount'},"run":{"amt":1,"fps":300,"seconds":null,"max_steps":0,"untilComplete":false,"max_cycles":1}}}' $apiurl;
      fi
      
      # Stop everything
      if [ "$program" == "stop" ]; then
      	curl -H "Content-Type: application/json" -X POST --data '{"action":"stopAnim"}' $apiurl;
      fi
      
      # Add a new line...
      echo $"";
      

      Then I’m using Alexa (for now) to trigger different animations (via the HA-Bridge server). But later on this will be triggered by a module that “picks up” other modules communication so I can animate the leds depending on for example weather events, calendar events, memo events or whatever I can figure out. :) I just have to convince my wife that animating the leds IS a good thing… :)

      posted in Show your Mirror
      SnilleS
      Snille
    • RE: Asus Tinker Board

      Just got mine as well. :)
      Here you can find the OS (and other stuff), if someone else is looking.
      Tinker Board Software

      posted in Hardware
      SnilleS
      Snille
    • RE: Changing ipwhitelist prevents Mirror from loading correctly

      @rcollie I’m on develop branch and I’m using this to be able to access the mirror from anywhere (inside my network). I had to add the “address: “0.0.0.0”.” some time ago… :)

      var config = {
      	port: 8080,
      	ipWhitelist: [],
      	address: "0.0.0.0",
      ...
      

      Try it… :)

      posted in Troubleshooting
      SnilleS
      Snille
    • RE: MMM-homeassistant-sensors stopped working after HA 2021.10 update

      @asifnabi Where are you getting the errors?
      I’m on Core Version core-2022.2.8 and Supervisor Version supervisor-2022.01.1 and it works.

      posted in Troubleshooting
      SnilleS
      Snille
    • RE: Snilles Magic Mirror Project

      I just added a quick comment on all the pictures in the gallery so you know what you are looking at. :)

      posted in Show your Mirror
      SnilleS
      Snille
    • RE: Asus Tinker Board

      Mmmm… I’m thinking MinnowBoard Turbot… Maybe? :)

      posted in Hardware
      SnilleS
      Snille
    • RE: MMM-homeassistant-sensors no icons after MM upgrade to 2.19.0

      Hang on, I just reset everything “back”, reset the MMM-homeassistant-sensors
      to it’s “original” state but let the IP be set in the config… And now it works?
      What’s going on here?! :)

      All modules that are fetching pictures from other places are now working!?
      So, the config needs to have the actual IP of the mirror set now. I have been using 0.0.0.0 all the time… Also tried “localhost” and it did not work. But the actual IP works!

      Great!! Thank you all for helping out! :)

      posted in Troubleshooting
      SnilleS
      Snille
    • RE: MMM-homeassistant-sensors stopped working after HA 2021.10 update

      @asifnabi Hi, if you don’t specify the port, it will default to port 8123. And if you are using ssl (https) you need the port to be set to 443. Otherwise it will not work.

      So, either do not use ssl (https) and you can skip the port option (because it will default to 8123).
      Or use ssl (https) but then you need to specify the port option to 443.

      Both options are working for me at least. I hope this clarify things…

      posted in Troubleshooting
      SnilleS
      Snille
    • RE: Snilles Magic Mirror Project

      @yawns Thank you! :) I know the post is way to long, but when I see others builds, I always want to know how they did things. So I just included all the information at the top. So people don’t have to ask for it. :)

      posted in Show your Mirror
      SnilleS
      Snille
    • RE: Asus Tinker Board

      Ah, just figured out how to rotate the screen. When logged in as “linaro”.
      Open a terminal and do:

      cd ~
      nano .xsessionrc
      

      Paste the following in the file and remove the # in front of the row (left or right) you want to rotate the screen. I am using left myself. :)

      #!/bin/sh
      
      ## To rotate left enable below line.
      xrandr --output HDMI-1 --rotate left
      
      ## To rotate right enable below line.
      #xrandr --output HDMI-1 --rotate right
      

      Reboot to test. :)

      posted in Hardware
      SnilleS
      Snille
    • 1 / 1