Rooms Manager: Smarter Rooms: Personalized home automation with Occupancy

yep. heres an example of where i do something similar:

RULE SETTINGS:

Rules:
	1: State=[engaged, occupied] Type=Execution ON=[dW BR LI 1, dW BR LI 2, dW BR LI 3, dW BR LI 4] Level=AL
	2: State=[occupied] From=00:00 To=06:00 Type=Execution ON=[dW BR LI 1, dW BR LI 4] Level=1 OFF=[dW BR LI 2, dW BR LI 3]
	3: State=[engaged] From=00:00 To=06:00 Type=Execution ON=[dW BR LI 1, dW BR LI 2, dW BR LI 3, dW BR LI 4] Level=1
	4: State=[occupied] Type=Humidity Compare=1 Value=59.0 For minutes=10 Minimum=1 Maximum=10
	6: State=[engaged] Type=Humidity Dehumidifier=true Compare=1 For minutes=5 Minimum=10 Maximum=45

i use time you could use mode or time or any combination of those.

Lifx

ok. thinking of getting a couple of yeelights for a new fixture … so this is good.

thanks

For some reason my lights are only turning on to 20%, despite being told to turn on to AL.

This is for a bathroom. 2 motion sensors - one at door, and one in the shower.

ROOM OCCUPANCY DEVICE:

Room child device ・  ・  ・  ・  ・   Child device OK

ROOM SENSOR SETTINGS:

Motion sensors ・  ・  ・  ・  ・  ・   2
Trigger motion ・  ・  ・  ・  ・  ・   2
Which no motion ・  ・  ・  ・  ・  ・  Last Motion Inactive

OCCUPIED SETTINGS:

Motion timeout ・  ・  ・  ・  ・  ・   60 seconds

ENGAGED SETTINGS:

Busy check ・  ・  ・  ・  ・  ・  ・  ・ Light traffic
Require motion ・  ・  ・  ・  ・  ・   180 seconds

CHECKED SETTINGS:

Dim timer ・  ・  ・  ・  ・  ・  ・  ・  30 seconds
By level ・  ・  ・  ・  ・  ・  ・  ・   40%
To level ・  ・  ・  ・  ・  ・  ・  ・   70%

VACANT SETTINGS:

ASLEEP SETTINGS:

Asleep button type ・  ・  ・  ・  ・  pushableButton
Button number ・  ・  ・  ・  ・  ・  ・ 1
Only sets ・  ・  ・  ・  ・  ・  ・  ・  true

LOCKED SETTINGS:

AUTO LEVEL SETTINGS:

Min level ・  ・  ・  ・  ・  ・  ・  ・  60%
Max level ・  ・  ・  ・  ・  ・  ・  ・  75%
Wake time ・  ・  ・  ・  ・  ・  ・  ・  07:00
Sleep time ・  ・  ・  ・  ・  ・  ・  ・ 23:00
Auto color temp ・  ・  ・  ・  ・  ・  true
Min kelvin ・  ・  ・  ・  ・  ・  ・  ・ 2,200 kelvin
Max kelvin ・  ・  ・  ・  ・  ・  ・  ・ 6,500 kelvin

TEMPERATURE SETTINGS:

HOLIDAY LIGHT SETTINGS:

RULE SETTINGS:

Rules:
	1: Mode=[Sleep] State=[engaged, occupied] Type=Execution ON=1 Level=1 Kelvin=2200
	2: Mode=[Away, Day, Morning, Night] State=[engaged, occupied] Type=Execution ON=1 Level=AL

ADJACENT SETTINGS:

ANNOUNCEMENT SETTINGS:

GENERAL SETTINGS:

Away modes ・  ・  ・  ・  ・  ・  ・  ・ 1
All switches off ・  ・  ・  ・  ・  ・ true
  • is the bulb newly added?
  • where are you seeing the 20%?

Not newly added.

Further experimentation - it's not using the auto-level. It turns on to the previous level - in this case it was 20%, which was what the Checking dimmed it to before turning off.

i put in some new code for optimizing switches processing. wondering if that is causing issues. from state for the app could you please share the rules value. should look something like this:

{1={uniform=false, hasColor=0, hasLevel=1, hasColorTemperature=0, isRule=true}, 2={isRule=true}, 3={isRule=true}, 4={isRule=true}, 6={isRule=true}}

does this light support both color and color temperature?

They are hue CT bulbs (white ambiance). No color.

In the child app? Only thing I can find is:

def uniform = true
int hasLevel = 0, hasColor = 0, hasColorTemperature = 0
if (state.rules[(thisRule.ruleNo)].containsKey('uniform')) {
uniform = state.rules[(thisRule.ruleNo)].uniform
hasLevel = state.rules[(thisRule.ruleNo)].hasLevel
hasColor = state.rules[(thisRule.ruleNo)].hasColor
hasColorTemperature = state.rules[(thisRule.ruleNo)].hasColorTemperature
}
else {
for (def swt : thisRule.switchesOn) {
def itID = swt.getId()
if (thisRule.color)
if (state.switchesHasColor[itID]) {
if (hasColor == 0) hasColor = 1 else if (hasColor != 1) { uniform = false; break }
}
else {
if (hasColor == 0) hasColor = -1 else if (hasColor != -1) { uniform = false; break }
}
if (thisRule.colorTemperature || (thisRule.level == 'AL' && autoColorTemperature))
if (state.switchesHasColorTemperature[itID]) {
if (hasColorTemperature == 0) hasColorTemperature = 1 else if (hasColorTemperature != 1) { uniform = false; break }
}
else {
if (hasColorTemperature == 0) hasColorTemperature = -1 else if (hasColorTemperature != -1) { uniform = false; break }
}
if (thisRule.level)
if (state.switchesHasLevel[itID]) {
if (hasLevel == 0) hasLevel = 1 else if (hasLevel != 1) { uniform = false; break }
}
else {
if (hasLevel == 0) hasLevel = -1 else if (hasLevel != -1) { uniform = false; break }
}
}
state.rules[(thisRule.ruleNo)] << [uniform:uniform]
state.rules[(thisRule.ruleNo)] << [hasLevel:hasLevel]
state.rules[(thisRule.ruleNo)] << [hasColor:hasColor]
state.rules[(thisRule.ruleNo)] << [hasColorTemperature:hasColorTemperature]
}
if (uniform) {
def turnOn = true
if (hasColor == 1) {
thisRule.switchesOn.setColor(thisRule.hue); pauseIt()
turnOn = false
}

ok

sorry no not in the code. please click the i next to the room and search in the new page for rules then share the value of that state variable.

Ah.

{1={isRule=true}, 2={isRule=true}}

thanks. this is for the same room right? did you recently save the room? if yes try triggering the occupancy again then find rules from the same place and share the value please.

also you are on version 0.90.2?

{1={isRule=true}, 2={uniform=true, hasColor=0, hasLevel=1, hasColorTemperature=1, isRule=true}}

No, I'm on v0.90.0!

thanks.

ok. if you dont mind upgrade to the latest and check. meanwhile let me check the code as well.

also no error in the logs when the light is turning on - right?

Upgraded to 0.90.2. No error in the logs. For some reason the bulbs are turning on to 1% now, even though it's not Sleep Mode yet.

(but it's about to be - my wife is about to hit the button)

hit the button!

lets check in tomorrow :slight_smile:

1 Like

Sounds good :sleeping_bed:

1 Like

updated github with the following changes:

Version: 0.90.4

DONE:   10/3/2018
1) added color option to night lights.
2) tweaked the holiday lights twinkle a bit for HE.
3) optimized switches processing.
4) started adding sub-headers on HE.

@kilowatts please update to 0.90.4 before trying AL. after update turn on debug for the room from GENERAL SETTINGS then lets see what values are getting calculated in AL from the logs.

@hughlipham the switches should turn off right with this version. if you are going to try twinkle please try after updating to this version.

@jbeard night lights with color only for your better half.

1 Like

Github is only showing version stamp of 0.90.2 for the child app.

I did install it and the new features are present either way :slight_smile: The wife thanks you.

Bengali,

I have moved across my Rooms Manager from ST to HE. One thing I cant seem to set - priority of rules within Hubitat. I have one light that is "signal" light for open doors. When garage door opens, I want that light to turn red.

Problem is that in HE, Rooms Manager overrides the command to turn the code red, and it turns back white, or off. In ST, it didnt (via webcore).

So far, I've only tried via Rules Machine to turn the signal light red. I've tried setting the room to locked when contact sensor opens AND locked overrides trigger devices for other states, but Rooms Manager took priority over Rules Machine, and the light turned didn't change color. Then I tried the above, with Locked NOT overriding other states, and the light did turn red, but within 10 seconds, Rooms Manager (I presume) turned the light white, before the contact sensor was shut.

What is the order of priority in HE? Any way to achieve this? Would Webcore take priority over Rules Machine and Rooms Manager. As I said, this was not an issue in ST. I've checked my Rooms Manager settings there.......

Edit: I seem to have got it working, but the room goes to vacant after locked. Is there a way to set it to whatever the status was before locked, or is there a better way to do this?