Uptime

The Uptime integrationIntegrations connect and integrate Home Assistant with your devices, services, and more. [Learn more] provides a sensor that stores the date and time when Home Assistant was last started. This is useful for automations that should behave differently right after a restart, for example, to avoid triggering actions while devices are still coming online.

Configuration

To add the Uptime service to your Home Assistant instance, use this My button:

Manual configuration steps

If the above My button doesn’t work, you can also perform the following steps manually:

Supported functionality

Sensors

  • Uptime
    • Description: The date and time when Home Assistant was last started.
    • Device class: Timestamp. The state is a UTC datetime.

The sensor value is set once at startup and does not change until Home Assistant is restarted again.

Examples

Skipping automations right after a restart

You can use the uptime sensor in a condition to prevent an automation from running within the first few minutes after Home Assistant starts. This avoids false triggers while devices and integrations are still initializing.

conditions:
  - condition: template
    value_template: >
      {{
        now() - as_datetime(states('sensor.uptime'))
        > timedelta(minutes=5)
      }}

This condition passes only when Home Assistant has been running for more than 5 minutes.

Data updates

The sensor value is set once when Home Assistant starts and is not polled or updated after that.

Removing the integration

This integration follows standard integration removal, no extra steps are required.

To remove an integration instance from Home Assistant

  1. Go to Settings > Devices & services and select the integration card.
  2. From the list of devices, select the integration instance you want to remove.
  3. Next to the entry, select the three dots menu. Then, select Delete.