LZW45 LED Strip Set Color Temperature in Hubitat Not Working When Strip is Off

When I use the set color temperature action from the device page with the strip off or when motion lighting tries to turn it on and set color temperature, I get the following error:

[dev:755] 2021-01-17 15:50:39.157 [error] java.lang.NullPointerException: Cannot get property 'level' on null object on line 919 (setColorTemperature)
[dev:755] 2021-01-17 15:50:39.129 [info] MB Closet Light: Bulb is off. Turning on
[dev:755] 2021-01-17 15:50:39.099 [info] MB Closet Light: setColorTemperature(5000)
--- Live Log Started, waiting for events ---

The relevant function in the driver code is below:

909 def setColorTemperature(temp) {
910 	if (infoEnable) log.info "${device.label?device.label:device.name}: setColorTemperature($temp)"
911 	def cmds = []
912 	if (temp < COLOR_TEMP_MIN) temp = COLOR_TEMP_MIN
913 	if (temp > COLOR_TEMP_MAX) temp = COLOR_TEMP_MAX
914 	def warmValue = ((COLOR_TEMP_MAX - temp) / COLOR_TEMP_DIFF * 255) as Integer
915 	def coldValue = 255 - warmValue
916 	cmds << zwave.switchColorV2.switchColorSet(red: 0, green: 0, blue: 0, warmWhite: warmValue, coldWhite: coldValue)
917 	if ((device.currentValue("switch") != "on") && (!colorStaging)) {
918 		if (infoEnable) log.info "${device.label?device.label:device.name}: Bulb is off. Turning on"
919 		cmds << zwave.basicV1.basicSet(value: value.level < 100 ? value.level : 99)
920 	}
921     sendEvent(name: "colorMode", value: "CT", descriptionText: "${device.getDisplayName()} color mode is CT")
922     sendEvent(name: "colorTemperature", value: temp)
923 	commands(cmds)// + "delay 4000" + commands(queryAllColors(), 500)
924 }

I am still having this issue. Having the ability to turn on the strip at different color temperatures based on mode was one of the key reasons why I bought this. I am thinking it is a driver issue? I am using the Inovelli provided driver.

Do you have pre-stage color enabled in the driver? That would cause the light to not turn on despite setting the value.

I do not even see that option in the device page.

Can you make sure you are using the latest driver?

It is still not working correctly with the latest driver.

@EricM_Inovelli - can you take a look at this?

Can you go into the device page and adjust the level with Set Level and turn the device on / off? It seems like level is not being initialized upon inclusion.

Question, did you have the driver installed when you included it or did you add the driver later?

Yes, set level turns it on just fine.

I did have your custom driver installed when I included the device.

What I mean is that if you do a set level then it should initialize the “level” variable which should get rid of the error with the other commands.

I am not sure what you mean. If I send a setlevel command, it turns on and the color temperature setting works. However, that is not how motion lighting in hubitat seems to send commands. So, when I have motion lighting turn on and set color temperature per mode, I get the error every time.

Something else, here is a rule that I have for one of my LZW45s to follow a fan/light switch dimmer with different color temperatures by mode. It works just fine when the set color temperature per mode has a 1 sec delay. When I remove the delay, I get the error again.

I’m trying to make the same rule as you. What is the “Track Dim” action and where can I find it in Rule machine?

If I remember, the same issue occurs with just setting the level instead of tracking dim. “Track Dim” just sets the strip level to the same dim level as the light on my ceiling fan whenever that level changes. It is actually pretty slick. I have the strip behind my desk bouncing off the wall to provide some ambience and light up my face better in online meetings. To get to “Track Dim” select “Set Dimmers and Bulbs,” then “Set dimer level.” A toggle switch that says “Track event dimmer” will appear.

I am having the same issue on my other light strip using the motion lighting app, so it is not specific to Rule Machine. This throws the same error and ends up coming on at whatever the last color temperature was, not the setting.

EH Edit: Changed to tagging Eric M. instead of Eric H.

Changing line 925 in the driver to:

cmds << zwave.basicV1.basicSet(value: 0xFF)

worked great.

1 Like

Thanks you. I have updated the driver in Github.

1 Like