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. Next to the entry you want to remove, select the three dots menu. Then, select Delete.
    • Depending on the integration, the entries are listed under one of the following headings:
      • Devices
      • Hubs
      • Services
      • Integration entries
  3. To confirm, select Delete.
    • Home Assistant also deletes the devices and entities of the entry.
  4. If Home Assistant asks you to restart, restart Home Assistant.
  5. If Home Assistant asks whether to also delete the application credentials, select Remove or Keep.