Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save janegilring/ffc7c531683320a63ccc26ffcde425f9 to your computer and use it in GitHub Desktop.

Select an option

Save janegilring/ffc7c531683320a63ccc26ffcde425f9 to your computer and use it in GitHub Desktop.
Schedule Tesla auto conditioning based on outside temperature
Import-Module -Name Tesla
Connect-Tesla
$OutsideTemp = (Get-Tesla -Command climate_state).outside_temp
Write-Output "Outside temp is: $OutsideTemp"
if($OutsideTemp -lt 1) {
Write-Output "$(Get-Date): Starting heating and sleeping for 10 minutes"
Set-Tesla -Command auto_conditioning_start
Start-Sleep 600
Write-Output "$(Get-Date): Stopping heating"
Set-Tesla -Command auto_conditioning_stop
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment