Skip to content

Goira - Go Infrared API and application for controlling home appliances with NEC protocol

License

Notifications You must be signed in to change notification settings

illuminati1911/goira

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Goira - Go Infrared API

Build Status Go Report Card Documentation Maintenance License: MIT

Goira (Go Infrared API) is a go backend for Raspberry Pi, which exposes API routes to control GPIO connected infrared LED's. Currently Goira only supports controlling air conditioners.

Features

  • Uses IRBlaster linux kernel driver to manage the IR transmission
  • Exposes Restful API
  • Only password authentication

Limitations

  • No HTTPS yet.
  • Limitations of the IRBlaster kernel driver
  • AC Config to binary mapping has to be made specifically for each AC manufacturer. See: goira/internal/accontrol/mappers/
  • By default only supports ChangHong AC's

Tech stack

Installation

First, make sure you have installed IRBlaster kernel driver.

You can use the GNU make to build just the backend service or both front-end and backend.

$ make build     #build just the backend 
$ make frontend  #build just the front-end
$ make full      #build both front-end and backend

Resulting binary and front-end files will be placed in the build folder.

Usage

After you run the binary, server will start at localhost:8080.

If the frontend has been installed, open http://localhost:8080/ to access the web app.

API

Login

  • Type: POST
  • Route: /login
  • Parameters:
{
  "password": <password_here>
}
  • Response: 200 OK for successful login

Get AC state

  • Type: GET
  • Route: /status
  • Response 200 OK for success with body (example):
{
  "temp": 20,      #20 celcius
  "wind": 0,       #wind mode 0
  "mode": 0,       #ac mode 0
  "active": false  #turned off
}

Set AC state

  • Type: POST
  • Route: /state
  • Parameters (example):
#example 1
{
  "temp": 29,
  "active": false,
  "mode": 2
}

#example 2
{
  "active": true
}
  • Response 200 OK for success

Contributing

  • Pull requests are welcome.
  • For major changes, please open an issue first to discuss what you would like to change.
  • Remember to use gofmt to format the code before making the pull request.

Roadmap

Near future

  • Multiple manufacturer support (Hitachi etc.)

Some day

  • Support for other kinds of IR devices.

References

License

MIT

About

Goira - Go Infrared API and application for controlling home appliances with NEC protocol

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published