gpio-rest-api-server

command module
v0.0.0-...-6d9d113 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 5, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

README

GPIO rest api server

Activate and deactivate gpio pins

Rest-api schema

POST '{"active":true}' /gpios/{GPIO_PIN_ID}
GET /gpios/{GPIO_PIN_ID}, response: {"is_active":true}

Integrate with home-assistant

switch:
  - platform: rest
    name: GPIO2
    resource: http://{GPIO_REST_API_SERVER_ADDR}/gpios/2
    body_on: '{"active": true}'
    body_off: '{"active": false}'
    is_on_template: "{{ value_json.is_active }}"
    headers:
      Content-Type: application/json
    verify_ssl: false

Requirements:

Tested and working on:

  • Raspberry Pi 3 Model B Rev 1.2 (Raspbian GNU/Linux 10 (buster))

Flags:

Usage of ./gpio-api:
  -dbfile string
    	Set db file (default "./gpio.db")
  -listen-port int
    	Set http server listen port (default 8081)
  -recovery
    	Recovery gpio state at start

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL