mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-23 17:27:19 +00:00
Add functions
This commit is contained in:
parent
bff2b652b1
commit
b557c7e0c3
@ -13,7 +13,7 @@ ha_category: Switch
|
|||||||
|
|
||||||
The arest switch platform allows you to toggle pins of your devices (like Arduino boards with a ethernet/wifi connection, ESP8266 based devices, and the Raspberry Pi) running the [aREST](http://arest.io/) RESTful framework.
|
The arest switch platform allows you to toggle pins of your devices (like Arduino boards with a ethernet/wifi connection, ESP8266 based devices, and the Raspberry Pi) running the [aREST](http://arest.io/) RESTful framework.
|
||||||
|
|
||||||
To use your aREST enabled device in your installation, add the following to your `configuration.yaml` file:
|
To use your aREST enabled device with pins in your installation, add the following to your `configuration.yaml` file:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
# Example configuration.yaml entry
|
# Example configuration.yaml entry
|
||||||
@ -28,14 +28,34 @@ switch:
|
|||||||
name: Light Desk
|
name: Light Desk
|
||||||
```
|
```
|
||||||
|
|
||||||
|
If you want to use custom functions, then add the following to your `configuration.yaml` file:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
# Example configuration.yaml entry
|
||||||
|
switch:
|
||||||
|
platform: arest
|
||||||
|
resource: http://IP_ADDRESS
|
||||||
|
name: Office
|
||||||
|
functions:
|
||||||
|
function1:
|
||||||
|
name:
|
||||||
|
function2:
|
||||||
|
name: Light Desk
|
||||||
|
```
|
||||||
|
|
||||||
Configuration variables:
|
Configuration variables:
|
||||||
|
|
||||||
- **resource** (*Required*): IP address and schema of the device that is exposing an aREST API, eg. http://192.168.1.10.
|
- **resource** (*Required*): IP address and schema of the device that is exposing an aREST API, eg. http://192.168.1.10 (no-trailing slash)
|
||||||
- **name** (*Optional*): Let you overwrite the the name of the device. By default *name* from the device is used.
|
- **name** (*Optional*): Let you overwrite the the name of the device. By default *name* from the device is used.
|
||||||
- **pins** array (*Required*): An array with all used pins of your board.
|
- **pins** array (*Required*): An array with all used pins.
|
||||||
- **name** (*Required*): The name of the pin you wish to toggle.
|
- **name** (*Required*): The name of the pin to use in the frontend.
|
||||||
|
|
||||||
You can still switch your pins with a web browser or a command line tool. Use the http://192.168.1.10/digital/8/1 to set pin 8 to high/on, the JSON response will give you some feedback.
|
or
|
||||||
|
|
||||||
|
- **functions** array (*Required*): An array with all used functions.
|
||||||
|
- **name** (*Required*): The name to use in the frontend.
|
||||||
|
|
||||||
|
You can still switch your pins with a web browser or a command line tool. Use the URL http://192.168.1.10/digital/8/1 to set pin 8 to high/on, the JSON response will give you the feedback.
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{"message": "Pin D8 set to 1", "id": "sensor02", "name": "livingroom", "connected": true}
|
{"message": "Pin D8 set to 1", "id": "sensor02", "name": "livingroom", "connected": true}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user