Restoring Attributes to Lights on Motion


#1

1) Give a description of the problem
Lights not restoring properly after motion

2) What is the expected behaviour?
I want my kitchen lights (all Osram Smart+ GU10 RGBW) to restore to the state they were in when motion stopped, when there is motion

3) What is happening/not happening?
I’ve tried a few goes to get them to be properly dynamic, but they’re pretty random. I want each light to come back exactly as it was - so if it was blue come back blue, if it was daylight come back daylight. If it was at 20% come back at 20%, if it wasn’t on then don’t come back on.

I have everything setup so I can reference the lights individually, through a variable that includes them all, or through a simulated bulb that controls them all at the same time.

No matter what I do though, the results are random.

Is there not just a ‘come back exactly as you were’ command somewhere???

Hope someone can help, @bangali perhaps? Your stuff is great.


#2

I am not familiar with those lights specifically, but with many bulbs, we have this dilemma:

  • Changing the RGB color does not mean the colorTemp syncs
  • Changing the colorTemp does not mean the Hue & Saturation syncs
  • Changing the Hue & Saturation does not mean the RGB color syncs

Yes, this is very strange, but I have seen it time and time again. (the blame lies with the bulb’s manufacturer and/or the Device Handler used) The “best” strategy is to use only one of the three methods, and only match and recall that single method. Trying to match all 3 is almost a guarantee failure.

Note: Matching level should always work if coded properly, no matter which path you choose above.


#3

see an example in the first post on how to restore lights here:


#4

Thanks. I’ve set that up to run exactly as suggested for the Restore but on a Device Variable that contains the 10 spotlights I’m interested in. (Each of which might have different levels and colour temps / colours at the time…) I’ll let you know how it goes.


#5

Interesting. Seems to work fine in terms of on / off / level but it restores random colours rather than the colour temp. (I just restored HSL though, so I guess that kind of makes sense.)

The only thing I can think of is to check each bulb’s mode for white or colour prior to save and branch accordingly. Feels really cumbersome though…

Any better ideas?


#6

not a big deal to check each bulb for color or color temp mode on restore using a loop. question is how do you plan to check whether the bulb was in color or color temp mode when saved?