Presence sensor to change thermostat mode from Home to away


Equipment:

Hub: C7

Thermostat: Ecobee 3 Lite

Presence sensor: Unifi network intergration, 4 cell phones


My goal is to get my thermostat to change between home and away settings programmed on the thermostat by using the cell phones in my house as presence sensors. As one or multiple phones join the network, the thermostat changes to home but if all of the phones are off of the network; it changes to away.

Be gentle, Im a novice with all of this.

I don't use Unifi, but reading up on the Unifi Integration for Hubitat, it looks like you should either already have, or be able to create, devices on the hub for each phone. Those devices should have a "present/not present" attribute. If you need help with that part of the setup, hopefully a Unifi user will chime in here. I am also assuming that you already have the Ecobee 3 Lite connected to the hub and that it has a setting for Away Mode.

I'd create two rules in Rule Machine: One rule would be: When Phone 1, Phone 2, Phone 3, Phone 4 ALL depart: change thermostat to away. The second rule would be: When Phone 1, Phone 2, Phone 3, Phone 4 ANY arrive: change thermostat to home. If you are new to Rule Machine and need guidance on how to create those rules, just ask.

@Alan_F is giving good advice above. Take a swing at starting in Rule Machine and come back if you hit a spot that could use extra eyes.

I looked at whether it could be done in the Visual Rule Builder, but it did not seem to have the thermostat modes exposed.

Side note - thanks for the reminder. We have been in this house for over 4 months and I still haven't fine tuned our thermostat logic.

I have taken a bit of a different tack. I use the phones here with Mode Manager to switch mode from home/night to away and back. If all phones leave, mode is set to away. If any returns during the day, mode is set to home. If any return at night, mode is set to night. Night is defines as between 23:00 and 07:30.

Next is to use the mode for triggering another rule to set the thermostat according to mode.

My rule is called Thermosat Setpoint Change.

The trigger is "Mode becomes 'changed'."

Actions are:

IF (Mode is Away(F) [FALSE]) THEN + :scissors:
Thermostats: KONOz --> Heat: 55.0 + :scissors:
Delay 0:00:15 + :scissors:
Thermostats: KONOz --> Cool: 80.0 + :scissors:
ELSE-IF (Mode is Home(T) AND Time between 07:30 and 22:59(T) [TRUE]) THEN + :scissors:
Thermostats: KONOz --> Heat: 72.0 + :scissors:
Delay 0:00:15 + :scissors:
Thermostats: KONOz --> Cool: 76.0 + :scissors:
ELSE-IF (Mode is Night(F) AND Time between 23:00 and 07:29(F) [FALSE]) THEN + :scissors:
Thermostats: KONOz --> Cool: 75.0 + :scissors:
Delay 0:00:15 + :scissors:
Thermostats: KONOz --> Heat: 68.0 + :scissors:
END-IF

This, and I set up separate rules to make sure the changes took and to set to the correct temperatures if for some reason, the setpoint did not take. These are likely no longer needed, but they are not doing any harm, so I have left them in place.

I hope this is helpful. Also, the delay is so that the two setpoint changes are separated by enough time to let one action be completed before the next command happens. It just seems to work better this way, at least for me.

The thermostat modes is why I came here. If I do it by temp, I would have to do seperate rules for heat and cool

I totally get it and agree. My previous situation had 4 thermostat modes and 4 variables. Managing it by individual rules would have been tedious. I mapped it out as a finite state machine to handle transitions. That work was done in webCoRE, so I am not as helpful with implementation using native tools.

I do this with two Rule Machine rules, one for Home and one for Away for two users. And Combined presence for two users.
Home--

Away--