Best practice for naming and controlling smart plugs

I’m trying to come up with a logically consistent method for naming and configuring smart plugs to operate lights, and am looking for some recommendations. I am using multiple types of smart plugs (Z-wave, Zigbee, and Wifi), some plugs with multiple independently controlled outlets, and I also have integration with Alexa. I would prefer that Alexa pick up the appropriate name & device type without having to go into the Alexa app after device discovery to rename or re-classify as a light. I also hate having different methods of doing something, and would like to pick something consistent for all scenarios. This way I don’t have to remember to configure something different ways if the plug is operating a fan vs a light, or is a dual vs single plug, etc.

I’m looking for feedback on my current method, option 4. You can jump right to it, but if you want to see the other options I used to eventually get there I’m including them for additional background.

Option 1:
Rename the device and all associated entities to the current function, e.g. “Front Christmas Lights”. Can change the icons also.
Downside: The largest downside is that this method doesn’t make sense for multiple-outlet plugs, e.g. a plug that has an outlet for my bedside light and another for my wife’s bedside light. The entities will also be switches instead of lights.

Option 2:
Keep the device name specific to the plug (e.g. “Kasa Smart Plug HS103 #1”) and have most entities start with that name, but rename the control entities to their specific functions (e.g. “Front Christmas Lights”).
Downside: Entities will still be switches as opposed to lights. In automations that reference devices, need to remember what the plug name is first, and can then select the action associated with the named entity.

Option 3:
Keep device name associated with the plug itself, e.g. “Kasa Smart Plug HS103 #1” and have all entities (including control entities) start with that name. But within configuration.yaml, set the switch entity as a light using the light switch platform (see option 4 for the link)
Downside: HA will now have both a switch entity and a light entity and the switch entity will get pulled into Alexa unless filtered out. For automations, the service “light.turn_on” has to be used instead of making an action on a device. So I would have some lighting automations which trigger devices (like my in-wall dimmer switches) and other lighting automations which trigger service calls. The other downside is when a plug is used for something besides a light (like controlling a fan), this isn’t even an option. So would have to revert to option 2 for these scenarios.

Option 4, my current method:

  • Keep device name associated with the plug itself, e.g. “Kasa Smart Plug HS103 #1” and have all entities (including control entities) start with that name. Always use “smart plug” in the device name.
  • Whatever is being controlled by the plug, configure it inside configuration.yaml:
    • When lights are controlled: Create a new light entity based on the plug’s switch entity (light switch platform).
    • When non-lights are controlled: Create a new switch entity based on the plug’s switch entity (switch template).
  • For automations, always use the service call to turn on/off all switches and lights, no matter if they are in-wall switches or smart plugs.
  • For Alexa, filter out switches using blobs so anything containing “Smart Plug” is excluded

I tend to over-complicate things so feel free to point me to a better method.

1 Like

All my outlets (except a few Peanuts) are hardwired GE Zwave or Zigbees. So they are permanent installations and I wanted the entities to reflect it. I always start in a room form the NW corner with outlet 1 and count up with each box as I go around the room clockwise. Multi gang outlets are a/b/c left to right as appropriate. [room - outlet XXX]

Then for actual STUFF - I use option3 - I don’t move things around in outlets enough to worry about your ‘if other things are plugged in…’ scenario. I don’t filter the outlets from Alexa - but I also add them to a ‘misc’ group I have in the Alexa interface so they won’t respond to room on/off commands but I can voice control one on or off individually as appropriate without remembering my wife called that the ‘fan plug’

Thanks for the feedback. So you have the outlets and their entities all named “room - outlet xxx”, but when a fan is (permanently) plugged into one, what are you doing so that your wife can refer to it as the fan plug in Alexa?

She has her own Alexa account attached to the family. We ha e trained the voices on both accounts so it recognizes her automatically on any of our alexas. So that also means she (rather, husband logon and do that for me) can rename the device in Alexa on her account and itll recognize ot however we name it. So we could login to her account and call it fan outlet and boom whenever she refers to the Fan Outlet l, Alexa turns om thw switch because it understands thats the entity behind it.

Basically for me, voice aliases are the domain of my chosen voice recognition provider. HA is authoritative for my device. I make Alexa bend to HA, not the other way around. That means that customization for one user is done in her voice account.

Wow, I didn’t even know that was possible! Just to be clear, once she (i.e. you) renames the device in her own account, the following happens:

  • she can refer to the “fan plug” on any Alexa attached to the family, regardless of the actual account that the Alexa is signed in to
  • you can refer to the “bedroom plug 5b” on that same Alexa and it will turn on the same entity

And just for curiosity, what happens if you ask Alexa to turn on the “fan plug”? Does Alexa say she can’t find a device by that name?

Correct on all three. But… I really don’t actually care what that plug does. Its on an automation that follows the thermostat… :wink:

Learned all this when I was on SmartThings and they hamhanded the ‘new’ Alexa skill two years ago. (SmartThings users cant filter devices from Amazon they can only disable them or rename them on the Amazon side. It creates some ‘interesting’ workarounds. )

Its a great capability, unfortunately its just complex to actually get it setup…

I just came over from Smartthings a few weeks ago (which reminds me I need to go unplug my hub now that everything has been transferred over). So I know firsthand about the issues & workarounds there :slight_smile:

Thanks for the information you’ve provided, this have been very insightful!

1 Like