gms1 / casanet-server

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.

Philosophy.

In this project, I came to solve a number of troublesome. first of all, anyone who uses a number of smart devices (smart IR, smart socket, or anything like that) of different companies knows the problem of dealing with a number of different applications, hold 10 applications for each home appliance that 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 about why it does not work.

And the biggest thing is a security issue, I don't want to trust any company code/server in my home. I want to use open-source only. when I can make sure that no one tracks me or any other malicious code runnig 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 and clear and easy to access API. and it runs on a computer (or any other device that can run node.js, tested on Windows 10 and Linux Ubuntu) at home and does not require connection 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 for each physical device 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 built to be multi-Language support.

Current Languages supported:

  • English
  • Hebrew

Any support for other languages will be welcome.

How to use it?

How to access casanet from wide internet?

The server needs to run on local home network, so how to access it via internet?

Method 1: Port forwarding

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

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

Method 2: Using casa remote server

The casa remote server is built for it, 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.
    • Color.
    • 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 will be welcome, see modules.

Using scenario

  • Buy new supported smart devices or use the mock brand.

  • Connect it to local network via official app.

  • Scan the local network to find the new device. Screenshot

    And give a name for the device (optionally). Screenshot

  • Create a new minion** from the device. Screenshot

  • Say hello to the new minion and change the current status ;)

  • Create a new operation. Screenshot

  • Create new timing that invoked the created operation Screenshot

  • Enjoy.

To watch full API specs use swagger UI and put https://raw.githubusercontent.com/casanet/casanet-server/master/backend/swagger.yaml in explorer input.

** Minion is a logic device in the system, meaning that a device is a physical device and minion is a logic device that uses a physical device to switch home kit status. For example, an IR transmitter can be one physical device for a few minions, one to central AC control and second for secondary AC control so in it will be two totally different minions that use one physical device.

IFTTT integration

The IFTTT ecosystem is great ;). Now, invoking trigger 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 casa-net server accessible via public internet or via a remote server.

Invoking trigger when a device turned on/off the local server require an internet connection.

See step by step instraction 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 suggestion or help feel free to contact me.

Casanet image

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 image for several devices.

Username: root \ casanet Password: casa-net. All configured to run the server on boot in port 80. The server runs on tmux window named "casanet".

Credits

Shared with ❤️ by kastnet.


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


About

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

License:GNU Affero General Public License v3.0


Languages

Language:TypeScript 71.2%Language:JavaScript 16.9%Language:HTML 9.7%Language:CSS 2.1%Language:Dockerfile 0.1%