@lucavb/shellies-ds9
v1.1.9
Published
Handles communication with the next generation of Shelly devices
Maintainers
Readme
node-shellies-ds9
About This Fork
This is a fork of imuab/node-shellies-ds9, created to include device support that wasn't merged upstream.
Why This Fork Exists
The imuab repository had a pull request for Shelly Plug S Gen 3 EU support that didn't get merged. This fork includes that support along with additional device compatibility for:
- Shelly Plus 1 Mini
- Shelly Plus 1 PM Mini
- Shelly Plus PM Mini
- Shelly Plug S Gen 3 EU
This fork is specifically maintained for Homebridge compatibility where these devices are essential.
Installation
npm install @lucavb/shellies-ds9About
Handles communication with the next generation of Shelly devices.
Supported devices
- Shelly Plus 1 + V3
- Shelly Plus 1 PM + V3
- Shelly Plus 1 Mini + V3
- Shelly Plus 1 PM Mini + V3
- Shelly Plus PM Mini + V3
- Shelly Plus 2 PM
- Shelly Plus I4 +V3
- Shelly Plus Plug S
- Shelly Plus Plug US
- Shelly Plus Plug UK
- Shelly Plus Plug IT
- Shelly Plus H&T +V3
- Shelly Plus 0-10V Dimmer
- Shelly Plug S Gen3 EU
- Shelly Dimmer 0/1-10V PM
- Shelly Dimmer
- Shelly Pro 1
- Shelly Pro 1 PM
- Shelly Pro 2
- Shelly Pro 2 PM
- Shelly Pro 3
- Shelly Pro 4 PM
- Shelly Pro Dual Cover PM
- Shelly Pro Dimmer 1PM
- Shelly Pro Dimmer 0/1-10V PM
- Shelly Pro Dimmer 2PM
1 Support for outbound websockets is a work in progress.
Basic usage example
import { Device, DeviceId, MdnsDeviceDiscoverer, Shellies, ShellyPlus1 } from '@lucavb/shellies-ds9';
const shellies = new Shellies();
// handle discovered devices
shellies.on('add', async (device: Device) => {
console.log(`${device.modelName} discovered`);
console.log(`ID: ${device.id}`);
// use instanceof to determine the device model
if (device instanceof ShellyPlus1) {
const plus1 = device as ShellyPlus1;
// toggle the switch
await plus1.switch0.toggle();
}
});
// handle asynchronous errors
shellies.on('error', (deviceId: DeviceId, error: Error) => {
console.error('An error occured:', error.message);
});
// create an mDNS device discoverer
const discoverer = new MdnsDeviceDiscoverer();
// register it
shellies.registerDiscoverer(discoverer);
// start discovering devices
discoverer.start();See homebridge-shelly-ng for a real-world example.
Credits
This fork builds upon the excellent work of:
- imuab - Maintained the upstream fork that this is based on
- Alexander Rydén - Original node-shellies author
Special thanks to the Shelly community and all contributors who have made this ecosystem possible.
