alexryd / node-shellies

Handles communication with Shelly devices
MIT License
36 stars 13 forks source link

node-shellies

NPM Version Build Status

Handles communication with the first generation Shelly devices, using both CoAP and HTTP.

For the next generation devices, see node-shellies-ng.

Features

Supported devices

The following Shelly devices are supported:

Notes

1 Requires setting the Internet & Security -> CoIoT -> Remote address option on the Shelly device to the IP address of your device running node-shellies.

Basic usage example

const shellies = require('shellies')

shellies.on('discover', device => {
  // a new device has been discovered
  console.log('Discovered device with ID', device.id, 'and type', device.type)

  device.on('change', (prop, newValue, oldValue) => {
    // a property on the device has changed
    console.log(prop, 'changed from', oldValue, 'to', newValue)
  })

  device.on('offline', () => {
    // the device went offline
    console.log('Device with ID', device.id, 'went offline')
  })
})

// start discovering devices and listening for status updates
shellies.start()