Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setAway only holds for 2 hours?! #67

Open
byoder7 opened this issue Aug 1, 2022 · 5 comments
Open

setAway only holds for 2 hours?! #67

byoder7 opened this issue Aug 1, 2022 · 5 comments

Comments

@byoder7
Copy link

byoder7 commented Aug 1, 2022

Hi guys,

First, thank you for offering this great software. It is a must when using something like hubitat or smartthings.

So the issue I have is that I have automation setup to call custom command "away()" when there is no presence at my house. Then, when someone is back, it will call "resumeProgram()". However, I noticed the following in the away() calls:

app:1052022-07-31 03:18:06.290 pm infosetProgram(Away) for EcobeeTherm: Downstairs (456123456) - holdType: holdHours, holdHours: 2
app:1052022-07-31 03:18:06.232 pm infosetProgram(Away) for EcobeeTherm: Upstairs (456123458) - holdType: holdHours, holdHours: 2

So, it appears that Ecobee or the EcobeeSuite is doing the away only for 2 hours? How can I change this? Ideally, I want it to be away mode until I change it, which would happen when there is presence again, and then it would resume the normal program for that time of day.

Thanks,
Brian

@Maksim-us
Copy link

In the Ecobee Suite Manager, in "Ecobee Suite Preferences" there is a setting "Default hold type", which is probably set to 2 hours for you. Change it to "Until I change".

@byoder7
Copy link
Author

byoder7 commented Aug 1, 2022

Yes, but that doesn't apply to the calls via Ecobee Suite Manager.

After looking through the code I am going to answer my own question here. I changed from setAway() to setThermostatProgram('Away', 'indefinite'). So you just select the setThermostatProgram and add two parameters. The hold type (Away, Home, ...) and then the second parameter is the 'indefinite', our could be 'holdHours' with a third parameter of the number of hours.

https://www.ecobee.com/home/developer/api/documentation/v1/functions/SetHold.shtml

Brian

@Maksim-us
Copy link

Maksim-us commented Aug 1, 2022 via email

@byoder7
Copy link
Author

byoder7 commented Aug 1, 2022

Here is the code in question. It looks like it just has default of 2 hours if not specified, so that would be the default used by Ecobee Suite Manager, regardless of what was set on the device. I would think a better default would be to use the setting on the Ecobee, so whatever you have there it would use as the default.

But easy enough to figure out what to do. I think things will be working perfectly for me now. Thanks for such a great product, and code that is easy to read :)

void setThermostatProgram(String program, String holdType="", Integer holdHours=2) {
// N.B. if holdType is provided, it must be one of the valid parameters for the Ecobee setHold call (indefinite, nextTransition, holdHours). dateTime not currently supported
refresh()

String currentThermostatHold = ST ? device.currentValue('thermostatHold') : device.currentValue('thermostatHold', true)
if (currentThermostatHold == 'vacation') {
	LOG("setThermostatProgram(${program}): program change requested but ${device.displayName} is in Vacation mode, ignoring request",2,null,'warn')
	return
}

def programsList = []
def programs = device.currentValue('programsList')
if (!programs) {
	LOG("Supported programs list not initialized, possible installation error", 1, this, 'warn')
	programsList = ["Away","Home","Sleep","Resume"]		// Just use the default list
} else {
	programsList = new JsonSlurper().parseText(programs) + ['Resume']
}

if ((program == null) || (program == "") || (!programsList.contains(program))) {
	LOG("setThermostatProgram( ${program} ): Missing or Invalid argument - must be one of (${programsList.toString()[1..-2]})", 2, this, 'warn')
	return
}

def deviceId = getDeviceId()
LOG("setThermostatProgram(${program}, ${holdType}, ${holdHours})", 4, this,'trace')

if (program == 'Resume') {
	LOG("setThermostatProgram() Resuming scheduled program", 2, this, 'info')
	resumeProgram( true )
	return
}

String sendHoldType = ""
def sendHoldHours = null
if (holdType && (holdType != "")) {
	sendHoldType = holdType
	if (holdType == 'holdHours') sendHoldHours = holdHours
} else {
	sendHoldType =	whatHoldType()
	//log.debug "sendHoldType: ${sendHoldType}"
	if ((sendHoldType != null) && sendHoldType.toString().isNumber()) {
		sendHoldHours = sendHoldType
		sendHoldType = 'holdHours'
	}
}
// refresh()		// need to know if scheduled program changed recently

@byoder7
Copy link
Author

byoder7 commented Aug 1, 2022

Last update, looks like there is actually a setting in the Ecobee Suite, so you can pick your default behavior.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants