[NEW APP] Room Lighting

Hello,

I want to implement the following setup in Room Lighting

  • On Motion, Turn the lights off to the last light level it was (let's say 45)
  • On Motion End, Turn the lights off , by diming it over 10 seconds (1 sec interval)

I can do this with the 45 being fixed (i.e. dim up all the way to 45) but I cannot figure a way to do it so that it dims up to the previous level

Can someone help?

You could try using "switch" instead of "dimmer" for the device, in the device table (you can change the selection there). Room Lights would then send an on command, instead of attempting to set the level. For most devices, this will cause it to come on to the previous level.

2 Likes

Hi again,

I ve tried many more things and I can give more information here and hopefully we can resolve this.

  • I have set up the automation using 2 different devices that control the same room. A dimmer and a switch as suggested.

image

  • The Switch is activated on ON, and the Dimmer on Off

  • In the Set Up Lighting Periods or Re-Capture Devices I can set the Preset Off to be either Switch off, or Level 0

--- If I set Preset OFF to Switch Off I cannot set a level. In this case, the lights turn off without transition animation

-- If I set Preset Off to Level 0 and Switch ON, the transition down works correctly. But Activating this does not turn the lights on as they are stuck to level 0

image

-- To bypass that without using the Dimmer, I select Create Capture Device.
image

This works, in:
---- Getting the lights to Dim out correctly
---- Getting the lights to Dim up correctly to the level that was set before.
---- BUT it seems to only dim the lights up to the level that was captured the first time I run this

----Example: First time I run this, lights were at level 78%. If I now change the level to 45%, and run Turn Off, lights will dim down. When I Activate it will turn it up to 78% instead of the expected 45%.

image

  • In order for the Transition to off to work I select the option "Use preset setting for Turn Off". Maybe this is wrong but I haven't found another way to do it. Is there one?

That's not what I suggested. My suggestion had only to do with the Devices table in Room Lights. Where is says "Dimmer" in the Type column, change that to "Switch". That's all -- not two devices, no other change. Be sure the Act column is checked.

2 Likes

Some observations on vacancy use cases:

Basic usage A single light controlled (turned off) by a single motion sensor in the same room. Means to turn off is all motions stay inactive (for X minutes).

  1. Choosing 'Don't Activate' as the means to activate will not cause the lights to turn off as the RL app believes the lights are already off.
  2. Choosing 'Don't Activate' as the means to activate along with the option 'Turn Off even if already partially off' the lights will turn off as expected as the RL app doesn't care about the state of the lights.
  3. Choosing the motion sensor as the means to activate and unchecking the 'Act' column for the light will also turn off the light as expected. No 'Turn Off even if already partially off' option required.
  4. Choosing the light switch 'on' to activate and unchecking the 'Act' column for the light will also turn off the light as expected. No 'Turn Off even if already partially off' option required.

More complex use case. Using #4 pattern above as the starting point.
Using the light switch 'on' as a means to activate, add elapsed time after last activation as means to turn off. This covers a somewhat rare case when a light is turned on from outside the space and no motion is ever sensed; the light will still go off.

The issue is that the means to turn off ('all motions stay inactive' and 'elapsed time') are OR triggers. If the motion sensor activates and never deactivates the elapsed time event will turn off the lights. The issue becomes more likely when used with multiple sensors that are not in the same room and are only used to keep lights on (not to activate).

To get what I want I need to get the motion and elapsed time evaluated as AND triggers. In the same way that 'all motions stay inactive' means to turn off works. The way I figured is to use a virtual timer device that has motion sensor capabilities. To activate the timer, I add the timer device to the devices being controlled and include it in the 'Act' column.

There are no out of the box virtual drivers that have all the required capabilities, user or built-in. Any of the built in drivers with auto-off are limited to short pick lists of time options and none are switch/motion combos. The one user contributed driver I found that comes closest is from @armand. It allows for an arbitrary time, but doesn't have motion capabilities. A simple addition of 3 lines of code fixes that.

Summary: this last use case is rare enough that I don't think that I would ask for 'means to turn off' be made any more complex*. At the same time, timers can be useful in this and other cases, so it might be useful to have a system virtual timer driver that is similar to the user driver.

* Maybe an exception: add 'All switches turn off' (and on) options (a general consideration, not related to vacancy).

Again thank you for your help :slight_smile:

I am probably missing something obvious here but I can't find how to set it up as a dimmer, without having a level to which to dim to when turning on

How can I set the Turn on without the 48 in the image above?

In the “Type” column in you screenshot, it says “Dimmer” for your living room switch. Just click on the word “Dimmer” and then change it to “Switch”.

Thanks Mattias,

That part I do know and have tried

The challenge here is that when it's turned to switch, there are issues with Transitions (all Scenarios here [NEW APP] Room Lighting - #835 by argyrou )

I think Room Lighting already covers that by the "Don't Turn Off if Stays Pending" option. Try this:

That is, if the lamp turns on and no motion ever occurred, the timer turns it off after 10 minutes. If motion occurs, that's a new activation event and resets the 10 minute timer. If motion ceases, the 10 minute timer is ignored because there's now a stay pending for the motion sensor.

So hypothetically, the only thing that leaves this on is the motion sensor sending an "active" message and never sending any further readings at all. Presumably continued activity will continue to send "active" messages, retriggering the lights and resetting the timer.

1 Like

You are right! I had actually used it in another RL app that I had forgotten about.

But there is an issue to be aware of. Stays pending may not be sufficient to achieve the desired behavior.

That is true only if the RL app includes a 'Motion Active' restriction that includes the motion sensor. The 'Stays pending' restriction timer only activates after the motion sensor sends an inactive message. If the motion sensor does not send inactive in the elapsed time timeframe, then the light will go off after the elapsed time setting (assuming that the motion sensor was the last activation event).

Any active messages will re-trigger the elapsed time timer. But I think some sensors will send active messages only if coming from an inactive state. Inactive messages trigger the stays pending timer.

I'm trying to avoid someone turning lights off at the switch, walking out of the room, and having the lights triggered again by the motion. I've crafted Button Rules around the Room Lighting activator to handle this, but it might be nice to consider building it in.

We already have "Don't Activate if Turned Off manually" and an option to reset that state on mode change. Currently, I have the Button Rule turn off the Activator, pause the RM instance, then re-enable RM two minutes later. This also means any Button Rule that turns on the Activator also needs to un-pause the RM instance first.

It might be worth adding an option to reset "Don't Activate if Turned Off manually" with a timeout as well as a mode change.

(I presume that explicit use of the Activator already bypasses this option, though I haven't tested it. I also wonder whether button presses count as "manually" for this restriction.)

Depends on how you set it up in the app. You can have a button press disable activation if you want.

If the button itself is not in the app but the switch it controls is then when the switch state flips outside of the app that's where the "if manually turned X" comes in.

I also have a feeling there is a elapse timer in the app, not sure where though as I haven't used it yet.

This should be simple and it's driving me insane.

Open door (contact) and turn on a switch. That switch is setup in simple automation to turn on/off 4 other devices. Turn off if there's no motion for xx minutes, door contact closed for xx minutes, or if the switch is manually turned off.

I have it mostly working but now it's turning the switch on an hour after it's turned off by the Room lighting automation. There is no "lighting periods" set. WTH?

I doubt, I bet if you look in the device then the events for that device it will be being turned on via another app.

The reason I say that is because the logs only show the switch being turned on and no reason why. Which means from another source.

You can look at the Events page of the switch and it should tell you what app/rule (if any) turned it back on.

There is no other app turning on the switch.

App 1519 triggered and turned it on. 1519 is the Room Lighting app.

image

I dug a little more and the hub thinks the "basement Light" switch was physically pressed. The log is only showing the one other switch because text logging was disabled on all the others. I was also getting a "paired/follow" switch/light rule in another room that was flapping so I restarted the hub and also pushed the very latest FW to the offending switch. Seems to be OK this morning.

However, I still don't trust this basement light (Zen26) switch as it's been acting flakey/bouncing on command so I'm just going to replace it. Just another Zooz switch down for the count.

I found the problem with the switch turning on. Zooz's infinite wisdom sets the auto off/on default to 1 hour in the latest firmware using the built in Hubitat Zooz central scene drivers.

ETA: It appears the issue with the populated default on/off are Hubitat's built in drivers. The custom drivers are set to disabled.

Got a weird issue here not sure if it is room lighting or if the lightstrip is deciding to turn itself off and on at it's leisure. Rule is set up to turn it on at sunset and turn it off at sunrise. However in the logs it is randomly turning off and back on multiple times through the day although the times don't seem random they are usually similar.

Problem is that it seems to result in the light being on (or thinking it is on) but not actually being on. If I go into my dashboard it says it is on but there is no light. If I turn it off then on again or adjust the brightness then it comes on.

So simple question is it the lightstrip or room lighting?

It is a Sengled Smart LED Multicolor Light Strip

Settings

Log

From the logs you posted, most of those events have nothing to do with the RL app at all. All of the ones after 11:45 are caused by something else, as are the ones at 8:59. You might take a look at the device page for the light strip, at the bottom under In Use By, and see if any other app might be turning it on/off.

Only exposed to google home community but log shows something. Not really sure what it means I don't have it in any routines but I will try remove it from GHC and see if it fixes the behavior.

Log

Edit: Yeah pretty sure device is just randomly triggering itself as still happening after disconnect from GHC. Sorry for false alarm.