Skip to content

Latest commit

 

History

History
100 lines (68 loc) · 1.8 KB

readme.md

File metadata and controls

100 lines (68 loc) · 1.8 KB

SmartHouse Server

v 1.2

SmartHouse Server is a typical HTTP server, but for handling smart devices and sensors. Easy to install and maintain, you can register your devices, set statuses for them, etc.

Default ports:

  • 8080 for main server
  • 8008 for startup server

Installation process

You need following programs be installed:

  • Cmake
  • Conan pakage manager

Linux:

  • ./unix-install.sh from root folder

From Windows:

  • ./windows-install.cmd

If you want to manage smarthouse server remotely you also need pyton3:

  • python3 ./startupServer.py

API Documentation

  • device accept: GET, PUT, POST, DELETE, OPTIONS

  • id - get device by id

  • name - name of device

  • status - status of device by which you can control behavior of device

Device list:

  • smokeSensor possible status: smokeNOTDetected, smokeDetected
  • waterSensor possible status: floodNOTDetected. flodoDetected
  • window possible status: open, closed
  • light possible status: off, on
  • smartDevice possible status: off, on
  • oven possible status: off, on
  • tap possible status: closed, opened
  • garageDoors possible status: closed, opened

Exampple:

GET /device

all devices in JSON

GET /device?id=0

device with id 0 { "id": "0", "name": "smokeSensor", "status": "smokeNOTDetected" }

PUT /device?id=1

you can update any field of device except id { "status": "smokeDetected" }

GET /logs

returns all type of logs use type parameter for filtering specific logs Logs types:

  • information
  • error
  • warning

Managing server

we are using small python server for managing main server

Use port 8008 to manage main server

  • start start main server
  • stop stop main server
  • restore restore db