Skip to content

Gitmanik/GitHome

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GitHome

GitHome is a Personal SmartHome solution written in pure PHP and C++ with some Python for comprehensive home automation. Screenshot

Overview

GitHome provides a platform for connecting and managing various smart home devices and sensors.

It uses PHP as core with MySQL for persistence and C++ for the endpoint functionality.

Features

Installation

Prerequisites

  • A server

Setup

Using Docker Compose:

version: '3.1'

services:
  server:
    image: ghcr.io/gitmanik/sh_server:master
    restart: always
    ports:
      - 80:80
    environment:
      MYSQL_USER: username
      MYSQL_PASSWORD: password
      MYSQL_SERVER: db
      MYSQL_DB: smarthome
    volumes:
      - ./data:/data:rw
  db:
    image: mariadb
    restart: always
    ports:
      - 3306:3306
    volumes:
      - ./db:/var/lib/mysql
    environment:
      MARIADB_ROOT_PASSWORD: password
      MYSQL_USER: username
      MYSQL_PASSWORD: password

As of today, GitHome does not support automatic database creation. You need to create structure given below yourself.

CREATE TABLE `cron` (
  `id` int(11) NOT NULL,
  `name` text NOT NULL,
  `code` text NOT NULL
);

CREATE TABLE `devices` (
  `id` text NOT NULL,
  `handler` text NOT NULL,
  `firmware` text DEFAULT NULL,
  `name` text NOT NULL,
  `version` int(11) DEFAULT NULL,
  `lastReportTimestamp` timestamp NULL DEFAULT NULL,
  `lastReportIP` text DEFAULT NULL,
  `data` text NOT NULL
);

CREATE TABLE `firmware` (
  `name` text NOT NULL,
  `version` int(11) NOT NULL,
  `file` mediumblob DEFAULT NULL,
  `id` int(11) NOT NULL AUTO_INCREMENT,
  PRIMARY KEY (`id`)
);

CREATE TABLE `logs` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `level` int(11) NOT NULL DEFAULT 0,
  `date` datetime NOT NULL DEFAULT current_timestamp(),
  `device_id` varchar(32) NOT NULL,
  `data` text NOT NULL,
  PRIMARY KEY (`id`)
);

CREATE TABLE `redirect` (
  `id` varchar(100) NOT NULL,
  `target` text NOT NULL,
  PRIMARY KEY (`id`)
);

CREATE TABLE `temperature` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `date` timestamp NOT NULL,
  `sensor` text NOT NULL,
  `value` text NOT NULL,
  PRIMARY KEY (`id`)
);

Configuration

GitHome can be configured using configuration panel located at /config alt text

About

Personal SmartHome written in pure PHP and C++ for endpoints

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors 2

  •  
  •