mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-18 14:56:53 +00:00
Document new RESTful sensor configuration options (#23043)
This commit is contained in:
parent
5c7c4bd616
commit
8c429e2967
@ -52,74 +52,27 @@ sensor:
|
|||||||
{% endraw %}
|
{% endraw %}
|
||||||
|
|
||||||
{% configuration %}
|
{% 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:
|
authentication:
|
||||||
description: Type of the HTTP authentication. `basic` or `digest`.
|
description: Type of the HTTP authentication. `basic` or `digest`.
|
||||||
required: false
|
required: false
|
||||||
type: string
|
type: string
|
||||||
username:
|
device_class:
|
||||||
description: The username for accessing the REST endpoint.
|
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
|
required: false
|
||||||
type: string
|
type: string
|
||||||
password:
|
force_update:
|
||||||
description: The password for accessing the REST endpoint.
|
description: Sends update events even if the value hasn't changed. Useful if you want to have meaningful value graphs in history.
|
||||||
required: false
|
required: false
|
||||||
type: string
|
type: boolean
|
||||||
|
default: false
|
||||||
headers:
|
headers:
|
||||||
description: The headers for the requests.
|
description: The headers for the requests.
|
||||||
required: false
|
required: false
|
||||||
type: [template, list]
|
type: [template, list]
|
||||||
params:
|
icon:
|
||||||
description: The query params for the requests.
|
description: Defines a template for the icon of the REST sensor.
|
||||||
required: false
|
required: false
|
||||||
type: [template, list]
|
type: template
|
||||||
json_attributes:
|
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)
|
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
|
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.
|
description: A [JSONPath](https://goessner.net/articles/JsonPath/) that references the location of the `json_attributes` in the JSON content.
|
||||||
required: false
|
required: false
|
||||||
type: string
|
type: string
|
||||||
force_update:
|
method:
|
||||||
description: Sends update events even if the value hasn't changed. Useful if you want to have meaningful value graphs in history.
|
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
|
required: false
|
||||||
type: boolean
|
type: boolean
|
||||||
default: false
|
default: True
|
||||||
{% endconfiguration %}
|
{% endconfiguration %}
|
||||||
|
|
||||||
<div class='note'>
|
<div class='note'>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user