Giter Club home page Giter Club logo

Comments (2)

anklimov avatar anklimov commented on June 15, 2024

There are two kind of devices now: sensors and actuators
Sensors places to "input"
Actuators placed to "items"

Item parameters:

#define I_TYPE 0 //Type of item
#define I_ARG  1 //Chanel-type depended argument or array of arguments (pin, address etc)
#define I_VAL  2 //Latest preset (int or array of presets)
#define I_CMD  3 //Latest CMD received
#define I_EXT  4 //Chanell-depended extension - array 

So this format is extendable for adding new types of actuator

input template:

"pin": { "T":"N", "emit":"MQTT emit topic", item:"out_item", "scmd": "ON,OFF,TOGGLE,INCREASE,DECREASE or value", "rcmd": "ON,OFF,TOGGLE,INCREASE,DECREASE or value", "rcmd":"repeat_command" }

T is bitmask from values:

#define IN_ACTIVE_HIGH   2      // High level = PUSHED/ CLOSED/ ON othervise :Low Level
#define IN_ANALOG         64     // Analog input (for further use)
#define IN_RE                   32     // Rotary Encoder (for further use)
#define IN_PUSH_ON        0      // PUSH - ON, Release - OFF (overrided by pcmd/rcmd) - DEFAULT
#define IN_PUSH_TOGGLE   1      // Every physicall push toggle logical switch  on/off (for further use)

Here some extension needed to threat "generic sensors" like DHT, BMP, NRF24, and even timers

from lighthub.

livello avatar livello commented on June 15, 2024

Lazyhome.ru LightHub controller 12a4cd9 _2018-06-09

from lighthub.

Related Issues (17)

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.