How does Hubitat determine device type that is sent to Alexa?

I have two devices, one named "Bath Fan" and one named "Bath Light". Both are the same model (GE 12722) and both are setup as device type Generic Z-Wave Switch. When these two devices get discovered by the Alexa skill, "Bath Light" is discovered as as type "Light" while "Bath Fan" gets discovered as type "Switch". But I need both to be discovered as a switch, not a light, because they will be part of an Alexa-enabled group, and I don't want either one turned on when I say "Alexa, turn on lights". In the Alexa app, I cannot change devices discovered as "Light" to "Switch", but vice-versa does work. So I have two questions: 1) how is the Hubitat Alexa skill determining which devices become lights and which become switches? 2) is there a way to set the type manually in Hubitat rather than having the skill determine it, i.e. override the skill? Thanks for any assistance ...

Just a wild guess but maybe the Alexa skills chooses "Light" as the type because the name/spoken has "Light" in the name?

1 Like

Can't you just go in Alexa and change the type of the device?

I know you can't on Google, but I thought you could on Alexa...

If the original device type is Light it can't be changed. Using Alexa app version 2.2.307017 on iOS.

I noticed the same thing. So I tried changing the name of something, adding light and the app picked it up as a light. I'm thinking this is something new as don't remember it happening before.

I'm pretty sure this is just a function of the driver Hubitat uses and the functionality the driver supports. Anything with a setLevel command (the Switch Level capability) is probably discovered as a light. Anything with only on/off (the Switch capability) is probably just discovered as a switch. I know you can't control that from the Hubitat side as-is, and I'm not sure Alexa lets you change it.

Here's a workaround you could do: create a virtual switch tied to the light, then expose only that switch to Alexa. (I've noticed that it can ignore things in parentheses if that helps you name it in a way that helps you have logical names in both Hubitat and Alexa.) Then use a rule or an app like Switch Bindings to mirror the switch states from real to virtual and vice versa. Could that work for you? (You'd lose the ability to dim by voice.)

I imagine something like that is happening, because when I look at all my devices that get discovered as Lights, the word "light" is in there somewhere. Still, I would prefer that a device gets discovered as a switch if it is actually a switch, then I can change the type in the Alexa app to suit my needs.

I just tested with my 'Kitchen Light" which is a z-wave switch. I removed 'Light' from the device name in Hubitat, had Alexa discover devices, and it changed to "switch in the Alexa app.

2 Likes

Both of those devices I mentioned are defined as switches in Hubitat (same driver) yet one shows up as a light in Alexa and the other as a switch. There's something else going on here, as others have mentioned it looks like a device name including "light" becomes device type "light" in Alexa although it is actually a switch (and I would prefer it remain that). I don't really want to get into creating virtual devices as a work around, but thanks for the idea.

A related problem/question ... I'm finding that some of my Hubitat switches, which were originally named "xxx Light" but have been renamed to just "xxx" are being discovered by Alexa as switches (good), but are being treated by Alexa as if they were lights (not so good).

For example, say I have an Alexa-enabled group named "Den". In the group, I have 2 lights "Den Light 1" and "Den Light 2" and 1 switch "Den Switch". When I look at the device type in the Alexa app, "Den Switch" is type "Switch". Yet when I use the Alexa-enabled group command "turn on lights", the switch is also turned on. "Turn on lights" should only control those devices which are defined as "lights" in an Alexa-enabled group.

It sounds like a problem with Alexa, so I started a support ticket with Amazon. Just wondering if anyone else has experienced this.

Related Question.. Just installed 50+ Lutron Caseta Switches/Fan-Controllers/Dimmers and a Smart Bridge Pro.. Next added the Hubitat using the dialogue box and entered the "device-type, id, device-name".. Assigned each device to a room within Hubitat.. Finally integrated Google-Home linking it to Hubitat to which all of the devices are correct except the fans.. Home says data was provided by Hubitat.. When I link Home to Lutron this is not a problem (yeah now have 2 of each device).. I would prefer Lutron hub to only perform the actual task of turn on/off/dim based on commands solely received via the Hubitat and no user-interface to the Lutron.. As I have read here manually changing the device-type on Google-Home is impossible, it must be derived from the source being Lutron or Hubitat.. What am I doing wrong..?

Upon further investigation this problem definitely is Hubitat related as Google Home clearly states that the data was passed to it from Hubitat.. Cannot modify Home device type within the Home app.. Both Lutron & Hubitat state device-type is "fan" and again when Home is linked to Lutron the device-type is passed to Home correctly and an individual icon showing a fan is created.. With Hubitat to Home the device is grouped in with the lights.. I have 10 fans (ceiling paddle and bath exhaust) that for my purposes cannot be linked into the light group.. I do not know whether Alexa exhibits the same problem..

I had alot of problems with this when I converted some Tuya lights strips to Tasmota.

What I found was the capabilities in the driver decided what Alexa allowed and how it was treated in Alexa as either a Light a Switch or a plug.

By playing with different capabilities in the driver I came to the conclusion below:-

Switch only capability show as a switch in Alexa, which is controlled as a light when all lights are asked to be turned off in a group.
Switch and Light shows it a switch in Alexa which controls as a light.
Outlet and Switch shows as a Plug in Alexa which is not controlled as light, but can be switched to be a light, within Alexa App.
Outlet,Switch and Light makes Alexa control it as a light (Forgot to check what Alexa type it made it)

So if you want a Driver with Alexa control as a light use Switch and Light, if you want a Power Outlet/Plug you need to use Outlet and Switch.

1 Like

@plumsden Based on my experience, your conclusions are right. How are you changing the capabilities in the driver? This has become a headache for me, because I want the switches to be in that Alexa group but not recognized as lights. I really don't understand the purpose of forcing a switch to be controlled as a light by default - that can be changed manually in Alexa if I want that option.

I am using a user driver, so I could manually go in and edit the driver to try different capability combinations, then see what happened. Would not be able to do that with built in driver.

As an update on this topic ... I am finding more and more devices that are being incorrectly discovered as lights in Alexa. This essentially breaks most of my Alexa-enabled groups. For example, I just added a GE plug-in outlet (ZB4101) in the foyer that controls an air purifier. This device gets discovered as a light, not a plug. When I add it to my Alexa-enabled group “Foyer”, it now thinks the device is a light, so when I ask Alexa to “turn on the lights”, it also turns on the purifier.
Based on everyone’s feedback, I agree that the device type is probably being defined by a single device capability rather than how it’s being used. I’ll send this to Hubitat support.

Any one have any additional thoughts/suggestions here?

I have a few devices and virtual devices (more important to me) that show up as "other" which won't let me do anything with in Alexa and I'd like them to become "switches".

Seems like Alexa doesn't let you override device types anymore in the Alex app (not sure you actually could before). trying to figure out how to do this from the HE side.

It seems that it is primarily based on device capabilities. The driver generally needs to use capability switch and implement the on() and off() method to be used as a switch.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.