My all-time favorite smart wall switches were the Plum Lightpads.  I loved these things, unfortunately they chose greed over openness, never published a public API, didn't work with any Home Automation providers, and now they're out of business (and I have 10 wall switches that will have to be replaced).  In looking for a replacement, I stumbled upon the IOTTY Smart Home switches.  These were good looking, felt capacitive (they aren't), and had native integrations to Alexa and Google Assistant.  So, I had a discount code and purchased a two-gang and a single-gang switch to see how they worked.  They worked okay!

However, I wanted them to work with Home Assistant.  There is no native integration, as there's no open API for these switches (see above IOTTY).  Since they do work with Alexa, I decided to spend, A LOT of, time seeing if I could get them integrated in a way that allowed the switches to function normally with Alexa, but also allowed me to see their state in HA and control them via HA, and Alexa would know if HA changed the state of the light.

Integrating with Home Assistant

The high-level integration steps are:

  1. Configure your IOTTY with the iotty App so you can control the light in question from that app
  2. Have your IOTTY configured with Alexa (you should be able to tell Alexa to turn on and off the light in question) by following the instructions that came with the IOTTY
  3. Have HA configured to use Alexa (I do this through Nabu Casa) by following the instructions here:
  4. Create some virtual binary_sensors, one for each of your IOTTY switches (so if you have a 2-gang, you'll need two), you'll expose these to Alexa so it knows when to turn things on and off
  5. Create some input_booleans, one for each of your above binary_sensors, these are what you'll actually control using HA
  6. Create a set of Routines in Alexa to control the lights based on the binary_sensors above

Creating the input_boolean

Note:  I'm skipping steps 1 and 2 above, because these need to be done to make the light work at all and if you can't get those steps working, you should be able to get support from IOTTY directly.  Throughout this tutorial I'm going to be automating the Office Hallway light.  I have an Office Hallway light in my IOTTY app and I can toggle it on and off.  I also have an Office Hallway light in my Alexa app under "Lights" and can ask for it to be turned on or off.

The first configuration is to create an input_boolean via the HA UI that will effectively be your "light" to use within HA for controlling the light as well as for automations.

To create an input_boolean:

  1. Access Configuration > Helpers via the Home Assistant UI
  2. Click the Add Helper button in the bottom-right of the screen
  3. Select Toggle
  4. Give it a name like "Office Hallway Iotty"
  5. Give it a lightbulb icon using "mdi:lightbulb" as the icon
  6. Click Create

Filled out, it should look like this:

Once created, I would recommend changing the Entity ID, otherwise there could be some confusion later.  To do that, just click the entity in the Helper list and update the Entity ID.  I name this entity in my HA configuration as input_boolean.alexa_ha_office_hallway, you an also give it an Area here:

Creating the binary_sensor

Next we need to create a binary_sensor template sensor in order for HA to communicate to Alexa when it should turn the Office Hallway on or off.  This is going to look weird, but we're going to create it as a Garage Door, I have this stanza in my binary_sensors.yaml file, if you're doing it in configuration.yaml this should be in your binary_sensor stanza and indented properly:

- platform: template
      friendly_name: "Alexa HA - Office Hallway"                         
      device_class: garage_door
      value_template: "{{ is_state('input_boolean.alexa_ha_office_hallway', 'on') }}"

Looking at this binary_sensor we see that it will be tied to the state of the input_boolean we created earlier.  So, if our input_boolean is turned 'on', this binary_sensor will trip to 'on' as well.

Exposing to Amazon Alexa

Now we need to expose the entities we just created to our Amazon Alexa.  If you are exposing all of your entities to Alexa, you won't have to do this.  If, like me, you don't expose everything, you'll need to update your Alexa conifguration under Configuration > Home Assistant Cloud > Manage Entitites to include the sensors we just created.

Building the Automations in Alexa

Everything is now set up to have Alexa automate our light for us.  You'll need to create two different routines:  one for turning on the light and one for turning off the light. Here is my Turn on office hallway light routine.

To start this process head into your Amazon Alexa app on your mobile device and tap the More button followed by Routines.  Now, to create your Routine:

  1. Tap the + sign in the upper right
  2. Tap Enter routine name and enter something like "Turn on office hallway light"
  3. Tap When this happens and then Smart Home then select your binary_sensor, in this case "Alexa HA - Office Hallway" and then select Open.
  4. Tap Add action, followed by Smart Home, and then Lights and then the light in question, in this case "Office Hallway" (which is your actual IOTTY light) hit Next and then set it to Power On
  5. Tap Add action again, followed by Smart Home, and then All Devices and locate your input_boolean, in this case "Office Hallway Iotty" and set it to Power On
  6. Tap Save in the upper right corner

You should now have a Routine in Alexa that when the binary_sensor triggers to On, it will then turn on the IOTTY light and set the input_boolean to on as well.  It should look just like this:

What's happening here?  

When the binary_sensor, friendly name "Alexa HA - Office Hallway" opens (remember it was a garage door) we'll ask Alexa to do TWO things:

  1. Turn on the Office Hallway light (this is the IOTTY light that Alexa discovered and that HA has no idea exists)
  2. Turn on the Office Hallway Iotty input_boolean we exposed via HA

The magic is really the binary_sensor template sensor.  This sensor is being driven off of the state of the input_boolean.  So, if the input_boolean is 'on', then the binary_sensor will trigger on, if the input_boolean is 'off', then the binary_sensor will trigger off.  Alexa is going to turn our input_boolean on or off depending on what we're asking it to do.  Additionally, if we manually trigger the input_boolean, then the binary_sensor will change state and Alexa's routine will fire.  You need BOTH in order to prevent an automation loop.  If you turn on the input_boolean, it will trigger the binary_sensor to 'on', which will trigger the Alexa Routine to turn on the light AND turn on the input_boolean (but the input_boolean is already 'on' so the loop will stop).

You'll also need to configure a corresponding 'off' Routine in Alexa:

There's nothing special here, it's just the reverse of the 'on' Routine.

Final Thoughts

You should now have an IOTTY switch automated in HA.  This is a horribly clunky way of performing this integration, but it DOES enable you to use in HA any device with native Alexa support, regardless of whether or not it is supported in HA.  Unfortunately, requiring a binary_sensor, an input_boolean, and two Alexa routines to integrate EACH switch you want to use will add up quickly. This is the reason I'm not likely to buy more IOTTY switches in the future and am continuing to look for a replacement to my Plum switches.