Sunday, May 29, 2022

Installing webCOrE for SmartThings (Android) - May 2022

Overview

In the wake of several decisions by Samsung and possibly others, the SmartThings eco system is falling apart.  This article sums up several of the answers for installing webCoRE in SmartThings as they are (were) in the spring of 2022.

Alert: If you are trying to do this on an iOS/Apple mobile device, this isn't likely to help you much.  iOS devices aren't really a favorite of people who want to tinker with something like webCoRE anyway, and are generally VERY restrictive, so I'll just wish you luck finding a similar article, if such a thing exists, for your situation.

webCoRE - Why?

Automations in the basic SmartThings app don't allow multiple actions on the same device.  This limitation makes it impossible to do things like using an IOT plug to automate cycling the power off and on for something like an HP multifunction printer that puts itself permanently to sleep under unknown, random circumstances.  webCoRE adds the ability to do more useful automations.

Installation Overview

Instructions found in various places are based on previous versions of the SmartThings IDE (website), and/or previous versions of the SmartThings (Android) mobile app, so the screenshots and instructions often don't match up to current reality.  Even this article will, without a doubt, become obsolete when Samsung moves things around once again.  In the interest of minimizing that "rot" factor, I'm leaving out details for how to do various steps but including enough key words to search the web and find instructions.

The installation process for webCoRE is supposed to be a few simple steps as follows:

  1. Add the SmartApps to the SmartThings IDE
    • Option 1: Create each of the 4 webCoRE components "from code" and copy/paste the source code into the online editor.
    • Option 2: Integrate SmartThings with GitHub, and install each of the 4 webCoRE components from the ady624 GitHub repository.
  2. Add a named "instance" of webCoRE within the SmartThings app with access to the devices, sensors, etc. that the instance may control.
    • This is where Samsung has made things really obscure and difficult.

Installation "Gotcha's"

SmartThings Classic is Discontinued

  • The user interface in SmartThings Classic made it far clearer and easier to install SmartApps, but it is defunct, and the "new" version of the SmartThings app, at least on Android, tries its best to bury and hide the SmartApps functionality.
  • If your Android device is pre-"Oreo" (pre Android 8.0), this is probably already a source of frustration, since the "New" SmartThings app won't even install/run.  For instance, a Samsung Galaxy-S 5 makes a pretty good smart remote for IOT stuff, but you'd have to go to some trouble to get Android 8.0 or later installed on it.

Steps to install a SmartApp in the "New" version of SmartThings

  • Enable Developer Mode - The option to create a SmartApp won't even show up without doing this first.
    • At the moment, this is done by 
      • opening the settings (gear icon displayed when the "Menu" page/tab is selected).
      • scrolling down to "About SmartThings" and tapping it for 5+ seconds
      • scrolling farther down to see, and toggle on "Developer mode"
  • Dive Into the Menus to find where they hid the SmartApp option
    • At the moment, this is done by
      • switching to the Automations page/tab
      • clicking the "+" icon and choosing "Add routine"
      • switching to the "Discover" page/tab
      • scrolling all the way to the bottom and selecting the main webCoRE SmartApp (not the dashboard, piston, or storage items)
        • Note: These will only appear if they were previously added in the SmartThings IDE

Location

  • webCoRE refuses to install unless the Location is properly set in SmartThings.
  • Location was apparently managed in the Menu-Settings at some point, but currently, it is "hidden" on the "Favorites" page/tab
    • tap the location name (e.g. "Home")
    • select "Manage Locations" (gear icon)
  • Even if a geolocation is set, it may be too broad for webCoRE to be happy with it, so try reducing the radius, if webCoRE refuses to install.

References

* https://community.webcore.co/t/installation-trouble-webcore-your-location-is-not-correctly-setup/20079
* https://community.smartthings.com/t/faq-did-we-lose-the-ability-to-add-custom-smartapps-after-the-app-update-of-june-2021/227734
* https://community.smartthings.com/t/alternatives-to-smartthings-ecosystem-2021/227572/3
* https://www.youtube.com/watch?v=y_ElUwmmI6Y (overview of install with several outdated screenshots and instructions)
* https://www.reddit.com/r/SmartThings/comments/jwqskf/automations_more_than_one_action_for_the_same/

Tuesday, March 22, 2022

Mangled Metaphors and Corrupted Cliché's

This is a selection of entertaining mixed or mangled trite phrases (cliché's) that I remembered or saved along the way.

The Original Set

  • "It's not like I'm taking money out of anyone's mouth."
    • Context: This was stated during a conversation about the ethics of using software without paying for a license, or what Bill Gates likes to over-dramatically call "pirating" it.
    • Contributing Cliché: "taking money out of someone else's pocket"
    • Contributing Cliché: "taking food out of someone else's mouth"
  • "That will be the needle that broke the haystack."
    • This was stated by someone who fumbled nearly everything they tried to say, but still tried to inject a colloquial saying here and there, to try making their point even more ridiculous.
    • Contributing Cliché: "the straw that broke the camel's back"
    • Contributing Cliché: "finding a needle in a haystack"
  • "It's just a blimp on my radar."
    • Said by someone who didn't start life speaking English, so... good try.  I suppose, depending on whether the blimp is made of radar-reflective material, this could be ironic, or it could just be absurd.  Funny either way.
    • Contributing Cliché: "a 'blip' on radar"
  • "I'll let you bury your own hole."
    • Context: This was a feeble attempt to declare intent not to interfere in someone else's conflict.  M.C. Escher probably would have tried to paint a picture of this.
    • Contributing Cliché: "dig yourself deeper into a hole"
    • Contributing Cliché: "bury a bone / body / problem /etc."
  • "If I were you, I wouldn't hedge your bets."
    • Context: Hedging is a somewhat negative notion (betting against yourself), so this was a double negative in a way, but if taken literally, it is at least bad advice.  The application of pronouns is also a little hard to parse.
    • Contributing Cliché: "I would hedge my bets"
  • "If you need me, I'll be out rattling some more trees."
    • Context: Reasonably sure this was intended to mean the person planned to talk to additional contacts about something.
    • Contributing Cliché: "rattling some cages" (perturbing captive animals)
    • Contributing Cliché: "shaking some trees" (attempting to dislodge fruits or nuts growing on the tree)
  • "I don't have a horse in this fight."
    • Context: The person was surely intending to say he didn't have a stake or interest in the outcome of an argument.
    • Contributing Cliché: "have a dog in the fight" (reference to the practice of dog fighting)
    • Contributing Cliché: "have a horse in the race" (reference to a sport in which horses are more commonly used)
  • "We'll cross that bridge when it gets here."
    • Context: From a certain relative-motion perspective, this isn't necessarily an incorrect way to suggest waiting until a decision point is reached to actually make the decision, but...
    • Contributing Cliché: "cross that bridge when we come to it"
  • "It's a great place to flex those wings."
    • Context: Attempt to describing an "practice environment" which is particularly conducive to improving skills and increasing knowledge.
    • Contributing Cliché: "flex your muscles" (demonstrate strength)
    • Contributing Cliché: "spread your wings" (expand upon basic abilities and develop them in a place with fewer constraints / guardrails)

New ones...

  • "Easy Hanging Fruit"
    • Context: Discussion of most beneficial tasks to prioritize based on relative cost/benefit
    • Contributing Cliché: "low hanging fruit"
    • Contributing Cliché: "easy" (as generally used to describe something requiring little effort)
    • Commentary: As mangled, this cliché starts to sound a bit risqué.

Friday, January 7, 2022

Irritating Paypal Website Bug - Quick Security Check

Summary

When setting up Paypal as a method of payment, for instance, from Coinbase, in some circumstances, Paypal will prompt for a "Quick security check."  If there isn't a qualifying phone number already associated with the Paypal account, the prompt will also display "Please add a phone" with a link labeled "Add phone."

Note: What makes a number valid for use in the "Quick security check" doesn't seem to be clearly explained.  Based on (speculative) comments in some related forum discussions, it seems the key is that the name associated with the number in the CNAM (telco) directory database matches the name on the Paypal account.  Google Voice numbers seem to have no such entry, and therefore can't be used for this.  A physical mobile account with one of the major U.S. providers (Verizon, T-Mobile, ATT, etc.) seems to be the only option.

The trouble is caused when the size of the popup box for Paypal verification is not big enough to display the form to enter the phone number.  Clicking "Add phone" appears to do nothing.  To me, this falls somewhere between frustrating and infuriating. 

Note: The instructions here are primarily applicable to Windows 10 with a current/recent version of Google Chrome browser, so other OS's and/or other browsers may work a little differently.

What it Looks Like


Workaround

1. Right click (or whatever the equivalent is in your OS + web browser) the title bar of the popup dialog window and choose "Show as tab"


2. Resize the "tabbed" window to be sure it is wide enough to show the form to the right of the "Add phone" link, where there is another link with a "+" icon beside it, also labeled "Add phone."

Note: This is really where the bug exists.  If the window is sized too small/narrow, the form that actually allows adding a phone just disappears.



3. Finally, click the "+ Add Phone" link to display the text field that allows a phone number to be typed in.  From here, things work as expected


4. 

Monday, December 13, 2021

Airbow Guard Cover - V2 Design Update

Design Update

After several years of making the previous version of this gadget for various people around the world, I was forced to redesign it a little so that I could print the parts on a slightly smaller 3D printer, because the original printer I was using sorta started having too many problems.  After I managed to make a few of the covers on the other printer, I decided to keep working on it a while and update the design with a few changes that I have thought about over the past few years.

Here's the blog post about the previous design: https://whirlysworld.blogspot.com/2018/01/benjamin-airbow-missing-accessory.html  So, I won't repeat any of that stuff here.  Most of what that post says hasn't changed.  This post will just cover the design changes for "Version 2".

Friday, September 10, 2021

Arduino Pro Mini Vin/RAW vs. Vcc vs. FTDI

Goal

Connect an Arduino Pro Mini such that external devices get their power from an external power supply, while the Pro Mini remains connected via FTDI to a USB port on a computer, for programming, and serial-monitor uses.

Challenges

  • Powering the Pro Mini board + external devices totaling more than 200mA exceeds the rating for the on-board voltage regulator (VReg) on Vin/RAW.
  • Powering the Pro Mini board using Vin/RAW (i.e. VReg input > the board's operating voltage / 5v or 3.3v) sends voltage/current back, from the VReg output, through various routes, into the FTDI output pins, and in turn through the USB connector, risking damage to the USB port on a computer used for programming or a serial monitor.
    • Note: Disconnecting the FTDI +5v pin prevents the FTDI from communicating with the Pro Mini, and doesn't block all the backflow paths anyway.
  • Powering the Pro Mini board using its Vcc pin with an externally regulated voltage matching the board's operating voltage, basically attaches to the same "bus" as the output pin of the on-board VReg.  This conflicts with input voltage from the USB/FTDI and may backflow current into the USB port.
    • This might be tolerated, but still isn't an ideal, safe way to hook things up.
  • Logic voltage to control high-power external devices (e.g. motor, LED-array, or loud buzzer) must use the same reference +/- voltage as the board, or HIGH and LOW might make no sense.

Solution

While programming and developing, ONLY connect the GND of the external power supply to the GND of the Arduino Pro Mini, creating a common reference point for the Negative / NEG / "-" / Ground / 0v point, but _NO_ connection or conflict for the Positive / POS / "+" / Vcc.

Later, in order to run the external devices directly from the external power supply, and separately also run the Arduino Pro Mini from the same external power supply, completely remove the FTDI/USB device, and connect the external power supply to the Pro Mini via the appropriate pin, Vcc or Vin/RAW.

Explanation

The reason this works is that the difference in potential (voltage) observed relative to GND is polarized / directional based on which way current flows in the circuit.  If the GND reference point for both the board+USB and the external power supply are tied together, then the relative reference point for current flow, is also common.

Transistors (typically used to allow low-current logic to control a higher current device) trigger (amplify) based on current flow, so it only matters that the signal (base) current flows the same direction as the load (collector/emitter) current.  With the GND for both power sources (USB/FTDI and external) tied together, the current flow direction will match.

Connection Scenarios

  1. Programming / Development / Debugging
    • USB/FTDI Connected - supplies power to Arduino Pro Mini
    • Only Arduino Pro Mini GND pin connected to external power supply GND
      • i.e. Pos NOT connected
    • Pos and Neg from external power supply connected to supply power on external devices
  2. Standalone
    • USB/FTDI NOT connected to Arduino Pro Mini
    • Both Pos and Neg from external power supply connected to Pro Mini Vcc and GND
    • Pos and Neg from external power supply connected to supply power on external devices

Disclaimer:

The terminology used here, and maybe even some of the technical statements might not be expressed in the same terms as are used to explain electronics circuits and concepts elsewhere.  This was just my attempt at explaining things the way it makes sense to me, so that when I forget how this works, I can use this as a reminder.  Hope it helps someone else who is struggling with the same thing while developing with an Arduino Pro Mini.

Some of the discussions about this seem to go nowhere, or end in unresolved debate:
  • https://forum.arduino.cc/t/power-the-pro-mini-through-vin-and-serial-ftdi-chip/317067 
  • https://forum.arduino.cc/t/connecting-5v-vcc-to-an-arduino-pro-mini-or-to-any-arduino/340382
  • https://electronics.stackexchange.com/questions/97184/how-to-power-arduino-pro-mini-via-vcc-pin-12v-input
  • https://forum.arduino.cc/t/powering-pro-mini-and-ftdi-serial-question/252020

Tuesday, February 23, 2021

2010 Subaru Outback - LED Headlight Conversion


 Overview

The Subaru Outback is a really popular car, right?  There are millions of them on the road, right?  Things that are annoying about popular cars get solved with aftermarket products after a while, don't they?  Well, I'm puzzled, because the halogen lowbeam (H7) headlights on a 2010 Subaru Outback burn out WAY too often (every ~10 months in my recent experience), and they are an ENORMOUS pain to swap out.  Yet, there seems to be no reasonable options to install LED headlight bulbs.  I finally had enough, and spent some time designing my own solution.  This post is meant to share what I did, so that maybe someone else will have a bit of a head start on the whole endeavor.

Existing Solutions

SubieLED.com

The LED kits from this company seem to be relatively easy to install, and work with the existing dust cover by including an LED with a wide, low-profile heat sink.  Another option looks like it would require the dust-cover to be left off.  Here's a link to their stuff, in case they get them back in stock, or offer them at a more reasonable price:  http://www.subieled.com/#!/Low-Beam-H7/c/48078355

CarRover Silicone Dust Cover

Using these seemed like it might work with many of the standard H7 bulbs you can get for $30 or $40 from Amazon and various other sources.  I even ordered some but when I got them, and thought about it a little more, I realized they wouldn't really close up the headlight housing since the spring clip would be in the way, and if the wire from the LED module/bulb comes out the back, it somehow has to go back into the headlight housing to connect.  That further disrupts the dust seal allowing moisture or dust to get in, so they're still not ideal.

Others

I'm sure there are other LED "bulbs" or dust-cover options that might sorta work for a 2010 Subaru Outback, and there are quite a few that say they'll work, but I really didn't find any that were meant for my specific application.  If you're reading this and you know of something, please add a comment.

My Solution

I have a 3D printer, and reasonably good 3D design skills, so I decided to tackle this with my own "resources." The process was a little annoying since I also decided I was done paying yet-another-$30 for more halogen bulbs, and one of them had already burned out, so I was a bit reluctant to drive after dark.  Then the other halogen burned out, so I was stuck not using the Subie until I worked out how to get the LEDs installed.

Inverted Dust-Cover

I started with the basic idea of an inverted dust cover that leaves the LED heat sink out where air circulates to cool it, and still seals up the headlight housing.  However, unlike the "one size fits all" silicone dust cover, mine would need to either account for the spring clip, or replace its function by holding the LED H7 in place.  There was also the challenge of routing the wire from the rear of the LED back into the headlight housing to connect with the car's wiring harness.


Rigid Plastic

3D printers can produce flexible objects like silicone, but most of the time they work with rigid materials like PLA or ABS.  With strategic use of a few o-rings, I decided the best way to replace the function of the spring-clip was to make the dust-cover fit precisely into the opening and hold the bulb in place.  Here's a sketch of what that means for those who understand things better visually than verbally.

Pass-Thru for the Wire

The final challenge (or so I thought) was passing the wire through from outside back into the headlight housing.  You can make any shape you want with a 3D printer, so that was just a matter of printing a slot for the wire, and a plug to cover up the slot after the wire was in.  Easy!!  Well, ok, it was one of the more tedious parts of creating the 3D model, but still not a complete roadblock.

Tight Spaces


The actual final challenge was that the inverted dust-cover could not be maneuvered into the headlight housing with the LED already installed.  The "blade" part of the LED just sticks out too far, and the dust cover has to slide around in front of metal cross-member in the body of the car.  The only option is to get the dust-cover in place with the flange part of the LED and then install the LED body.  The risk of dropping the LED flange and/or the o-ring into the bottom of the headlight housing was promising to be a show-stopper.  I REALLY didn't want to add the chore of fishing those things back out of the housing to the already-frustrating ordeal,  But, back to the 3D printer for a solution... all it took was a substitute for the LED body, without anything sticking out, to use during installation.  The downside is that this is where the whole solution really locks into a specific LED product (for now).

More about the Lock-In

As I mentioned in the previous section, this solution is not only specific to a 2010 Outback, but also to a specific LED product.  It's not that this product is necessarily any better than others, but just happens to be the one I settled on.  The main drivers for my choice were, A) fanless design, B) good reviews, C) BeamTech brand generally has good reviews on all products, and D) 30,000 hours lifespan.  So, here are the details.

  • BeamTech H7 - BEAMTECH-CCD17-05-S2-H7
    • At Amazon: https://smile.amazon.com/dp/B071J4SCXY/ref=cm_sw_r_tw_dp_NCWMMWCDBZEWQ9ER9YHP
    • At BeamTechs.com: https://www.beamtechs.com/collections/j1-led-headlight-bulb/products/beamtech-h7-led-headlight-bulb-fanless-csp-y19-chips-8000-lumens-6500k-xenon-white-extremely-bright-conversion-kit
By the way, the headlight housing is the same on some other Subaru models, like the Legacy sedan, and possibly other year models (maybe through 2014).  I'm not 100% sure which ones this might also work on.

Summary


There are a few sub-optimal ways of installing LED headlights in a 2010 Subaru Outback and as a result of the time I spent obsessing over the design and development, there is (now) a more workable, and/or affordable option.  Hope this inspires someone else to tackle this project and eliminates some of the guesswork that I had to stumble through.

I know not everyone has a 3D printer, but if you do, and you want to do this project without working all that out for yourself, you can find the model files to print these exact dust-covers and the installation tool for a small fee here:  https://cults3d.com/en/3d-model/various/2010-subaru-outback-led-headlight-dust-cover

I also occasionally have some idle time on my 3D printer, so if it's not an option to print it for yourself, I can print the parts and put together a kit with the o-rings and screws you'll need (but you buy the LED bulbs yourself).  Based on previous, similar projects, I'll ask $50 to reimburse materials, printer setup time, trip to UPS, packaging materials, etc. + actual shipping cost (probably around +$10 to most places in the U.S. and +$25 international).  Just email me at subaru.ledmod @ liveintellect . org (remove the spaces) to request.  I'll let you know how quick I can get it done, arrange for Paypal or something similar, and go from there.

Saturday, January 23, 2021

Userscript to Automatically Click "Not Now" on the PayPal "Get the App" Nag

I finally had enough of the prompt EVERY TIME I LOG IN to PayPal nagging me to get their stupid mobile app.  Here's the UserScript (tested in TamperMonkey) to detect when that annoying "Get the App" page pops up right after login, and automatically find the "Not Now" link, and automatically click it.  This is what I would do anyway from now on, so the browser might as well do it for me.


// ==UserScript==
// @name         SkipPaypalLoginNag
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Automatically click the "Not now" link on PayPal's aggravating "every time you log in" Nag to get their stupid mobile app
// @author       Super-Annoyed PayPal User
// @require      http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js
// @require      https://gist.github.com/raw/2625891/waitForKeyElements.js
// @match        https://www.paypal.com/cgp/app-download*
// @grant        none
// @run-at       document-idle
// ==/UserScript==

(function() {
    'use strict';
    waitForKeyElements ("[data-name='continue_to_the_website']", clickTheNotNowLink);

    function clickTheNotNowLink() {
        var skipLink = document.querySelector("[data-name='continue_to_the_website']");
        if (skipLink) {
            console.log("Found the link to skip this annoying thing");
            skipLink.click();
        } else {
            console.log("Didn't find the link to skip the annoying thing");
        }
    }
})();