Automatically Disabling WiFi in macOS Mojave When Connecting to Ethernet

Standard

I don’t know why, but macOS doesn’t seem to have an automatic ability to shut down the WiFi adapter when an Ethernet connection is detected. It’s a simple thing that can cause several problems, especially if you are in an environment where you may need to authenticate to a network or access VPN services.

It may be possible to manage locations and some additional tools, but I didn’t want something that required retooling every time I used my system in a new location, so I decided to write a simple script, using built-in tools for everything except the execution of the script.

This script will check for both an active WiFi connection and also an active Ethernet connection. If it detects both, it will shutdown the WiFi interface and display a notification, via macOS notifications, that it has done this. I haven’t tested this on previous versions of macOS (only Mojave), though if the rest of the commands work, the script might function by simply removing the statement that generates a notification.

Continue reading

Correcting RGB Color Value Scales for FLUX LED Strip plugin devices in Indigo – Python Scripting

Standard

I ran into a very frustrating problem last night while trying to work on some scripting within Indigo for controlling the LED colors of a new LED strip. I had no problem with actually controlling colors using the built-in UI tools for updating colors, but a slightly more complex usage presented a major problem.

The issue started with a need to save the current state of the individual RGB values in the LED strip, before I apply a change, such as when a notification occurs. This is to ensure that after a notification “flash” occurs that the colors will go back to the same values they were before the notification.

Via scripting, I had no problem getting the values. The problem occured when I went to restore the values. As it turns out, I struggled with this issue most of the night until I finally figured out that it was a difference between how the UI treats RGB values and how they are actually stored in the device.

The problem is that I was retrieving RGB values that were based on a scale with a minimum of 0 and a maximum of 255, but when I passed these values back the UI was converting those numbers, incorrectly, into values on a scale of 0 to 100. Eventually, I realized that before I can restore the individual color values, I must first convert them to the UI’s scale.

In addition, and perhaps I confused this with that issue, before I figured it out, I also had problems changing the color more than once in the same script. This may have been more of a timing issue (a kind of race condition) so I split the two scripts into seperate actions with a 5 second dely for the second script.

Here’s the first script that reads the LED strip’s color values and stores them into Indigo variables. The last line changes the RGB settings to display a yellow color, for notifications.

dev = indigo.devices[1681458792]
indigo.variable.updateValue(indigo.variables[872936515],value=unicode(int(dev.redLevel)))
indigo.variable.updateValue(indigo.variables[770189775], value=unicode(int(dev.greenLevel)))
indigo.variable.updateValue(indigo.variables[753658911], value=unicode(int(dev.blueLevel)))
indigo.variable.updateValue(indigo.variables[1059165341], value=unicode(int(dev.brightness)))
indigo.dimmer.setColorLevels(dev, 100, 100, 0, 0)

The first ID used represents the Indigo ID for the LED strip. The other four IDs are for the Indigo variables. All of these devices are unique to my Indigo setup, my devices and my variables. The correct values can easily be acquired by right-clicking (or Control-click) on the item within Indigo to select the ‘Copy ID’ option.

The next part of the script restores the value of the individual color variables. It first converts each value to an integer (all Indigo variables are stored as strings, so they must be converted for this type of usage) and then do some simple math to convert the RGB values to the appropriate scale. The original equation I found had more components but I removed them since the minimum value in both scales is always zero; by removing the zeros it had no effect on the final calculation.

Note that RGB values being set should be integers as well, before being used to actually change the color values.

dev = indigo.devices[1681458792]
valRed = ((int(indigo.variables[872936515].value) * 100) / 255)
valGreen = ((int(indigo.variables[770189775].value) * 100) / 255)
valBlue = ((int(indigo.variables[753658911].value) * 100) / 255)
indigo.dimmer.setColorLevels(dev, int(valRed), int(valGreen), int(valBlue), 0)

So far, this seems to be working properly.

Nexlud LED Strips for TV Backlight and Home Automation (Magic Home)

Standard

This post contains Amazon Associate links. If you purchase something through them I may get a small commission, which helps cover the hosting costs for this blog.

LED Strip01.jpg

My desire to integration visual notifications into our home automation setup has remained, despite taking the color-changing LED bulb out of the setup when we moved. I recently begain toying with the same bulb and in the process I realized it might be fun, and useful, to find an LED strip that I could place behind the TV. It would add a nice atmospheric effect and also provide another source of visual indicators. I have started working on using the bulb for washing machine notifications and other events, but those notices are suppresed after 10 pm at night, and that light spends most of it’s time simply functioning as a normal lamp in the bedroom.

With any home automation setup it’s always best to ensure that a device is compatible with your controller, before purchase. Fortunately, someone had developed the FLUX LED plugin to make certain Magic Home devices available to Indigo. I decided to order a wifi and IR controlled Nexlud LED Strip Lights set, which only cost about $30.

It’s taken some work, and I had a color value conversion issue that I’ll mention in another post, but it appears to be working great. My next step is to set it to automatically turn on when the TV is powered on, and to turn it off when the TV is powered off. I’m not sure, yet, if I can accomplish this via Indigo. I test the Harmony Companion plugin, but I think it is only aware of Harmony interactions initiated within Indigo. I could be mistaken, which I’ll find out of for certain. If that doesn’t work, I’ll train the Harmony itself to interact with the device (Harmony didn’t automatically recognize this device in its database of codes).

Updated 2018/08/08: I also have it setup to be controlled via the Harmon Hub. This just required training the device to recognize the remote commands, which wasn’t difficult but did take some time to program most of the color modes. I also added control via Alexa, though now I only control the on/off state through the Hue Bridge emulation between Indigo and Alexa, instead of using the Magic Home skill.

LED Strip02.jpg

Ring Video Doorbell 2

Standard

This post contains Amazon Associate links. If you purchase something through them I may get a small commission, which helps cover the hosting costs for this blog.

Within the past couple of months I purchased two Ring video devices to monitor a property. The first device I decided to get was the Ring Video Doorbell 2.

This device can replace an existing doorbell or be installed where there isn’t one. It provides video and audio recording and can be used to record motion events and interact with someone at your door, live and remotely, from a devices using the Ring app, which works on iOS, Android, Mac OS and Windows.

Continue reading

Game Streaming from an Xbox One to a MacBook Air (11 inch, mid-2013) using Windows 10 (Boot Camp)

Standard

Xbox-One-Streaming-01

The Short Version: I was able to successfully use Xbox One Game Streaming using Windows 10 via Boot Camp (OS X El Capitan) on my MacBook Air (11 inch, mid-2013) with 8 GBs of RAM and the Medium quality setting with only minor audio lag and no noticeable video lag.

Continue reading

Plugable USB 2.0 to Gigabit Ethernet Adapter

Standard

USB-Ethernet-USB2-E1000

Several months ago I lost some network ports on different devices due to a power surge from a nearby lightning strike. Unfortunately, one of the devices that took a hit was the ASUS system I’m using for managing home automation. After the surge I configured the system to use wifi but it was struggling to keep up with network traffic (the system does more than just manage my home automation setup).

After I while I decided to purchase a Plugable USB 2.0 to Gigabit Ethernet Adapter. It’s worked great ever since and as far as I can tell I haven’t had any new problems with the system (and bandwidth has clearly improved over the wifi connection). The device retails from Amazon for about $25.

Toshiba Blu-ray Player (BDK33)

Standard

Toshiba-Blu-Ray-01Toshiba-Blu-Ray-02

Last weekend I made a couple of purchases for the living room, which I’ve been planning for a while. One of these purchases was a Toshiba Blu-ray Player (BDK33). We’ve been able to watch Blu-ray movies on the PS3, but it’s in a different room and I’ve been wanting to be able to also watch Blu-rays in the living room (the other room has a larger television but it’s currently lacking comfortable furniture).

I looked at several different models in Best Buy and Target. I didn’t bother with checking Wal-Mart this time. I was surprised to find a real deal in Best Buy. It’s rare that they have anything, aside from movies, that I would purchase there.

It only costs $59.

I considered it a good deal because it has wifi capability built-in (unlike many that are “wifi ready”, meaning you’ll need some kind of adapter to use them on wifi). It also supports Netflix, Hulu, and some other services.

I was actually just looking for a plain Blu-ray player without those bells and whistles. After all, I already have an Apple TV in the living room. The price convinced me to go ahead and get it. Sometimes it’s difficult to find a regular Blu-ray player even for $59.

So far I’ve been happy with the purchase, though I haven’t used it much. We’ve only watched a single Blu-ray movie and though I do have it on the wifi network I haven’t tested Netflix or Hulu. It’s connected to my older 32″ TV via the HDMI switch. The movie played without any problems and it looked great on my older HDTV.

CrystalView Wireless Instant Router and Repeater

Standard

The Short Version: I only purchased this to extend an existing network. Once I figured out that it could only setup a new wifi network by using the original one as an Internet connection I ditched it. I had no interest in setting up multiple wifi networks just to extend my range. I probably could have configured the device to successfully setup another wifi network, but since that wasn’t why I purchased it I didn’t bother tweaking it any further. For more information about setting this device up you might find the many comments more useful.

I came across a very cheap wireless router at the local CVS (CrystalView Wireless Instant Router and Repeater). Now, I’m not in need of a router but what caught my attention was that it also claimed to have a repeater mode. It was marked at $25 and I thought it might serve as a good alternative to other wireless extender options. I didn’t need anything fancy but I wanted to increase the wireless coverage in part of our home.

After tinkering with it I found that it doesn’t work the way I expected. Technically, I don’t think it’s appropriate to call this device a repeater.  As far as I can tell it doesn’t repeat a wireless network. In my mind this should mean that the wireless configuration is the same and that all devices appear to be on the same network. It does not seem to be capable of extending an existing wireless network.

Continue reading

iPod touch (4th Gen) Unable to Join Network

Standard

The Short Version: My wife’s iPod touch (4th gen) may have a hardware failure. We’ll send it to Apple for repair. None of the various troubleshooting steps I’ve tried have made any difference (see full post for details).

A couple of months ago my wife’s iPod touch was damaged so she replaced it with a new one (both were 4th generation models). I don’t think she used it very much until a few weeks ago when she was unable to connect to the secure wifi network at our house. That evening I fiddled around with it for about thirty minutes but wasn’t able to make it connect.

Last night she tried to use it again, so once again I tried to get it connected to the network. I’ve had to troubleshoot some iPod issue before so this wasn’t an entirely new experience (and I’ve also been using an iPhone for several years).

Nothing worked. Absolutely nothing would make the device connect to the network. And it’s not just a problem with our network. I tried others wifi networks (even attempted to tether it to my iPhone) but it refused to connect.

Continue reading