Git Product home page Git Product logo

smarthomephp's Introduction

Smart Home

This is core center for Solomaha Home system. Includes Web Panel and API.

Site built on Yii2 Framework, WebSocket server on Ratchet PHP

Main server built over WebSocket Server and references to SmartHome Message Protocol.

Author: Alex Solomaha [email protected]

Feel free to contribute!

FEATURES

  • Real time via WebSocket protocol
  • Universal Admin Panel for creating Items, managing Boards, configure application, etc
  • Event system with multiple conditions and tasks
  • HTTP REST API
  • Web Panel for any device

REQUIREMENTS

  • PHP >= 5.4.0
  • At least 1 open port for websockets (8081)

INSTALLATION

Get project files:

git clone https://github.com/CyanoFresh/SmartHome
cd SmartHome
composer install
php init

Configure DB in config/db-local.php and run:

php yii migrate

To start the Main server:

php yii start-core-server

Enable WSS

Install and enable proxy module:

a2enmod proxy_wstunnel

Add this lines in the secured host conf body:

ProxyPreserveHost On
ProxyPass /wss ws://127.0.0.1:8081
ProxyPassReverse  /wss ws://127.0.0.1:8081

Where 8081 is your server's port

smarthomephp's People

Contributors

cyanofresh avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

smarthomephp's Issues

New logos

New logo, favicon, rebranding, social media optimization

Permission control

Разграничение прав

  • Разрешить доступ к админпанели только администраторам
  • Изменять значение элемента только определенным пользователям или API

Logging

Use custom logger and log level for better logging feature

Also need logging for #35

History refactor

  • Add filter by history type
  • Add filter by other fields depending on type
  • Refactor message

Only after #40

Ping-pong loss

Boards disconnect after no pong command, but they send it

Refactor Events

Event - entity, triggered by item/time/api. Triggers Task
Task - entity, triggered by Event(s) (many to many). Triggers actions
Action - entity(ies), triggered by Task (many to many).. Changes item value/sends noti.

Events

Trigger events when item value or smth else

Better API

Implement REST API for this actions:

  • Item state
  • Triggers
  • Get Item Value
  • System (Panel) Actions

Conditions for Triggers

Add several conditions for logical AND IF. Should be connected to the Event by many-to-many.

e.g. If item state is 1 and now is Sunday

Only after #38

Refactor Triggers to Events

Events can be triggered by time, item value, api call. So if item state changes - it is event, not a trigger

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.