Git Product home page Git Product logo

node-orvibo's Introduction

node-orvibo

Support this project on GratiPay

This package lets you control various Orvibo products from node.js. It's a rewritten separation from my ninja-allone library, but with added RF support.

This library has been tested with an AllOne and two sockets. RF support should work, but is untested because I don't own any RF switches. There is no Kepler support (other than knowing when one is on the network) for the same reason.

Features

  • Learn and play back IR codes using the AllOne IR blaster
  • Use the AllOne to emit RF to control RF light switches
  • Turn WiFi sockets on and off
  • Set up Orvibo devices without needing a smartphone

Supported products

This library supports the S10 and S20 sockets, which is sold under a variety of names, including:

It also supports the AllOne, which is an IR / RF blaster. RF switch support is included, please see PROTOCOL.md for information

If you're looking for a way to control B25 sockets (e.g. the newer sockets), then check out https://github.com/sandysound/orvibo-b25-server which is an open source node.js server that can control B25 sockets. You'll need to redirect DNS traffic for this to work, so see the readme for more information.

If you'd like more information on the Kepler, check out the wiki page

Helping out

This project has come to a standstill, as I'm working on other projects at the moment. If someone would like to assist in the reverse engineering of the Kepler, and possibly the ZigBee unit, please contact me via the email address on my GH profile.

I'm looking for hardware donations. I have the Kepler, AllOne, S20 and RF switches already. If you have other Orvibo hardware you'd like to donate (such as the ZigBee unit or the ZigBee IR sensor), please contact me using the address on my GitHub profile. Likewise, if you'd like to donate money to cover hardware and programming costs, I accept PayPal and Bitcoin. Just head to http://paypal.me/davidgrayPhotography for PayPal, or send me some delicious digital currency with Bitcoin: 34agreMVU8QeHu4cLLPkyw5EYdSKp6NqTV

I'd also love pull requests and forks. As I no longer use my Orvibo products with node.js, my time spent maintaining this package will be low, so by all means raise issues, pull, fork and do whatever you can to help out :)

Usage

Install using npm install --save node-orvibo

See examples/basic/index.js for a near-complete sample. Check PROTOCOL.md for protocol, but also check out this Pastebin for a more complete documentation: http://pastebin.com/TSK4Lu4Q

What's New?

  • 29/03/2016

    • README and PROTOCOL updated with information about the RF switches and basic info about Kepler's message format
    • Basic RF example added to the examples/ folder
  • 31/12/2015

    • Callbacks now implemented code-wide, though events are the best way to be notified
    • Device names that are 16 bytes of "FF" are no longer considered valid names
    • Basic timer support added. Querying a device now returns all the timers for a device, as a moment.js object for manipulation. You can also set timers, but only sockets have been implemented so far
    • Countdown timer (read only) also implemented. When queried, a countdown timer is set using setTimeout() and an event emitted.
  • 27/12/2015

    • You can now set up a device without the WiWo app.
    • PROTOCOL.md updated. Still needs work, but is growing every Day
    • New examples added, and "basic" example updated to emit IR AND RF
    • Various bugfixes, plus new events added

To-Do

  • Add timer support for the AllOne
  • Be able to set countdown timers instead of just reading them.
  • Add Kepler support
  • Go through and clean up / standardize events being emitted
  • Test RF stuff
  • Finish off protocol documentation
  • Include emulator. Use the emulator from ninja-allone if you're desperate.
  • Implement these functions:
    • Rename device
    • Set timezone
    • Set time ("time since manufacture" field is the key)
  • Look in to remote login / TCP connections

node-orvibo's People

Contributors

dotsam avatar grayda avatar haimkastner avatar hlapp avatar isaul32 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

node-orvibo's Issues

Only send setState event/callback on confirmation of state change

Protocol documentation shows that the socket will send a confirmation when it changes state (Message 6463) but currently nothing is done with that message besides a debug log. It would be more useful if calling setState wouldn't fire/callback until this message was received, so that code could continue to call it until it's confirmed as successful.

At the very least, firing another event when 6463 is received would be nice. I can write the pull request for that, but wanted to see if you had any thoughts on the best way to have setState wait for this message as well.

Constant disconnection

I am having some issues trying to control a S20 device. After subscribing to it if I do setState it will fail after sometime, do you have any ideas? Is there any connection I need to keep alive?

Thanks for this nice module!

Why use sleep?

Why use sleep? Perhaps you do without this module in the code?

Kepler calibration

Hello,

I have been following this repo ever since I got my Kepler some months ago, mainly out of frustration with the app. I have never been able to see readings from the unit in my phone, although I was successful assigning an IP, examining the packets I only see the app sending info to a web server related to the Tencent cloud in China but never communicating to the IP assigned to the Kepler in my LAN.

So far so good I thought, I don't care that much if I can't see the values on my phone as long as the alarm still triggers if I have gas or CO in my kitchen. Then one day the gas alarm went off for no reason (I made sure I did not have any leakage) and from then on it's got an offset of 5% all the time, going up to 6% (and hence triggering the annoying beeping) from time to time randomly (the change from 5% to 6% seems to happen when the temperature is lower than 19-18 degrees Celsius).

Long story short: I would like to recalibrate the gas sensor to compensate the 5% offset. So far I've explored two possibilities: hardware and software. I'm sure there must be a way to enter a calibration menu but until now I had no luck finding it. There is a hard reset button but it has no effect in the calibration of the sensor. Opening the unit you find a connector marked P2 that might be used (maybe a JTAG interface) to write firmware into the SoC but there is little information available on this particular chip (MXCHIP MX1081). I wrote an e-mail to Orvibo's support but reading the lousy reviews on Kickstarters I don't fool myself thinking they will care much.

Now I've just started exploring the software avenue but I cannot manage to get much. There seems to be a lot of projects related to the s20 plugs but I think you're the only one working on the Kepler.

Can you please share if you had any progress? Is there anything I can do to help? Reverse engineering the UDP packets is a good start but I'm not sure that would give access to the sensor's calibration.

Based on the number of disgruntled backers I think a small tool to be able to log readings into a home automation system (imagine you have a very small gas leakage that only triggers warnings when you are not home or sleeping) would be very well received. And I could not find a product with similar characteristics (Nest protect or Birdie don't have gas detection, which is a very big issue for me). Besides, the hardware of the Kepler is actually not bad at all (in particular when you look under the hood). It's the software and documentation where it's horribly disappointing.

Well, I would really appreciate if you share your thoughts... thanks!

Failed at the [email protected] install script 'node-gyp rebuild'.

i just ran "npm install --save node-orvibo" on my Win7 x64 PC and I received this error. I'm new to node so I'm not sure how to proceed with debugging this error.

The full contents of what happened are:

C:\Users\George>npm install --save node-orvibo
\
> [email protected] install C:\Users\George\node_modules\node-orvibo\node_modules\sleep
> node-gyp rebuild


C:\Users\George\node_modules\node-orvibo\node_modules\sleep>if not defined npm_config_node_gyp (node "D:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node  rebuild )
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
TRACKER : error TRK0005: Failed to locate: "CL.exe". The system cannot find the file specified. [C:\Users\George\node_modules\node-orvibo\node_modules\sleep\build\node_sleep.vcxproj]


gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (D:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:269:23)
gyp ERR! stack     at ChildProcess.emit (events.js:110:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:1074:12)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "node" "D:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\George\node_modules\node-orvibo\node_modules\sleep
gyp ERR! node -v v0.12.7
gyp ERR! node-gyp -v v2.0.1
gyp ERR! not ok
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "D:\\Program Files\\nodejs\\\\node.exe" "D:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "--save" "node-orvibo"
npm ERR! node v0.12.7
npm ERR! npm  v2.11.3
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the sleep package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls sleep
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\George\npm-debug.log

C:\Users\George>npm install --save node-orviboFailed at the [email protected] install script 'node-gyp rebuild'.

Example not working in Docker container

My setup is:

  • Windows 7
  • Docker version 1.9.1, build a34a1d5

I have used Docker to try and avoid having to install a C++ SDK, which seems to be required to compile the sleep library (using node-gyp?).

This is the Docker command I use to start a Node container:

docker run -it --rm --name node-orvibo -p 10000:10000/udp -p 9999:9999/udp -p 48899:48899/udp node:6 /bin/bash

I then run these commands from within the Docker container:

git clone https://github.com/Grayda/node-orvibo.git
cd node-orvibo/
npm install
cd examples/basic/
DEBUG=Orvibo node index.js

And this is the output from running the example program:

root@969a26ad1f72:/node-orvibo/examples/basic# DEBUG=Orvibo node index.js
  Orvibo Preparing connection and listening +0ms
  Orvibo Socket bound to port +14ms 10000
  Orvibo Broadcast set to true +2ms
  Orvibo Socket bound to port +1ms 9999
  Orvibo Broadcast set to true +1ms
  Orvibo Socket bound to port +0ms 48899
  Orvibo Broadcast set to true +1ms
  Orvibo Discovery packet sent +993ms
  Orvibo Message sent to 255.255.255.255:10000 with length 6 +3ms
  Orvibo Message received +3ms 686400067161 { address: '172.17.0.1', family: 'IPv4', port: 53351, size: 6 }
  Orvibo Parsing incoming message. Command ID is: +19ms 7161
  Orvibo Found something else: +1ms
  Orvibo Discovery packet sent +985ms
  Orvibo Message sent to 255.255.255.255:10000 with length 6 +1ms
  Orvibo Message received +1ms 686400067161 { address: '172.17.0.1', family: 'IPv4', port: 53351, size: 6 }
  Orvibo Parsing incoming message. Command ID is: +0ms 7161
  Orvibo Found something else: +1ms
  Orvibo Discovery packet sent +1s

From looking at the code that handles the 7161 command, it seems that my message is far too small. The code referenced uses substring such as message.substr(62, 6), but my message is seemingly only 12 characters in length.

Do you have any ideas? Thanks.

Newer Orvibo Smart Sockets

Do you know if this plugin will support the newer smart sockets? I think the model is B25, I have been trawling various places for an answer on this and can't find resolution anywhere and as someone who is diffo not a coder I'm struggling but really want to make use of this with my Sockets!

cant save node

npm install --save node-orvibo
npm WARN install Refusing to install node-orvibo as a dependency of itself

regards

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.