GithubHelp home page GithubHelp logo

chrisns / iot-zwave Goto Github PK

View Code? Open in Web Editor NEW
3.0 5.0 0.0 2.41 MB

License: MIT License

JavaScript 93.43% Dockerfile 6.57%
aws-iot docker zwave zwave-controller zwave-network zway-mqtt mqtt mqtt-client iot aws

iot-zwave's Introduction

Z-Wave AWS-IOT Bridge/Gateway

Greenkeeper badge

To carry out system activities

Publish to $aws/things/zwave/shadow/update (or update the thing shadow)

{
  "state": {
    "desired": {
      "X": "Y"
    }  
  }
}

Where X is one of:

  • secureAddNode
  • healNetwork
  • addNode
  • cancelControllerCommand
  • removeNode
  • softReset

And Y is anything different, you might like to use the timestamp of when you did it. When this has been received and actioned you will be able to see the same thing published in the thing shadow or to $aws/things/zwave/shadow/update

{
  "state": {
    "reported": {
      "X": "Y"
    }  
  }
}

Usage

Starting up

Docker

docker run \ 
    --device=/dev/ttyACM0 \
    -e DEVICE=/dev/ttyACM0 \
    -e AWS_ACCESS_KEY_ID=XXX \
    -e AWS_SECRET_ACCESS_KEY=XX \
    -e AWS_IOT_ENDPOINT_HOST=XX \
    -e AWS_REGION=eu-west-2 \
    -e ZWAVE_NETWORK_KEY=XX \
    chrisns/iot-zwave

Node

git clone [email protected]:chrisns/iot-zwave
cd iot-zwave
npm i
DEVICE=/dev/ttyACM0 \
AWS_ACCESS_KEY_ID=XXX \
AWS_SECRET_ACCESS_KEY=XX \
AWS_IOT_ENDPOINT_HOST=XX \
AWS_REGION=eu-west-2 \
ZWAVE_NETWORK_KEY=XX \
npm start

Z-wave Key

Use the random.org generator to get a fresh set of 16 random hex numbers but don't forget to add the "0x" prefix and the commas.

It should look something like: 0x97,0x81,0x18,0x90,0xd3,0x57,0xac,0x93,0xa2,0x20,0x9c,0x91,0x6d,0x83,0x17,0xcb

General usage

This will make a thingshadow for each of your zwave devices.

The name is zwave_x_n where x is the homeid and n is the node id.

So for example I have a Aeotec by Aeon Labs ZW120 Door / Window Sensor that reports:

{
  "reported": {
    "system": {
      "Powerlevel": "Normal",
      "Application Version": "1.05",
      "Test Status": "Failed",
      "Acked Frames": 0,
      "Timeout": 0,
      "ZWave+ Version": 1,
      "Frame Count": 0,
      "InstallerIcon": 3078,
      "Library Version": "3",
      "Maximum Wake-up Interval": 16777200,
      "Default Wake-up Interval": 0,
      "UserIcon": 3078,
      "Test Node": 0,
      "Test Powerlevel": "Normal",
      "Minimum Wake-up Interval": 0,
      "Wake-up Interval Step": 240,
      "Wake-up Interval": 0,
      "Protocol Version": "4.05"
    },
    "config": {
      "Interval time of battery report": 0,
      "Report type": 256,
      "Basic Set Report": "Open: 0xFF, Close: 0x00",
      "Sensor Binary Report": "Open: 0xFF, Close: 0x00",
      "Enable wake up 10 minutes when re-power on the sensor": "Enable",
      "Set the low battery value": 18,
      "Reset To Factory Defaults": "Normal"
    },
    "user": {
      "SourceNodeId": 0,
      "Sensor": true,
      "Alarm Type": 0,
      "Burglar": 254,
      "Battery Level": 74,
      "Access Control": 254,
      "Alarm Level": 0
    },
    "basic": {
      "Basic": 255
    }
  }
}

If you update the shadow in desired with the same path, this app will do it's best to make that reality and report it back when it's done. Sleeping nodes can see that take quite a while.

Because Amazon IOT inflicts a 8kb limit on the payload I can't put all the nice helpful content that openzwave provides like what are valid values, and help text to accompany these values, or even what is read only.

Pre-requisites

  • You will need to make a Thing Type with the name zwave. you don't need to add attributes but I added manufacturerid, productid, producttype to mine so I can filter by those things.

Known limitations

Currently make an awful lot more calls to AWS than I need to, this should really be batched up by maybe a few ms

Known vulnerabilities

The app open a telnet interface on port 8888 that will allow arbitary execution of code scoped to the zwave object, though would be trivial to break out of that, so DO NOT EVER EVER EVER expose that port to anything that could connect to it that's not you!

TODO

These are features I'd like to provide, but feel free to chip in

  • read zwave config
  • write zwave config
  • read zwave basic status
  • write zwave basic status
  • create things on demand
  • handle soft resetting controller
  • handle adding insecure nodes
  • handle adding secure nodes
  • handle removing nodes
  • handle multiple controllers, sharing configuration and handing over between them
  • provide some way to set scenes up
  • provide some way to set associations up
  • provide some way to set buttons up
  • provide some way to set polling up
  • Docker
  • toggler of binary switches (useful for alerts)
  • support over 50 zwave things (will need to have multiple connections to aws iot)
  • Arm docker image (for Raspberry PI support)
  • Support multiple z-wave networks - handy if you have multiple networks for:
    • Desire to support different frequency ranges maybe EU, US, JP to support different devices
    • Multiple physically distant locations
    • Desire for seperation of concerns for security - e.g. a network for lights and another for security devices
    • All AWS IoT things will be zwave_$homeid_$nodeid

Contributions

Pull Requests welcome

iot-zwave's People

Contributors

chrisns avatar dependabot-preview[bot] avatar dependabot[bot] avatar greenkeeper[bot] avatar the-repository-manager[bot] avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

iot-zwave's Issues

An in-range update of aws-sdk is breaking the build 🚨

The dependency aws-sdk was updated from 2.350.0 to 2.351.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

aws-sdk is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • ❌ continuous-integration/drone/push: the build failed (Details).

Release Notes for Release v2.351.0

See changelog for more information.

Commits

The new version differs by 3 commits.

  • 70cbaa7 Updates SDK to v2.351.0
  • 4073d3d Merge pull request #2342 from srchase/npmignore-additions
  • 13b0dd3 updated npmignore, fix for issue #2341

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

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.