Giter VIP home page Giter VIP logo

sensormap's Introduction

Sensor Map Demo

Set Up

Prerequisites

  • Python3.6+
  • Gravio Hubkit

Setting up the Server

  1. Ensure that Hubkit is up and running and has the following 11 Areas set up. You can have as many or as few as you like, but the names must be exact matches.

    • Scorpio
    • Libra
    • Leo
    • Aries
    • Sagittarius
    • Capricorn
    • Taurus
    • Gemini
    • Cancer
    • Aquarius
    • Pisces
  2. Each room can have the following layer types. Set up as many or as few as you like. Other layer types are ignored.

    • Aqara-Humidity
    • Aqara-Temperature
    • Aqara-SingleButton
    • Aqara-Occupancy

    For example:

  3. Ensure the devices are properly bound to each layer, and enabled.

  4. There is no need to add any Triggers, or Actions. Fetching of data is handled automatically by the Python server.

Running the Server

  1. Take note of your Hubkit's IP Address. If running on the same machine, ignore this step.

  2. Open up a terminal, navigate to the source folder and run the following:

    python3 echo3.py

    or

    python3 echo3.py --port {port} --bind {bindurl} --url {hubkiturl}

Be default the server launches on localhost:8081

Architecture

Client

Graphics

The layout is currently a hardcoded SVG path found under the AddFloor() method. In the future, loading from an actual SVG file would be preferred.

Settings Variables

Server ping happens every 5 seconds, adjustable via the src/main.js:FETCH_LATEST_FROM_SERVER_SECS parameter.

The Occupancy Sensor has an automatic timeout built into it, by default set to 2 * FETCH_LATEST_FROM_SERVER_SECS, or 10 seconds. This ensures that the sensor will remain active between server pings. This field is available src/main.js:OCCUPANCY_TIMEOUT_SECS.

Server

sensormap's People

Contributors

0xnf avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

sensormap's Issues

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.