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.
Thanks!