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

bobitza/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 ๐Ÿ˜Š

CASANET

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

CI CD Status Coverage Status

The latest release binaries available to download from casanet-server releases

Philosophy

This project aims to resolve a number of issues plaguing most Smart Home systems

  • Lack of common interfaces: Anyone who uses a number of smart devices (smart IR, smart sockets or anything of that kind) of different brands is familiar with the problem of having to deal with completely different applications, authentication methods, timings, operations etc. for each device.

  • Reliability & Stability: To control home appliances from the internet, the devices communicate with the manufacture's servers, some of which belong to small companies that may "come and go" or have downtime issues. Client side service issues are also notoriously difficult to diagnose and resolve.

  • Accessibility: Although that there is no good reason to disallow control of home appliances directly from the local network, most commercial home appliances allow control only via the manufacturer's servers, therefore rendering the device inoperable, (even from inside the LAN!) in case of connectivity issues.

  • Security: The biggest problem with commercial IOT is security. We definitely do not want to entrust our home to any code produced by an IOT manufacturer as they are known for making some of the most insecure and dubious systems in existence. We want to use vetted, battle-tested and privacy oriented open-source assets in order to ensure the devices do not turn rouge or outright malicious. We want the ability to isolate our devices from the outside world whilst retaining all (or most) capabilities.

As a solution to these problems, this project consolidates all the smart home appliances into one simple, clear and easy to access API.

The Casanet server can run on any computer type (x86, ARM) at home and does not required an internet connection to operate.

The Casanet server design is to manage abstract world devices and a collection of modules ("drives") for each physical device kind, to convert to/from an abstract device state to/from the physical device.

This allows to easily add support in vast devices kinds, and separately, control all of them in one dashboard, same timing/operation abilities and even open an easy to use modern API.

Each module/driver design to work only through a local network, let us disconnect the device for good from the internet.

The Mobile Application

Get it on Google Play

The dashboard Android application assets (APK/AAB) also available here.

The Web Dashboard

โœจโœจโœจ Live Demo Dashboard โœจโœจโœจ

Screenshot

The Mobile Dashboard

app1-dashboard app2-dashboard app3-dashboard

For more details and information about the web & mobile interface see dashboard-app repository.

The Web Lightweight Dashboard

The (very) lightweight dashboard (only about 20kb of total assets) for old phones or very slow networks.

For the lightweight interface navigate to [server-ip/host]/light-app/index.html.

Screenshot

For more details and information about the lightweight interface see lightweight-dashboard repository.

For the legacy dashboard see frontend-v3 repository.

Running Casanet server on a local computer

To make it easy to use there are ready-to-use binaries here just download the binary file (depend on your OS) and the casanet.json configuration file and run the executable file.

It's recommended to read the configuration section here.

In order to set up Linux from scratch see Linux deployment tutorial for a Linux based devices (for raspberry pi etc.)

Project parts + technologies

  • Casanet server:
    • Purpose: Control the IoT devices in a local home network.
    • Technologies: Node.js (using TypeScript + TSOA).
  • Dashboard:
    • Purpose: Hybrid dashboard for web & mobile to control the IoT devices (using Casanet server API).
    • Technologies: react v17 (with mui v5) and cordova.
  • Remote server:
    • Purpose: Forward API requests from the wide internet to the local Casanet servers.
    • Technologies: Node.js (using TypeScript + TSOA + PostgreSQL).
  • Remote dashboard:
    • Purpose: Management dashboard for the remote server admin (using remote server API)
    • Technologies: Vue.js (using vue material).
  • RF commands repository:
    • Purpose: Light-weight server to keep and serve RF commands (such as: IR, 433 MHz etc.) for appliances.
    • Technologies: Python 3.10.5 (using Flask + Mongodb).
  • API (for local and remote server):

Dashboard languages support

The UI is designed to support multi-Language using i18.

Current supported Languages:

  • English
  • Hebrew

Any support for other languages will be welcome.

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

    • SP2, SP3, SP4 (socket). link
    • RM3 mini 3 / RM4 mini (As AC). link
    • RM Pro / RM4 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 (Rest API)

  • Mock (for testing purpose)

    • Toggle demo.
    • Switch demo
    • Air-conditioning demo.
    • Light demo.
    • Temperature light demo.
    • Color light demo.
    • Roller demo.
    • Temperature Sensor.
  • #MQTT module MQTT drivers documentation.

    • Supported types:
      • Toggle.
      • Switch.
      • Air-conditioning.
      • Light
      • Temperature light.
      • Color light.
      • Roller.
    • Supported drivers:
      • Tasmota (MQTT API)

        • Switch (tested with this and this)
        • Color Bulb (tested with this)
      • Shelly (MQTT API)

        • Button1 - (tested with this)
        • Switch 1PM - (tested with this)
        • Duo - RGBW - (tested with this)
        • Temperature Sensor AddOn - (tested with this)

Connecting devices

How to connect a device to the local network and how to add it to be managed by the casa-net server?

see here the brands modules documentation.

Adding other devices support

Yes, it is possible and it's welcomed! see modules documentation.

API

The full specs of API are documented in SwaggerHub.

To try it out against the demo mock server go to casanet-mock-server docs

For a running Casanet server use Swagger UI to make API calls in the [local server IP]/docs URL.

The casanet server tested on

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

Contributing

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.

Privacy Statement

This project doesn't include any type of data collection and tracking, all data is stored only in the machine where the server runs inside.

Keep the machine safe and secure to keep your data in your hands only.

Using this server is own your own risk, and could contain sensitive data such as your users' email, name, devices key, etc.

Please secure your network, server machine, and your data :)

By using this project you agree to the privacy policy please read it carefully.

License

This application is an open-source code, under the GNU license.

In addition to the GNU terms of the license, any non-personal use requires full credit in a prominent position in the interface including a link to this page and https://casanet.biz/

ื‘ื ื•ืกืฃ ืœืชื ืื™ ื”ืจื™ืฉื™ื•ืŸ ืฉืœ GNU, ื›ืœ ืฉื™ืžื•ืฉ ืœื ืื™ืฉื™ ืžืฆืจื™ืš ืงืจื“ื™ื˜ ืžืœื ื‘ืžื™ืงื•ื ื‘ื•ืœื˜ ื‘ืžืžืฉืง ื›ื•ืœืœ ืงื™ืฉื•ืจ ืœืขืžื•ื“ ื–ื” ื•ืœ https://casanet.biz/

Credits

Shared with โค๏ธ by kastnet.

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 98.0%
  • JavaScript 1.9%
  • Shell 0.1%