esphome-docs/components/sensor/uptime.rst

37 lines
963 B
ReStructuredText
Raw Normal View History

Uptime Sensor
=============
2018-11-14 22:12:27 +01:00
.. seo::
:description: Instructions for setting up a sensor that tracks the uptime of the ESP.
:image: timer.svg
2018-11-14 22:12:27 +01:00
The ``uptime`` sensor allows you to track the time the ESP has stayed up for in seconds.
Time rollovers are automatically handled.
.. code-block:: yaml
# Example configuration entry
sensor:
- platform: uptime
type: seconds
name: Uptime Sensor
Configuration variables:
------------------------
- **type** (*Optional*): Either:
2019-01-06 18:56:14 +01:00
- ``seconds`` (*default*): A simple counter.
- ``timestamp``: presents the time ESPHome last booted up. Requires a :doc:`/components/time/index`.
2018-08-24 22:44:01 +02:00
- **update_interval** (*Optional*, :ref:`config-time`): The interval to check the sensor. Defaults to ``60s``.
Valid only with ``type: seconds``.
- All other options from :ref:`Sensor <config-sensor>`.
2018-08-24 22:44:01 +02:00
See Also
--------
- :ref:`sensor-filters`
2019-05-12 22:44:59 +02:00
- :apiref:`uptime/uptime_sensor.h`
- :ghedit:`Edit`