{
  "alias": "Upstairs: resume night automation",
  "description": "Dashboard 'Resume auto' button on the Upstairs thermostat card. Clears anything hand-set and hands Upstairs back to the night automation: Upstairs -> the night auto setpoint (63.5F, owner's usual night temp; also the saved base for pulses), input_boolean.bedroom_manual_override off, then one run of 'Bedroom night warmth' with its conditions (pulses only if the bedroom is under 62F, 20:00-09:00). The setpoint write is stamped via input_text.bedroom_auto_write so it is not seen as a hand change. Managed from the infra repo, 2026-11-23 (owner: the button should clear anything manual).",
  "icon": "mdi:robot-happy-outline",
  "mode": "single",
  "variables": {
    "night_auto": 63.5
  },
  "sequence": [
    {
      "action": "input_number.set_value",
      "target": {
        "entity_id": "input_number.bedroom_ratchet_steps"
      },
      "data": {
        "value": 0
      }
    },
    {
      "action": "input_number.set_value",
      "target": {
        "entity_id": "input_number.bedroom_pre_boost_setpoint"
      },
      "data": {
        "value": "{{ night_auto }}"
      }
    },
    {
      "action": "input_boolean.turn_off",
      "target": {
        "entity_id": "input_boolean.bedroom_heat_boost"
      }
    },
    {
      "action": "input_text.set_value",
      "target": {
        "entity_id": "input_text.bedroom_auto_write"
      },
      "data": {
        "value": "{{ now().timestamp() }}"
      }
    },
    {
      "action": "climate.set_temperature",
      "target": {
        "entity_id": "climate.upstairs_nest"
      },
      "data": {
        "temperature": "{{ night_auto }}"
      }
    },
    {
      "action": "input_boolean.turn_off",
      "target": {
        "entity_id": "input_boolean.bedroom_manual_override"
      }
    },
    {
      "action": "logbook.log",
      "data": {
        "name": "Bedroom night warmth",
        "entity_id": "climate.upstairs_nest",
        "message": "Resume auto from the dashboard: Upstairs set to {{ night_auto }}F, automation back in control"
      }
    },
    {
      "action": "automation.trigger",
      "target": {
        "entity_id": "automation.bedroom_night_warmth"
      },
      "data": {
        "skip_condition": false
      }
    }
  ]
}
