Rooms Manager: Smarter Rooms: Personalized home automation with Occupancy


#486

Yes, the logged values are correct.


#487

hmm … looks like sunrise and sunset are still yesterdays but current time is from today which may be causing this issue.

for the room please check app state and share the following values:



#488

Actually, those nulls may be due to this: I've removed all sunset/sunrise values from that rules, to check the problem. Let me add back in the sunrise/sunset data for that rule, and rerun.

Edit: no, still the same.


#489

I dont have those in the room. This is what I have.


#490

not the state for the rooms occupancy device … the state for the app … click the i next to the room from apps list.


#491

Now I feel silly, because I know about that "i"

Also, just saw this in the logs:
2018-10-23 09:17:45.302:errorgroovy.lang.MissingMethodException: No signature of method: app1540245413010338648237.subsribe() is applicable for argument types: (java.util.ArrayList, java.lang.String, java.lang.String) values: [[[TV - Downstairs TV], [TV - Downstairs TV]], switch, checkSwitchEventHandler]
Possible solutions: subscribe(java.lang.Object, java.lang.String, java.lang.Object), subscribe(java.lang.Object, java.lang.String, java.lang.Object, java.util.Map) on line 2506 (updated)


#492

That is yesterday's date, today is 23-Oct-2018, 9:26am. That would explain why as soon as it clicks over to midnight, the sunset/sunrise stops working.


#493

no worries. if you go to the subscriptions section in that page do you see subscriptions for sunrise and sunset?


#494

No, nothing under subscriptions.


#495

if you save the room again till no subscription for sunrise and sunset?


#496

Correct, nothing. Saved, nothing. There are rules that have sunset/sunrise.....


#497

in rooms child app code find this function please:

private sunRiseAndSet(onlyUpdate = false)		{
	if (onlyUpdate || !state.sunriseTime || !state.sunsetTime)	{
		def sunriseAndSunset = getSunriseAndSunset()
		if (!sunriseAndSunset.sunrise || !sunriseAndSunset.sunset)	{
			ifDebug("Please set location for the hub for rules to be processed.", "error")
			return false
		}
		state.sunriseTime = new Date(sunriseAndSunset.sunrise.getTime()).format("yyyy-MM-dd'T'HH:mm:ssZ")
		state.sunsetTime  = new Date(sunriseAndSunset.sunset.getTime()).format("yyyy-MM-dd'T'HH:mm:ssZ")
		if (onlyUpdate)		return false;
	}
	def sunriseTime = new Date().parse("yyyy-MM-dd'T'HH:mm:ssZ", state.sunriseTime)
	def sunsetTime = new Date().parse("yyyy-MM-dd'T'HH:mm:ssZ", state.sunsetTime)
	return [rise:sunriseTime, set:sunsetTime]
}

then comment the three lines as below:

private sunRiseAndSet(onlyUpdate = false)		{
	//if (onlyUpdate || !state.sunriseTime || !state.sunsetTime)	{
		def sunriseAndSunset = getSunriseAndSunset()
		if (!sunriseAndSunset.sunrise || !sunriseAndSunset.sunset)	{
			ifDebug("Please set location for the hub for rules to be processed.", "error")
			return false
		}
		state.sunriseTime = new Date(sunriseAndSunset.sunrise.getTime()).format("yyyy-MM-dd'T'HH:mm:ssZ")
		state.sunsetTime  = new Date(sunriseAndSunset.sunset.getTime()).format("yyyy-MM-dd'T'HH:mm:ssZ")
		//if (onlyUpdate)		return false;
	//}
	def sunriseTime = new Date().parse("yyyy-MM-dd'T'HH:mm:ssZ", state.sunriseTime)
	def sunsetTime = new Date().parse("yyyy-MM-dd'T'HH:mm:ssZ", state.sunsetTime)
	return [rise:sunriseTime, set:sunsetTime]
}

save the app code and try changing the same room from any state to engaged please.


#498

Yes, that worked. Here are the logs (that go right back to the earlier). Still "null" but the lights turned on with the sunset/sunrise restriction in the rule.

There are no sunset/sunrise subscriptions in the "i" for the Room.


#499

cool.

just means there is no time specified in the rule itself.

somehow the subscriptions are not being setup which is the root cause of the problem. dont know if that has anything to do with you being down under. :slight_smile:

also the missing method exception for check switches is still being thrown when you save the room - yes?


#500

Is it solvable?

Yes - just tested. Is that an issue with my devices or Rooms Manager?

Love your work !


#501

HE folks would have to take a look at why. for the app … since its working for you … its solved already. :slight_smile:

i will update the code with the same fix and the push it to github.

issue in my code when multiple check on/off devices … will fix and push that too.

thank you

EDIT: the check on/off issue wasnt actually a code issue. its not working because subscription function that works on ST does not work exactly the same on HE. have a fix … will push later today.


#502

OK. I have a similar issue with a different Rule. This time before midnight, so might be a related issue, but the changes to the coding (already implemented by commenting out those three lines) did not fix this issue.

I only just got home and the lights didnt turn on. I then removed the sunset to sunrise clause in the rule, and the lights immediately turned on.


#503

can you please add the sunrise/sunset back to the rule and share the log for the debug line we had uncommented?


#504

New situation I'm looking into...

I have a room set up for Basement Stairs, with adjacent rooms Kitchen and TV Room. The Basement Stairs room consists of lights that are in both Kitchen and TV Room (Basement Stairs A & B are up at the top of the steps, and light part of the kitchen, Basement Stairs Bottom lights part of the TV Room).

I'd like to have Basement Stairs set up to activate the adjacent rooms Kitchen and TV room, so that the lights at the other end will turn on before I get there (I think that's how the adjacent rooms setting works, right? Set the surrounding rooms to Occupied?). That all should be standard functionality I think.

The piece I'm missing is, since these lights are in multiple rooms, I've noticed that the Basement Stairs rules turn these room lights off once the Basement Stairs room times out.

For example, I'll come up the stairs, the stairs lights will come on, I'll get to the kitchen, and the kitchen lights will come on (which include the Basement Stairs A & B lights at the top). I'll be working in the kitchen, and after a minute or two, the Basement Stairs A & B lights will turn off because the Basement Stairs room has now gone vacant.

I'd like to have a way to use adjacent room occupancy in my execution rule for the Basement Stairs so that I can make a rule to only turn the top lights off if Kitchen is vacant, and bottom light off if TV Room is vacant.

I'm not sure if this all makes sense like I've described, but please let me know if I can explain it further.


#505

for the basement stairs room try turning off the Turn off all switches on no rule match? settings so the lights only get turned off by the kitchen and tv room but do get turned on by the basement stairs room.