Search within Lanny's blog:


Leave me comments so I know people are actually reading my blogs! Thanks!

Wednesday, August 07, 2019

Daily Battles: How to Troubleshoot Smart Home Light Switches

I have a Jasco Z-Wave Smart Light Switch just like the one pictured below that I bought from Amazon. I had integrated it into my Vivint Smart Home system and use it to control my outdoor low-voltage lighting in the front yard. I enjoyed it immensely. Before installing this switch, I had to flip a light switch in the wall to turn front yard lights on and off manually. With this waterproof smart switch, now I can turn on/off lights directly from my smart phone app. But the best part is that I don't even have to turn them on/off myself anymore. I have a custom action that will automatically turn lights on at sunset and then automatically turn them off at midnight. I can even have lights automatically turn on when my outdoor camera or my doorbell camera detects a person and then automatically turn them off after 5 minutes.



There are of course other brand of smart switches, and they might be using something other than Z-Wave (a communication protocol), such as ZigBee or WiFi. But the idea is the same. As long as you can integrate it into your smart home system, you are good.

Then one day, my control panel complained that my switch is offline. So the troubleshooting began.

I unplugged the switch off the outlet outside and then plugged it back in. Didn't help.

Next, I try to run diagnostics and rediscoveries of all my Z-Wave smart home devices and see if that would improve things. Nope, switch still shows as offline.

Maybe it is bad signal strength? I wondered. So I took my panel off the wall (it has built int battery) and then set it right next to the switch and ran diagnostics again. Still no change.

Having no choice, I went to the last resort: removing the device from the panel and then learn it back in again. This was not my preferred solution because after I do this, I would have to recreate all my custom actions and device groups relating to this device. But guess what, I couldn't remove or add the device at all.

Do I even have power on this outside outlet? Maybe it got shorted from the rain or something? So I took a lamp outside and plugged it into the outlet. Problem confirmed: I simply didn't have power.

So next thing was to see if the circuit break has been tripped due to the short. You see, I have two circuit break boxes and the switches were not very well labeled (which is probably typical for most homes). So there I was, turning switches off and on for all the unknown control regions, effectively rebooting many things at my house, the stove/microwave, the washer/dryer, the furnace/AC, my garage door openers, my computers/routers/switches, my 100+ smart home devices, the list goes on and on. But after I pretty much reset all the circuit breaks, when I took the lamp out to test again, I still didn't have power!

I was completely dumbfounded!

About a week later (a week without my convenient outdoor front lawn lighting automation), a thought suddenly struck me: "Didn't I use to turn front lawn lights on/off using an in wall switch?" I ran to the location of the in wall switch immediately.

Sure enough, the switch has been turned off even though I had it COMPLETELY TAPED OFF.

After I turned the switch back on, wah-lah, my lighting automation is back! I didn't have to reinstall anything, it just worked! So here's the important lesson learned:

Always check the in-wall switch first to make sure it is on for any of your smart home lighting troubleshooting tasks!!

The other lesson learned here is that your kids will always destroy your perfectly working things. But that deserves a whole series of blog posts of their own.

Ciao!








I repeat: your kids will always destroy your perfectly working things.








BTW: The easiest way to remember my blog address is http://lanny.lannyland.com

Tuesday, August 06, 2019

Daily Battles: How to Play Two Video Clips Simultaneously and Synchronously Side-by-Side

I was trying to compare two computer vision models on how well they handle object detection on certain scenarios and wanted to see the bounding boxes from each model drawn in the same clip and compare visually side by side. So I need a way to play two clips (same clip but with different bounding boxes drawn on top of them) synchronously so I can compare the exact same frame for both clips.

Problem Statement:
Be able to play two 1:1 ratio clips side by side simultaneously and synchronously (frame synced to frame) and be able to start and pause both clips simultaneously without spending any money on new software.
It was actually not easy to find the exact solution. Let me share with you what I learned.

Option 1: iMovie App on Mac

Obviously this tool is only available on a Mac. However, it is a free tool that comes with the Mac OS, which is handy.


The iMovie app has a split screen button that let you easily place two video clips side by side. Then you can even export the resulting split screen movie to a new video clip, so you can play them side by side again and again in the future.

You basically import two clips into the app, and then drag each one to the timeline with one above the other (not drag on on top of the other, which confused me quite a while). Selecting one of them in the timeline, and then click that split screen button. That's it!

This article link below will give you all the details.

iMovie for Mac: Create a split-screen effect

However, since my two clips are 1:1 ratio, and iMovie only allows for 16:9 and 4:3 ratio, my two side by side clips all got cropped automatically (because two clips side by side becomes 2:1, which is 18:9), and I lost a section of my clip on the left side for both clips. And there is absolutely no way to create custom size ratios in iMovie. You have to pay Apple money to get their better version of the app, which doesn't meet my requirement. So this is not a solution for me!

Option 2: VLC Media Player

VLC Media Player is a free and open source cross-platform multimedia player that runs on both Windows and Mac.



Many people have posted tutorials (such as the one linked below) on how to change some settings in VLC that will allow you to open multiple instances of the VLC app, thus, allowing you to play multiple clips at the same time. You basically uncheck a few checkboxes in settings (which is not available for the Mac version and you have to do some command line trick to get it working).

VLC HowTo/Play multiple instances

But opening multiple instances of the player doesn't let me control both clips in order to simultaneously start and pause. In order to that, I have to create complicated across instance hotkeys, which I won't do.

Inside the VLC player, there are actually functionalities built in to allow you to play two clips side by side with synchronous control. In the 3.0.X versions, you go to File--Advanced Open File, and you get this screen below:
In here you can supposedly specify two different clips to be played synchronously. I was so happy when I found this, and then I was so sad when I found out it doesn't work!!

Then I found that I am not the only one suffering. Someone else has already reported a bug to VLC:

#22495 new defect: Advanced File Open - Play another media synchronously not functioning in 3.0.x

AAAAAHHHH!!!!

Anyway, if you are willing to go back to the 2.x.x versions, this function still works there. You do create security risks if you downgrade though.

So again, not a solution for me!

Option 3: QuickTime Player

QuickTime player is another Mac built in multimedia player. You can double clip on your two clips to open two QuickTime windows and drag them to be side by side. But how can you play/pause both clips at the same time?


I did find this web page below that says you can either select "Play All Movies" from the Movie menu, or press command-option-space to start both clips at the same time. But guess what? I don't have the option of "Play All Movies." That is only available in the paid version of QuickTime Pro app! Dang! And command-option-space also doesn't work!! Dang!!

Play two movies simultaneously in QuickTime Player

After many trial and error, I finally figured out what works, and you are in luck!!

To start both clips at the same time, press Command-Enter. And to pause, press Command-Enter again!

That's it! And this would meet my needs. So problem solved and for this battle, I won!

Option 4: Command Line Tools

You can also play multiple videos side by side from command line control. But this requires installing and configuring frameworks, so not for the faint-hearted.

You can use gstreamer/gst-launch pipeline described in this article.

I've also heard you can use the tiling plugin in Nvidia's DeepStream SDK.

I will eventually get those working on my computer. For now, option 3 works for me!



Video of the Day:

Think of your life challenge as a bear approaching you. Don't panic and stay calm. The problem might not be that bad!




BTW: The easiest way to remember my blog address is http://lanny.lannyland.com