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

Add ability to change preset settings (climates) #59

Open
rianadon opened this issue Jan 12, 2021 · 0 comments
Open

Add ability to change preset settings (climates) #59

rianadon opened this issue Jan 12, 2021 · 0 comments

Comments

@rianadon
Copy link

rianadon commented Jan 12, 2021

I'm working on extending the Home Assistant Ecobee integration to support changing preset cool & heat temperatures as another option for automation. The Ecobee API supports changing the thermostat's program by re-uploading both the program schedule and climate (i.e. preset settings) information.

I've written a brief proof of concept below that change's a presets' temperature settings. By editing other fields of thermostat["program"], it would be possible to edit the thermostat's schedule and or other preset settings.

thermostat = ecobee.thermostats[thermostat_index]

# Find the first preset with name set to "Home" and change its settings
homeprogram = next(c for c in thermostat["program"]["climates"] if c["name"] == "Home")
homeprogram["coolTemp"] = 850 # 85 degrees
homeprogram["heatTemp"] = 600 # 60 degrees

body = {
    "selection": {
        "selectionType": "thermostats",
        "selectionMatch": thermostat["identifier"],
    },
    "thermostat": {"program": thermostat["program"]},
}
log_msg_action = "update program"
ecobee._request("POST", ECOBEE_ENDPOINT_THERMOSTAT, log_msg_action, body=body)

Would it be possible to add a method to change a given preset's coolTemp and heatTemp to the library? Or perhaps change all of the preset's settings (which include options like color and whether people are away or home during the preset)? Or maybe it would be cleanest to have a method to change the whole program (including schedule and preset/climate settings)?

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

1 participant