Google Home (official) and Sengled Color Bulbs

Seeing super odd behavior on Sengled Element Color Plus bulbs using the native Sengled Element Color Plus (non-legacy) driver.

20ish identical bulbs with confirmed identical settings (e.g. firmware, has room, has color prestaging) that work fine from within Hubitat, when connected to Google Home, a handful of them absolutely will not connect to Google Home (native) app. They appear as an option but when chosen, the ones in question throw errors such as this one:

app:572022-01-02 02:08:56.088 pm warnThe following devices are not supported by Google Home and will be removed from your device list:[Reids Lamp, Playroom Lamp]

When I switch over to using Google Home Community, these same bulbs throw an error of:

app:402022-01-02 02:02:25.054 pm errorjava.lang.NullPointerException: Cannot invoke method multiply() on null object on line 2556 (method handleAction)
app:402022-01-02 02:02:25.025 pm debug{"inputs":[{"intent":"action.devices.QUERY","payload":{"devices":[{"id":"710"}]}}],"requestId":"2678394742959206721"}

In the Google Community app, line 2556 contains:

hue = Math.round(hue * 360 / 100)

and the "hue" variable is defined by

def hue = device.currentValue(deviceTrait.hueAttribute)

The devices that are throwing errors appear to have no value at all for hue. Not zero, just no value.

Setting the hue value to anything fixes the problem permanently.

SO... @bptworld I think there is a tiny bug in the sengled driver in that the hue value is not returned until it is manually set by the user. Although it's super tiny, I see from these forums that a number of other folks have run into this issue and their resolution is usually to create a group with a single device. I suspect this works because a group device doesn't report all of the color bulb capabilities. Possibly return 0 for hue if it is undefined or alternatively initialize the hue variable just once on device initialization?

Happy to do some further debugging if I can be helpful, but since I can't look at native driver code I'm at a bit of an impass and can only hope that the brilliant @bptworld may be able to take a peek and fix in a future release :slight_smile:

I get the impression that you are trying to reach out to the Hubitat staff who authored the Sengled Element Color Plus (non-legacy) driver. If that is the case, you probably want to tag @mike.maxwell. Either he authored it, or otherwise would know who did.

1 Like

HA! lol. Thanks for the compliments (I kinda needed that today :wink:), but I don't work for HE. Just a regular user that likes to mess around with some coding.

2 Likes

Indeed you are correct. For some reason I thought Bryan was the main driver developer.. Clearly I need to read more closely :slight_smile:

2 Likes

so you're saying that when these devices join Hubitat that the value of hue is not populated?
What happens if you hit configure in the driver?, does hue then populate?

I'm afraid I do not have any bulbs left that haven't already been configured, but yes, the hue value is never populated. I never did think about hitting "configure" as I've never been clear what the button did.

when you have a chance if you could post a screen shot of the data section in the driver details for one of the problem bulbs that may be helpful.


1 Like

Any new developments or insights on this topic?

I have 1 E11-N1EA bulb that for some reason a) Hubitat initially recognizes as a Sengled Element Plus, (but it's clearly a color as it cycles through RGB on first power up and reset..), and when I configure it for Element Color Plus, it then works fine with Hubitat.

But if I send it to Google Home as a "Element Color Plus", it's gets rejected. If I revert it back to the element plus driver (no color), it works fine with Google Home.

And the really weird thing is this is the ONLY bulb (of like 6 Sengled color bulbs) that does this..

1 Like

It's been a few months since this post, but I just ran into the same issue while reconfiguring some lights at home. My workaround was to use the Generic Zigbee RGBW driver instead of the Sengled one. The RGBW driver has a leg up on the RGB as it lets you control White tones and RGB separately in the Google Home app.

1 Like