cancel
Showing results for 
Search instead for 
Did you mean: 

Scripting Help - Turn Eco Mode Off

timb0slice7
Community Member

Hello everyone,

I'm attempting to make my own set of Home/Away routines that can be interrupted in case we have a babysitter or guest staying over (so that all our lights and the heating/cooling doesn't shut off on them if we leave). I currently have the following Away Routine which works perfectly:

metadata:
  name: 1 Away Mode
  description: Turn off all the lights when we are away, except when Guest Mode "plug" is activated

automations:
  starters:
    - type: home.state.HomePresence
      state: homePresenceMode
      is: AWAY

  condition:
    type: device.state.OnOff
    state: on
    is: false
    device: Guest Mode - Guest

  actions:
    - type: assistant.command.OkGoogle
      okGoogle: Turn off all the lights
      devices: Family Room Audio - Family Room
    - type: device.command.OnOff # Turn the device on or off.
      on: true
      devices: Front Door Cam Plug - Kitchen
    - type: device.command.ThermostatSetMode # Set the target operating mode for a thermostat device.
      thermostatMode: eco
      devices: Thermostat - Dining Room

Where I am struggling is with the Home routine:

metadata:
  name: 1 Home Mode
  description: Turn the thermostat back on when returning home

automations:
  starters:
    - type: home.state.HomePresence
      state: homePresenceMode
      is: HOME

  actions:
    - type: device.command.ThermostatSetMode # Set the target operating mode for a thermostat device.
      thermostatMode: on
      devices: Thermostat - Dining Room

 

Right now the options for thermostatMode are on, off, eco, heat, cool, and heatcool. "eco" turns on eco mode, but there is no way to turn eco mode off. You have to specify heat, cool, or heatcool. On only turns the thermostat back on if it is off.

 

Right now, I'm just trying to remember that as we change modes, we need to manually update the script to match. But is there a way to just turn off eco mode, or remember the previous mode from the Away routine and reapply it to the Home routine?

0 REPLIES 0