Lzw42 - Way to tell when switch to bulb is off

Is there a way to tell when the bulb itself has no power? I would like to enable it such that when someone switches the bulb off then on using the switch on the wall (aka cutting power to the bulb itself), then the bulb always comes on at a specific setting. Not just “remember last state” but actually come on at a specific state. In otherwords, if power goes out and comes back on, the bulb should be on at full brightness with white.

I know power shouldnt be cut off to the bulb, but there is a switch there. 95% of the time the bulb behaves via automations. However sometimes if a state fails to report, or a zwave packet is “lost” then the bulb is stuck on a color when a ‘user’ wishes to see properly as they would with a typical bulb. Thus they use the wall switch to turn it off and on. this doesnt do anything but turn the bulb off and back on in its previous state. I would like to actually set a default state of the bulb such that when that happens it just turns on like a normal bulb.

That might require a hub specific answer. With SmartThings for example, you can tell if a device is off via the app, but how quickly that gets reported can vary. I don’t think there is a way to trap the event so that you can code an action to it. Obviously, the bulb itself can’t report that it has no power, so you have to find a workaround.

I looked at the parameters and it doesn’t appear from those published that there is a default parameter setting, just “Last State” or “Last State On or Off”, which isn’t what you want.

One thing I would explore would be to see what attributes (i.e. brightness level and color temperature) are exposed to whatever rule engine you’re using. I would run a rule that watches for the bulb to come back on and then set the color temperature and brightness levels. The bulb will probably come back on at the old settings but should pretty quickly get reset properly.

I don’t have any LZW42s, so I can’t see what’s exposed, but you should be able to discern it pretty quickly while building a rule.

Now this is an interesting idea. While the bulb cant report power loss since it has no power, it could report power on; though, unfortunately, i dont think it does. However, I will spend some time snooping whether it does or not.

Even if the bulb itself doesn’t report, the hub polling should cover it. Either way you are trapping the “on” event. A quick test to see how fast the reaction will be would be to watch the device’s status on the hub while you turn the light on. How quickly does the status change from off to on?

Yep, was already on it. monitoring mqtt i see the message come in essentially immediately:
{“time”:1629922631325,“value”:99,“nodeName”:"",“nodeLocation”:""}

However, this same message also comes in anytime the status is changed. So I cant use it to trigger or any time a change to the bulb is made it would be triggered, rendering it useless. bummer.