mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-16 05:46:52 +00:00
Document new RESTful sensor configuration options (#23043)
This commit is contained in:
parent
5c7c4bd616
commit
8c429e2967
@ -52,74 +52,27 @@ sensor:
|
||||
{% endraw %}
|
||||
|
||||
{% configuration %}
|
||||
resource:
|
||||
description: The resource or endpoint that contains the value.
|
||||
required: true
|
||||
type: string
|
||||
resource_template:
|
||||
description: The resource or endpoint that contains the value with template support.
|
||||
required: true
|
||||
type: template
|
||||
method:
|
||||
description: The method of the request. Either `POST` or `GET`.
|
||||
required: false
|
||||
type: string
|
||||
default: GET
|
||||
name:
|
||||
description: Name of the REST sensor.
|
||||
required: false
|
||||
type: string
|
||||
default: REST Sensor
|
||||
device_class:
|
||||
description: Sets the [class of the device](/integrations/sensor#device-class), changing the device state and icon that is displayed on the frontend.
|
||||
required: false
|
||||
type: string
|
||||
state_class:
|
||||
description: The [state_class](https://developers.home-assistant.io/docs/core/entity/sensor#available-state-classes) of the sensor.
|
||||
required: false
|
||||
type: string
|
||||
value_template:
|
||||
description: "Defines a [template](/docs/configuration/templating/#processing-incoming-data) to extract the value."
|
||||
required: false
|
||||
type: template
|
||||
payload:
|
||||
description: The payload to send with a POST request. Depends on the service, but usually formed as JSON.
|
||||
required: false
|
||||
type: string
|
||||
verify_ssl:
|
||||
description: Verify the SSL certificate of the endpoint.
|
||||
required: false
|
||||
type: boolean
|
||||
default: True
|
||||
timeout:
|
||||
description: Defines max time to wait data from the endpoint.
|
||||
required: false
|
||||
type: integer
|
||||
default: 10
|
||||
unit_of_measurement:
|
||||
description: Defines the units of measurement of the sensor, if any.
|
||||
required: false
|
||||
type: string
|
||||
authentication:
|
||||
description: Type of the HTTP authentication. `basic` or `digest`.
|
||||
required: false
|
||||
type: string
|
||||
username:
|
||||
description: The username for accessing the REST endpoint.
|
||||
device_class:
|
||||
description: Sets the [class of the device](/integrations/sensor#device-class), changing the device state and icon that is displayed on the frontend.
|
||||
required: false
|
||||
type: string
|
||||
password:
|
||||
description: The password for accessing the REST endpoint.
|
||||
force_update:
|
||||
description: Sends update events even if the value hasn't changed. Useful if you want to have meaningful value graphs in history.
|
||||
required: false
|
||||
type: string
|
||||
type: boolean
|
||||
default: false
|
||||
headers:
|
||||
description: The headers for the requests.
|
||||
required: false
|
||||
type: [template, list]
|
||||
params:
|
||||
description: The query params for the requests.
|
||||
icon:
|
||||
description: Defines a template for the icon of the REST sensor.
|
||||
required: false
|
||||
type: [template, list]
|
||||
type: template
|
||||
json_attributes:
|
||||
description: A list of keys to extract values from a JSON dictionary result and then set as sensor attributes. If the endpoint returns XML with the "text/xml", "application/xml" or "application/xhtml+xml" content type, it will automatically be converted to JSON according to this [specification](https://www.xml.com/pub/a/2006/05/31/converting-between-xml-and-json.html)
|
||||
required: false
|
||||
@ -128,11 +81,70 @@ json_attributes_path:
|
||||
description: A [JSONPath](https://goessner.net/articles/JsonPath/) that references the location of the `json_attributes` in the JSON content.
|
||||
required: false
|
||||
type: string
|
||||
force_update:
|
||||
description: Sends update events even if the value hasn't changed. Useful if you want to have meaningful value graphs in history.
|
||||
method:
|
||||
description: The method of the request. Either `POST` or `GET`.
|
||||
required: false
|
||||
type: string
|
||||
default: GET
|
||||
name:
|
||||
description: Defines a template for the name of the REST sensor.
|
||||
required: false
|
||||
type: template
|
||||
default: REST Sensor
|
||||
params:
|
||||
description: The query params for the requests.
|
||||
required: false
|
||||
type: [template, list]
|
||||
password:
|
||||
description: The password for accessing the REST endpoint.
|
||||
required: false
|
||||
type: string
|
||||
payload:
|
||||
description: The payload to send with a POST request. Depends on the service, but usually formed as JSON.
|
||||
required: false
|
||||
type: string
|
||||
picture:
|
||||
description: Defines a template for the entity picture of the REST sensor.
|
||||
required: false
|
||||
type: template
|
||||
resource:
|
||||
description: The resource or endpoint that contains the value.
|
||||
required: true
|
||||
type: string
|
||||
resource_template:
|
||||
description: The resource or endpoint that contains the value with template support.
|
||||
required: true
|
||||
type: template
|
||||
state_class:
|
||||
description: The [state_class](https://developers.home-assistant.io/docs/core/entity/sensor#available-state-classes) of the sensor.
|
||||
required: false
|
||||
type: string
|
||||
timeout:
|
||||
description: Defines max time to wait data from the endpoint.
|
||||
required: false
|
||||
type: integer
|
||||
default: 10
|
||||
unique_id:
|
||||
description: An ID that uniquely identifies this entity. This allows changing the `name`, `icon` and `entity_id` from the web interface.
|
||||
required: false
|
||||
type: string
|
||||
unit_of_measurement:
|
||||
description: Defines the units of measurement of the sensor, if any.
|
||||
required: false
|
||||
type: string
|
||||
username:
|
||||
description: The username for accessing the REST endpoint.
|
||||
required: false
|
||||
type: string
|
||||
value_template:
|
||||
description: "Defines a [template](/docs/configuration/templating/#processing-incoming-data) to extract the value."
|
||||
required: false
|
||||
type: template
|
||||
verify_ssl:
|
||||
description: Verify the SSL certificate of the endpoint.
|
||||
required: false
|
||||
type: boolean
|
||||
default: false
|
||||
default: True
|
||||
{% endconfiguration %}
|
||||
|
||||
<div class='note'>
|
||||
|
Loading…
x
Reference in New Issue
Block a user