RESTful
The rest
sensor platform is consuming a given endpoint which is exposed by a RESTful API of a device, an application, or a web service. The sensor has support for GET and POST requests.
RESTful Sensor and RESTful Binary_sensor can also be set up as platforms if there is only a single sensor per endpoint.
# Example configuration.yaml entry
rest:
- authentication: basic
username: "admin"
password: "password"
scan_interval: 60
resource: http://192.168.1.12/status.xml
sensor:
- name: "Adult Pool Data System"
json_attributes_path: "$.response.system"
value_template: "OK"
json_attributes:
- "runstate"
- "model"
- "opmode"
- "freeze"
- "time"
- "sensor1"
- "sensor2"
- "sensor3"
- "sensor4"
- "sensor5"
- "version"
- name: "Adult Pool Data Equipment"
json_attributes_path: "$.response.equipment"
value_template: "OK"
json_attributes:
- "circuit1"
- "circuit2"
- "circuit3"
- "circuit4"
- "circuit5"
- "circuit6"
- "circuit7"
- "circuit8"
- name: "Adult Pool Data Temp"
json_attributes_path: "$.response.temp"
value_template: "OK"
json_attributes:
- "htstatus"
- "poolsp"
- "spasp"
- "pooltemp"
- "spatemp"
- "airtemp"
- authentication: basic
username: "admin"
password: "password"
scan_interval: 60
resource: "http://192.168.1.13/status.xml"
sensor:
- name: "Kiddie Pool Data System"
json_attributes_path: "$.response.system"
value_template: "OK"
json_attributes:
- "runstate"
- "model"
- "opmode"
- "freeze"
- "time"
- "sensor1"
- "sensor2"
- "sensor3"
- "sensor4"
- "version"
- name: "Kiddie Pool Data Equipment"
json_attributes_path: "$.response.equipment"
value_template: "OK"
json_attributes:
- "circuit1"
- "circuit2"
- "circuit3"
- "circuit4"
- "circuit5"
- "circuit6"
- "circuit7"
- "circuit8"
- name: "Kiddie Pool Data Temp"
json_attributes_path: "$.response.temp"
value_template: "OK"
json_attributes:
- "htstatus"
- "poolsp"
- "spasp"
- "pooltemp"
- "spatemp"
- "airtemp"
Configuration Variables
The resource or endpoint that contains the value with template support.
The payload to send with a POST request. Depends on the service, but usually formed as JSON.
A list of RESTful Sensor to create from the shared data. All configuration settings that the supported by RESTful Sensor not listed above can be used here.
A list of RESTful Binary_sensor to create from the shared data All configuration settings that the supported by RESTful Binary_sensor not listed above can be used here.
Suggest an edit to this page, or provide/view feedback for this page.