aREST Switch


The arest switch platform allows you to toggle pins of your devices (like Arduino boards with an Ethernet/Wifi connection, ESP8266 based devices, and the Raspberry Pi) running the aREST RESTful framework.

To use your aREST enabled device with pins in your installation, add the following to your configuration.yaml file:

# Example configuration.yaml entry
switch:
  - platform: arest
    resource: http://IP_ADDRESS
    pins:
      11:
        name: Fan
      13:
        name: Switch
        invert: True

If you want to use custom functions, then add the following to your configuration.yaml file:

# Example configuration.yaml entry
switch:
  - platform: arest
    resource: http://IP_ADDRESS
    name: Office
    functions:
      function1:
        name: Light Desk

Configuration Variables

resource

(string)(Required)IP address and schema of the device that is exposing an aREST API, e.g., http://192.168.1.10 (no-trailing slash)

name

(string)(Optional)Let you overwrite the name of the device. By default name from the device is used.

pins

(map)(Optional)An array with all used pins.

name

(string)(Required)The name of the pin to use in the frontend.

invert

(boolean)(Optional)If the logic for on/off should be inverted.

Default value: false

functions

(map)(Optional)An array with all used functions.

name

(string)(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.

{"message": "Pin D8 set to 1", "id": "sensor02", "name": "livingroom", "connected": true}