[NEW APP] Room Lighting

OK. I see that. Let's assume there's only this one device in a RL app, and it's set up like my ceiling light... on during day with motion, off during evening/asleep. Is there a way to override that single device so that if I manually turn it on in the evening, it stays on until I manually turn it off?

Yes this is what I do. You can have a hub variable used to limit or disable turning off.

Then in RM when the trigger switch is controlled you turn on the light and set the HV to true. Then have a wait for event off then set the HV to false and set the variable to false if you flip the switch the other way.

Thanks. I use to have this set up in RM and I know how to do it there.

I'm specifically asking if it can be done in Room Lighting without help from Rule Machine.

@bravenel thanks again for your patience, Bruce. I think I've figured out a way to do what I'm trying to do.

If I set RL up like this for Evening:

The ceiling lights are not turned off if I turn them on via the switch. But they are turned off, along with the side lamps, when motion stops. So that will work for my "I need more light" use case.

It also means that the ceiling lights will not turn off when the mode changes, and that's a little annoying. But I can add that into my mode change rules in RM so that use case can be handled also.

It's not ideal but it's going to work, I think, and I'm good with that.

Thanks again.

2 Likes

Room lighting is really awesome but I think I found something that doesn't make sense. I have modes defined for one room (day and evening) and preset-off (but I didn't have modes specified for the preset-off which may be the issue)

Mostly this is to stop my cats activating the lights all night (during night mode). At 2am, the motion sensor was activated and the app correctly noticed there was no mode so it didn't turn on the lights, but then when the motion sensor stopped, it set the lights to the preset-off. Unfortunately, 30 seconds later (for my delayed off) it didn't turn the lights off because the mode was wrong.

I think if I define preset-off per mode this might fix it but I feel that it should check for the mode on all 3 operations (on, preset off and off) and maybe that check isn't in the code path for preset off?

2022-11-12 02:15:34.755 AM info Office Lights not Active
2022-11-12 02:01:04.906 AM info Office Lights not Active
2022-11-12 02:01:01.769 AM info Grace period before off: 30 seconds
2022-11-12 02:01:01.752 AM info setLevel: Office Tripod Lamp, level: 50
2022-11-12 02:01:01.714 AM info setLevel: Office Ceiling Lights, level: 10
2022-11-12 02:01:01.636 AM info Activating Preset Off
2022-11-12 02:01:01.623 AM info Turn Off Event: 'Office Presence Sensor' motion inactive
2022-11-12 02:00:32.295 AM info Activation prevented due to wrong mode
2022-11-12 02:00:32.294 AM info Activation Event: 'Office Presence Sensor' motion active
1 Like

A screenshot of the RL setup will likely help...

But to expand on your post, am I right in thinking you don't want an activation during a disabled period to produce an "off" event when the RL setup is enabled....?

During a disabled period I do not want to to activate the preset-off which it is doing currently. It makes no sense for it to activate that preset during a disabled period since it never turned the lights on to begin with because that was a disabled period :slight_smile:

I have been... grappling... with this lately myself.... But I would say it eventually makes sense and is a logical setup....

So.... I would suggest showing a screenshot of your RL app in a disabled period. Admittedly you are likely to need to produce this outside of the normal automations.... But ultimately it will likely tell the story of where the issue is.... Wow... That sounded more complicated than in needed to be....

If you can provide us with a screenshot of the App when the issue occurs, it will make things easier.... :slight_smile:

1 Like

Do you by any chance have the "Turn off even if already partially off" turned on under "Turn Off Lights Options"? If that is on, that will turn off the lights even though they are already off and that will cause your preset-off to activate.
image

1 Like

I have the turn off if already partially off enabled as shown above however I just tried disabling that and it appeared to make no difference. I can work around it by using the pre-set per mode option it seems because then it can't set the preset lights because it doesn't have a preset-off for that mode which solves my problem :slight_smile:

Here is the log from when I turn that option off showing it set the lights to the preset, then wouldn't turn them off. Notice the last (top) line happens after the 30 second delay that seems to be wanting to turn them off but realizes the mode is wrong. It seems to me the same logic should be in the part of the code that activates the preset-off which doesn't seem to check that the lights are not in active mode right now.

2022-11-12 11:05:37.731 PM [info] Office Lights not Active
2022-11-12 11:05:34.029 PM [info] Grace period before off: 30 seconds
2022-11-12 11:05:33.975 PM [info] setLevel: Office Tripod Lamp 💡, level: 50
2022-11-12 11:05:33.852 PM [info] setLevel: Office Ceiling Lights, level: 10
2022-11-12 11:05:33.763 PM [info] Activating Preset Off
2022-11-12 11:05:33.756 PM [info] Turn Off Event: 'Office Lights (Active)'
2022-11-12 11:05:29.196 PM [info] Activating for Night
2022-11-12 11:05:29.189 PM [info] Activate from 'Office Lights'

If I change to using preset per mode, then the log is different, it doesn't manage to turn on any lights (which is good since there isn't a preset for night and this is my workaround)

2022-11-12 11:13:22.431 PM [info] Grace period before off: 30 seconds
2022-11-12 11:13:22.401 PM [info] Activating Preset Off for Night
2022-11-12 11:13:22.394 PM [info] Turn Off Event: 'Office Lights (Active)'
2022-11-12 11:13:19.583 PM [info] Activating for Night
2022-11-12 11:13:19.577 PM [info] Activate from 'Office Lights'

In reproducing this, I don't see it failing. When I try this, if it's in the wrong mode, it won't Activate the lights, and it won't Turn them off from motion inactive, so it doesn't set the Preset Off or run the Grace Period. First mystery is why yours went to turn them off from motion inactive, and one possibility for that is that the app was still Active (even with the lights off). If you're using the same Preset Off for every mode for which it is Activated, you don't need Preset Off Per Mode.

BTW, when you are posting logs, use screenshots, not copy/paste.

In the first set of logs, you show the Grace Period starting at 11:05:34, and the next log entry is 3 seconds later. It's not clear that has to do with the Grace Period, whose 30 seconds haven't run yet at that point. In both logs, we don't know what happened (if anything) 30 seconds later. Hard to show something that doesn't happen, I know. But it leaves a bit of an unknown here.

To figure out what is going on you have to quit trying different things, and stick to just one. You can force these events by manipulating modes manually. You can also force motion events by creating and adding a virtual motion sensor that you can set to active or inactive.

I'm going to add more logging to the app for Grace Period, so it logs when it's over (even if for whatever reason it doesn't actually turn off the lights then).

I set up a test environment and you were right, if the option "Turn off even if partially off" is selected ON then it behaves as I saw with the preset. If I turn that off, then it does as you describe and everything is as expected.

Test 1 (with option selected)

Test 2 (with option not selected)


What's the easiest way to not have my garage lights turn off if my consumption meter is above a certain power level (plug connected to workout bike). I'm trying to add something underneath "Limit turning off under these conditions". Now that summer is over my garage door is usually closed while I workout hence that alone can't be used as a limiter.

Is a simple motion sensor too primitive?

I'd setup a rule in RM or similar app to toggle a switch while the power is elevated, then use the switch in Room Lighting

I am having multiple issues with a group that previously worked . Once I swapped out the bulbs from Wiz to Sengled it became unresponsive to commands.

I'm having issues controlling the group with BC and the actual device page for the group. I can activate and Turn OFF the group using RL. I posted it in another thread, but I believe this is more a RL/BC issue. In the groups device page, it shows the status that it's ON or OFF and also in RL it shows that the bulbs are ON in the capture table. Even in the events logs, it shows the commands were sent. But physically they never switched on or off. Here's a screenshot of my RL setup for the group.

Summary

Also, another strange bug is while I was messing around wit the RL group, I decided to see if I can add button push as an activation method along side the activator device. Accidentally I clicked add button 3x on my wife's button and now the additional button options aren't removeable. Just spins when I click remove. Made a quick GIF of the issue in action. Can't remove buttons

Known bug, fixed in next release.

As for your bulbs that aren't turning on as they should, you have to go to basic troubleshooting. If the logs show the devices being commanded, then the problem isn't with the app, but with the devices. Try commanding them from their device page.

That's the issue, they group device page is showing the command is being sent, it's showing the group is ON, and so does RL when I select to turn it on from the groups device page. However, they're physically not turning on or off. I can even activate the bulbs using the Activate button in the group's RL and it will physically work.

However, they work fine when controlling the bulbs individually with BC, outside of the group. Even when I go to each individual bulbs device page and control them they work fine.

Summary

Bedroom Fan Light GroupBuilt In App

Settings

Name Type Value

activator capability Bedroom Fan Group
alexaName text Bedroom Fan Group
atSunriseOffsetSunrise-7pm.1 number -20
atTime7pm-9pm.1 time 7:00 PM
atTime9pm-Sunrise.1 time 9:00 PM
butAct.1.110 enum doubleTapped
butAct.1.187 enum pushed
butAct.2.187 enum pushed
butAct.3.187 enum pushed
butActOff.1.110 enum pushed
butActOff.1.187 enum pushed
butActOff.2.110 enum pushed
butNo.1.110 enum ["1"]
butNo.1.187 enum ["1"]
butNo.2.187 enum ["1"]
butNo.3.187 enum ["1"]
butNoOff.1.110 enum ["1"]
butNoOff.1.187 enum ["1"]
butNoOff.2.110 enum ["1"]
ctLUseVar bool false
dimLAUseVar bool false
indicator enum groupAny
logging bool true
modes enum ["1.1","2.1","3.1"]
onMeans enum ["button is pressed"]
origLabel text Bedroom Fan Light Group
otherOnOpts enum ["doTurnOn","overRide","isGroup"]
roomDevs enum ["274","275","276","277"]
roomDevsL capability [ Bedroom Fan Bulb 01, Bedroom Fan Bulb 02, Bedroom Fan Bulb 03, Bedroom Fan Bulb 04 ]
schedTypeL enum Time Periods
time10pm-Sunrise.1 enum A specific time
time7pm-10pm.1 enum A specific time
time7pm-9pm.1 enum A specific time
time9pm-Sunrise.1 enum A specific time
timeSunrise-7pm.1 enum Sunrise
useModes bool false
Event Subscriptions

Source Event Handler Filter

Bedroom Fan Bulb 01 switch evtHandler true
Bedroom Fan Bulb 01 colorMode checkSceneEvt true
Bedroom Fan Bulb 01 colorTemperature checkSceneEvt true
Bedroom Fan Bulb 01 level checkSceneEvt true
Bedroom Fan Bulb 02 switch evtHandler true
Bedroom Fan Bulb 02 colorMode checkSceneEvt true
Bedroom Fan Bulb 02 colorTemperature checkSceneEvt true
Bedroom Fan Bulb 02 level checkSceneEvt true
Bedroom Fan Bulb 03 switch evtHandler true
Bedroom Fan Bulb 03 colorMode checkSceneEvt true
Bedroom Fan Bulb 03 colorTemperature checkSceneEvt true
Bedroom Fan Bulb 03 level checkSceneEvt true
Bedroom Fan Bulb 04 switch evtHandler true
Bedroom Fan Bulb 04 colorMode checkSceneEvt true
Bedroom Fan Bulb 04 colorTemperature checkSceneEvt true
Bedroom Fan Bulb 04 level checkSceneEvt true
Application State

Name Type Value

active Boolean false
alexaName String Bedroom Fan Group
allVarsB ArrayList []
allVarsI ArrayList []
allVarsT ArrayList []
appLabel String Bedroom Fan Light Group
appNamePause String Bedroom Fan Light Group (Paused)
butActNdx110 Integer 1
butActNdx187 Integer 3
butActNdxOff110 Integer 2
butActNdxOff187 Integer 1
butActs110 ArrayList [1]
butActs187 ArrayList [1, 2, 3]
butActsOff110 ArrayList []
butActsOff187 ArrayList []
buttonTable HashMap {}
capDevs1.1 HashMap {275={doOff=true, doAct=true, isSet=false, swVal=on, dimVal=100, CM=CT, useVarD=false, useVarT=false, force=true, tempVal=3100}, 276={doOff=true, doAct=true, isSet=false, swVal=on, dimVal=100, CM=CT, useVarD=false, useVarT=false, force=true, tempVal=3100}, 277={doOff=true, doAct=true, isSet=false, swVal=on, dimVal=100, CM=CT, useVarD=false, useVarT=false, force=true, tempVal=3100}, 274={doOff=true, doAct=true, isSet=false, swVal=on, dimVal=100, CM=CT, useVarD=false, useVarT=false, force=true, tempVal=3100}}
capDevs2.1 HashMap {275={doOff=true, doAct=true, isSet=false, swVal=on, dimVal=75, CM=CT, useVarD=false, useVarT=false, force=true, tempVal=2900}, 276={doOff=true, doAct=true, isSet=false, swVal=on, dimVal=75, CM=CT, useVarD=false, useVarT=false, force=true, tempVal=2900}, 277={doOff=true, doAct=true, isSet=false, swVal=on, dimVal=75, ctVal=2710, CM=CT, useVarD=false, useVarT=false, force=true, tempVal=2900}, 274={doOff=true, doAct=true, isSet=false, swVal=on, dimVal=75, ctVal=3105, CM=CT, useVarD=false, useVarT=false, force=true, tempVal=2900}}
capDevs3.1 HashMap {275={doOff=true, doAct=true, isSet=true, swVal=on, dimVal=45, CM=CT, useVarD=false, useVarT=false, force=true, tempVal=2703}, 276={doOff=true, doAct=true, isSet=true, swVal=on, dimVal=45, CM=CT, useVarD=false, useVarT=false, force=true, tempVal=2703}, 277={doOff=true, doAct=true, isSet=true, swVal=on, dimVal=45, CM=CT, useVarD=false, useVarT=false, force=true, tempVal=2703}, 274={doOff=true, doAct=true, isSet=true, swVal=on, dimVal=45, CM=CT, useVarD=false, useVarT=false, force=true, tempVal=2703}}
captured1.1 Boolean true
captured2.1 Boolean true
captured3.1 Boolean true
dayGroupNdx Integer 1
dayGroups HashMap {1=[true, true, true, true, true, true, true]}
dayGroupsList HashMap {1=Mon-Tue-Wed-Thu-Fri-Sat-Sun}
delayArm Integer 0
hasActivator Boolean true
hasDevices Boolean true
isOn HashMap {99=false, 274=false, 275=false, 100=false, 276=false, 101=false, 134=false, 277=false, 113=false, 105=false, 107=true, 108=false, 98=false}
mode String 1.1
modeIds HashMap {Away=4, Evening=2, Night=3, Day=1}
modeNames HashMap {C=Pre-Capture, -1=Preset Off Day, -2=Preset Off Evening, -3=Preset Off Night, -4=Preset Off Away, 0=All Modes, P=Preset Off, 1=Day, 2=Evening, 3=Night, T=Transition, 4=Away}
modes ArrayList [{4=Away}, {1=Day}, {2=Evening}, {3=Night}]
noReport HashMap {99=false, 274=false, 275=false, 100=false, 276=false, 134=false, 101=false, 277=false, 113=false, 105=false, 107=false, 108=false, 98=false}
offStarted Boolean true
origDelay Integer 0
otherDevs ArrayList []
paused Boolean false
periodNdx Integer 4
periods HashMap {1=Sunrise-7pm, 2=7pm-9pm, 3=9pm-Sunrise}
previousModeNames ArrayList [Day, Evening, Night, Away]
previousModes ArrayList [1, 2, 3, 4]
prevState HashMap {}
priorActive Boolean false
priorDevs ArrayList [274, 275, 276, 277]
priorMode String 3.1
priorOffMeans
priorOnMeans ArrayList [button is pressed]
priorSchedType String Time Periods
priorUseModes Boolean true
reported HashMap {99=true, 274=true, 275=true, 100=true, 276=true, 134=true, 101=true, 277=true, 113=true, 105=true, 107=true, 108=true, 98=true}
started Boolean true
timeSort ArrayList [Sunrise-7pm, 7pm-9pm, 9pm-Sunrise]
todayN String 1
virginOff Boolean true
virginOn Boolean true
zgmModesOff ArrayList [1.1, 2.1, 3.1]
zgmModesOn ArrayList [1.1, 2.1, 3.1]
zigbeeMap HashMap {275={name=Bedroom Fan Bulb 02, ep=01, dni=F944}, 276={name=Bedroom Fan Bulb 03, ep=01, dni=59BA}, 277={name=Bedroom Fan Bulb 04, ep=01, dni=2047}, 274={name=Bedroom Fan Bulb 01, ep=01, dni=1B27}}

Show the logs from RL when you turn on the Activation Device. Use a screenshot.

I don't have a motion sensor.

Ah, thanks. I guess I overcomplicated it by creating a hub variable. Based on your suggestion, I just ended up creating a "virtual device" that's a switch and then made two RMs that controlled the toggle On (above a certain power threshold) and Off (below). Then used that switch as a condition in Room Lighting.

1 Like