{"id":1376,"date":"2021-10-15T11:52:28","date_gmt":"2021-10-15T15:52:28","guid":{"rendered":"http:\/\/www.thesmarthomehookup.com\/test_install\/?p=1376"},"modified":"2023-02-08T12:40:50","modified_gmt":"2023-02-08T17:40:50","slug":"halloween-decoration-automations-with-node-red-and-falcon-player-pi","status":"publish","type":"post","link":"https:\/\/www.thesmarthomehookup.com\/test_install\/halloween-decoration-automations-with-node-red-and-falcon-player-pi\/","title":{"rendered":"Halloween Decoration Automations with Node Red and Falcon Player Pi"},"content":{"rendered":"<p><iframe title=\"YouTube video player\" src=\"https:\/\/www.youtube.com\/embed\/T8LeMcXoj1A\" width=\"560\" height=\"315\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n<p>Everything from this point on is totally optional, and unless you are already pretty familiar with automation and holiday light shows it will probably seems pretty overwhelming, but I\u2019m hoping showing my setup will at least give you some ideas to implement at your house.<\/p>\n<p>The first thing I wanted to tackle was being able to start specific videos at the same time on each projector so I could have ghosts travel around the house.&nbsp; To do this I used a program called xlights to create the sequence files, and then a program called falcon player pi to play them.&nbsp; The nice part about using xlights is that it\u2019s typically used for holiday light shows, so I was also able to sequence my permanently installed house LEDs and LED props to follow along with the videos.<\/p>\n<p><a href=\"http:\/\/www.thesmarthomehookup.com\/test_install\/wp-content\/uploads\/2021\/10\/premiere.jpg\"><img fetchpriority=\"high\" decoding=\"async\" src=\"http:\/\/www.thesmarthomehookup.com\/test_install\/wp-content\/uploads\/2021\/10\/premiere-1024x609.jpg\" alt=\"\" width=\"688\" height=\"409\"><\/a><\/p>\n<p>Step one was to create a unique video for each projector that included blank spaces for when the animation would be in a different part of the house.&nbsp;&nbsp; I happen to be a YouTuber so I already pay the ridiculous adobe premiere subscription fee, but you could easily accomplish this in iMovie or any other free movie editor.&nbsp; For this example I\u2019m going to use 4 projectors and the wraith animation from the phantasms package. I want it to appear first as a hollusion between my front porch pillars, then come out of a portal on the second story wall, get sucked back into the portal, and finally do a jump scare skull on the front door.<\/p>\n<p><a href=\"http:\/\/www.thesmarthomehookup.com\/test_install\/wp-content\/uploads\/2021\/10\/folder-structure.jpg\"><img decoding=\"async\" src=\"http:\/\/www.thesmarthomehookup.com\/test_install\/wp-content\/uploads\/2021\/10\/folder-structure-1024x495.jpg\" alt=\"\" width=\"688\" height=\"333\"><\/a><\/p>\n<p>Next I needed to export each video separately so I created a folder with sub folders for each projector, and exported the file 4 different times with a different layer visible each time. The important thing is that each file is the exact same length and has the same filename.<\/p>\n<p><a href=\"http:\/\/www.thesmarthomehookup.com\/test_install\/wp-content\/uploads\/2021\/10\/xlights1.jpg\"><img decoding=\"async\" src=\"http:\/\/www.thesmarthomehookup.com\/test_install\/wp-content\/uploads\/2021\/10\/xlights1-1024x606.jpg\" alt=\"\" width=\"688\" height=\"407\"><\/a><\/p>\n<p>Next in xLights you can see that I already have my entire house mapped for light shows, but it\u2019s not necessary to be able to sync up video.&nbsp; If you\u2019re interested in light shows and xlights<a href=\"https:\/\/youtu.be\/9I2PsgyKZPg\"> I\u2019ve got a couple of beginner level videos on that subject<\/a>.&nbsp; Anyways, create a new sequence and choose one of your video files as the audio file.<\/p>\n<p><a href=\"http:\/\/www.thesmarthomehookup.com\/test_install\/wp-content\/uploads\/2021\/10\/xlights-2.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.thesmarthomehookup.com\/test_install\/wp-content\/uploads\/2021\/10\/xlights-2-1024x607.jpg\" alt=\"\" width=\"688\" height=\"408\"><\/a><\/p>\n<p>In this next window I could sequence my LEDs to follow the video, or if you don\u2019t have LEDs you can just hit save and it will generate a fseq file.<\/p>\n<p><a href=\"http:\/\/www.thesmarthomehookup.com\/test_install\/wp-content\/uploads\/2021\/10\/falcon-player.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.thesmarthomehookup.com\/test_install\/wp-content\/uploads\/2021\/10\/falcon-player-1024x565.jpg\" alt=\"\" width=\"688\" height=\"380\"><\/a><\/p>\n<p>To play those videos and fseq files, we\u2019re going to use a program called <a href=\"https:\/\/github.com\/FalconChristmas\/fpp\">Falcon player pi or FPP<\/a>, which as the same suggests runs on a raspberry pi.&nbsp; In order to keep costs down I used the cheapest raspberry pi available which is the raspberry pi zero w.&nbsp; It\u2019s possible that some of the issues I ran into later are because I choose this pi, and you might have a smoother experience if you use a raspberry pi 4 or even a 3b.&nbsp; Either way, download and install FPP on your SD card using etcher, then plug it in and wait a few minutes for FPP to go into wifi setup mode.&nbsp; Connect to the FPP hotspot using the password \u201cChristmas\u201d and then navigate to 192.168.8.1 to setup your home wifi information.<\/p>\n<p><a href=\"http:\/\/www.thesmarthomehookup.com\/test_install\/wp-content\/uploads\/2021\/10\/fpp1.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.thesmarthomehookup.com\/test_install\/wp-content\/uploads\/2021\/10\/fpp1-1024x345.jpg\" alt=\"\" width=\"688\" height=\"232\"><\/a><\/p>\n<p>Once you\u2019ve got your falcon player on your network you\u2019ll want to change a few options to set it up for playing video.&nbsp; Under FPP settings click on Audio\/Video.&nbsp; If you want your projector to play the audio from your files you should change the audio output device to HDMI, also make sure that default video output device is also set to HDMI in this window.<\/p>\n<p><a href=\"http:\/\/www.thesmarthomehookup.com\/test_install\/wp-content\/uploads\/2021\/10\/fpp2.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.thesmarthomehookup.com\/test_install\/wp-content\/uploads\/2021\/10\/fpp2-1024x506.jpg\" alt=\"\" width=\"688\" height=\"340\"><\/a><\/p>\n<p>Then under the System heading select the Blank screen on startup and Force HDMI display checkboxes.<\/p>\n<p>Repeat this same process on each of your raspberry pis for each projector.<\/p>\n<p><a href=\"http:\/\/www.thesmarthomehookup.com\/test_install\/wp-content\/uploads\/2021\/10\/fpp3.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.thesmarthomehookup.com\/test_install\/wp-content\/uploads\/2021\/10\/fpp3-1024x457.jpg\" alt=\"\" width=\"688\" height=\"307\"><\/a><\/p>\n<p>Next you\u2019ll need to upload your video files and sequences.&nbsp; Do this under content setup, file manager, just drag each video and fseq file into that window.&nbsp; Once your files are uploaded you\u2019ll create a playlist for each sequence with the fseq file as the sequence and the correct mp4 file as the media.&nbsp; Give your playlist a simple name with no spaces.<\/p>\n<p>At this point from the status page you should be able to select a playlist, hit play, and see your video pop up on the projector, if that doesn\u2019t work, try hitting the restart fppd button, wait for it to come back up, then try again.<\/p>\n<p>This next section is how it is supposed to work, but I wasn\u2019t able to make it work with my hardware, so give this a shot, and if it works, great, if not, keep reading and I\u2019ll show you my workarounds.<\/p>\n<p><a href=\"http:\/\/www.thesmarthomehookup.com\/test_install\/wp-content\/uploads\/2021\/10\/fpp4.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.thesmarthomehookup.com\/test_install\/wp-content\/uploads\/2021\/10\/fpp4-1024x474.jpg\" alt=\"\" width=\"688\" height=\"318\"><\/a><\/p>\n<p>Out of the box FPP is supposed to be able to sync between multiple instances by setting one as the player and the others to remote.&nbsp; You can easily do this in the multisync menu of the master player by selecting the other FPP instances and then choosing \u201cset to remote\u201d.<\/p>\n<p>In theory what should happen is that when you play a sequence on the master it will trigger each remote to play the same sequence and then it will adjust the speed of the video on each remote to keep them all in sync.&nbsp; In practice, I found that my remotes would almost always freeze within the first 10 seconds of video playback.&nbsp; After some digging I found the reason for this is that there is a maximum sync gap that can be overcome by increasing the speed of the video, and that is about 2 seconds.&nbsp; After that sync gap, FPP will instead do a seek on the video to try to skip to the correct location. Unfortunately, when videos are high resolution and slower processors are used like a raspberry pi zero, it often takes more than 2 seconds for the video to seek, resulting in another seek, and another, and so on.&nbsp; You can supposedly fix this by using a faster processor, lower resolution video files, or editing the FPP source code to allow for a larger sync gap to be overcome with video speed increases, but I didn\u2019t try those solutions.<\/p>\n<p><a href=\"http:\/\/www.thesmarthomehookup.com\/test_install\/wp-content\/uploads\/2021\/10\/nodered.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.thesmarthomehookup.com\/test_install\/wp-content\/uploads\/2021\/10\/nodered-1024x594.jpg\" alt=\"\" width=\"688\" height=\"399\"><\/a><\/p>\n<p>Instead I just used node red to start each FPP instance at the same time using http commands. Luckily falcon player pi has pretty good documentation of their API, so sending the command to start the playlist is as simple as updating the ip address and playlist name in this HTTP GET request:<\/p>\n<pre>http:\/\/192.168.30.190\/api\/command\/Start%20Playlist\/Wraith<\/pre>\n<p>But that\u2019s not the end of the bug squashing.&nbsp; For me, after about 10-15 minutes, video playback seems to stop, and falcon player says that it\u2019s playing video, but it clearly isn\u2019t.&nbsp; The fix for this is to restart the falcon player service on the pi, not the pi itself, just FPPD.&nbsp; I also found that the quick reload version of this is able to fix the bug, so it only takes a few seconds when using this HTTP GET request:<\/p>\n<pre>http:\/\/192.168.30.190\/api\/system\/fppd\/restart?quick=1<\/pre>\n<p>Putting it all together I use a home assistant input Boolean called Halloween show to trigger the sequence, then it sends an HTTP GET request to restart FPPD on all of the falcon players that need to play video, then it waits for 15 seconds for them to come back online, picks a random value from 1-3 and selects a playlist based on that value.&nbsp; I use the trigger node to start the playlist and then wait a specific amount of time based on the length of the particular video and send another message back into the input Boolean to see if the Halloween show should still be running, and if so it repeats the process.<\/p>\n<p><a href=\"http:\/\/www.thesmarthomehookup.com\/test_install\/wp-content\/uploads\/2021\/10\/nodered.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.thesmarthomehookup.com\/test_install\/wp-content\/uploads\/2021\/10\/nodered-1024x594.jpg\" alt=\"\" width=\"688\" height=\"399\"><\/a><\/p>\n<p>A similar flow handles the motion detection for the front door jump scare by randomly selecting a playlist of 7 possible jump scares.&nbsp; Because timing is important here, I didn\u2019t have it restart FPPD, but that\u2019s fine because the main loop will restart it approximately every 2 minutes.&nbsp; However, I didn\u2019t want it to restart in the middle of a jump scare, so I added a check using falcon player\u2019s MQTT to see whether the door is currently playing a jumpscare before trying to restart.&nbsp; The same type of MQTT check exists for the 3DFX model to make sure it\u2019s not in the middle of a story when the reset loop happens.<\/p>\n<p>If you\u2019ve got questions on this setup PLEASE leave a comment on the YouTube video or come join the Hook Up Home Automation group on facebook.&nbsp; I do not monitor the comments on this website due to the incredible amount of spam (hundreds of messages a day).&nbsp; I hope something here inspired you, Happy Halloween!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Everything from this point on is totally optional, and unless you are already pretty familiar with automation and holiday light shows it will probably seems pretty overwhelming, but I\u2019m hoping showing my setup will at least give you some ideas to implement at your house. The first thing I wanted to tackle was being able [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":2456,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[4,5],"tags":[],"class_list":["post-1376","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-projects","category-tutorials"],"acf":[],"mb":[],"mfb_rest_fields":["title","gutenberg_elementor_mode"],"_links":{"self":[{"href":"https:\/\/www.thesmarthomehookup.com\/test_install\/wp-json\/wp\/v2\/posts\/1376","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.thesmarthomehookup.com\/test_install\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.thesmarthomehookup.com\/test_install\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.thesmarthomehookup.com\/test_install\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.thesmarthomehookup.com\/test_install\/wp-json\/wp\/v2\/comments?post=1376"}],"version-history":[{"count":5,"href":"https:\/\/www.thesmarthomehookup.com\/test_install\/wp-json\/wp\/v2\/posts\/1376\/revisions"}],"predecessor-version":[{"id":2225,"href":"https:\/\/www.thesmarthomehookup.com\/test_install\/wp-json\/wp\/v2\/posts\/1376\/revisions\/2225"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.thesmarthomehookup.com\/test_install\/wp-json\/wp\/v2\/media\/2456"}],"wp:attachment":[{"href":"https:\/\/www.thesmarthomehookup.com\/test_install\/wp-json\/wp\/v2\/media?parent=1376"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.thesmarthomehookup.com\/test_install\/wp-json\/wp\/v2\/categories?post=1376"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.thesmarthomehookup.com\/test_install\/wp-json\/wp\/v2\/tags?post=1376"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}