From 103f1dfbaab3165cb9ef0a5c8c4a146f00f5219f Mon Sep 17 00:00:00 2001 From: Giullian Franke Date: Mon, 5 Jan 2026 10:28:46 +0100 Subject: [PATCH 1/2] Adding Shelly Plus RGBW PM --- src/devices/index.ts | 43 ++++++++++---------- src/devices/shelly-plus-rgbw-pm.ts | 64 ++++++++++++++++++++++++++++++ 2 files changed, 86 insertions(+), 21 deletions(-) create mode 100644 src/devices/shelly-plus-rgbw-pm.ts diff --git a/src/devices/index.ts b/src/devices/index.ts index ff7e3270..2870b344 100644 --- a/src/devices/index.ts +++ b/src/devices/index.ts @@ -1,22 +1,23 @@ -export * from "./base"; +export * from './base'; -export * from "./shelly-plus-1"; -export * from "./shelly-plus-pm"; -export * from "./shelly-plus-1-pm"; -export * from "./shelly-plus-2-pm"; -export * from "./shelly-plus-ht"; -export * from "./shelly-plus-i4"; -export * from "./shelly-plus-plug"; -export * from "./shelly-pro-1"; -export * from "./shelly-pro-1-pm"; -export * from "./shelly-pro-2"; -export * from "./shelly-pro-2-pm"; -export * from "./shelly-pro-3"; -export * from "./shelly-pro-4-pm"; -export * from "./shelly-pro-dimmer-1-pm"; -export * from "./shelly-pro-dimmer-2-pm"; -export * from "./shelly-pro-dimmer-2-pm"; -export * from "./shelly-pro-dual-cover-pm"; -export * from "./shelly-plus-dimmer-pm"; -export * from "./shelly-plus-dimmer"; -export * from "./shelly-gen3-2-pm"; +export * from './shelly-plus-1'; +export * from './shelly-plus-pm'; +export * from './shelly-plus-1-pm'; +export * from './shelly-plus-2-pm'; +export * from './shelly-plus-ht'; +export * from './shelly-plus-i4'; +export * from './shelly-plus-plug'; +export * from './shelly-plus-rgbw-pm'; +export * from './shelly-pro-1'; +export * from './shelly-pro-1-pm'; +export * from './shelly-pro-2'; +export * from './shelly-pro-2-pm'; +export * from './shelly-pro-3'; +export * from './shelly-pro-4-pm'; +export * from './shelly-pro-dimmer-1-pm'; +export * from './shelly-pro-dimmer-2-pm'; +export * from './shelly-pro-dimmer-2-pm'; +export * from './shelly-pro-dual-cover-pm'; +export * from './shelly-plus-dimmer-pm'; +export * from './shelly-plus-dimmer'; +export * from './shelly-gen3-2-pm'; diff --git a/src/devices/shelly-plus-rgbw-pm.ts b/src/devices/shelly-plus-rgbw-pm.ts new file mode 100644 index 00000000..24778a54 --- /dev/null +++ b/src/devices/shelly-plus-rgbw-pm.ts @@ -0,0 +1,64 @@ +import { component, Device, MultiProfileDevice } from './base'; +import { + BluetoothLowEnergy, + Cloud, + Input, + Light, + Mqtt, + OutboundWebSocket, + Script, + Ui, + WiFi, +} from '../components'; + +export class ShellyPlusRGBWPM extends MultiProfileDevice { + static readonly model: string = 'SNDC-0D4P10WW'; + static readonly modelName: string = 'Shelly Plus RGBW PM'; + + @component + readonly wifi = new WiFi(this); + + @component + readonly bluetoothLowEnergy = new BluetoothLowEnergy(this); + + @component + readonly cloud = new Cloud(this); + + @component + readonly mqtt = new Mqtt(this); + + @component + readonly outboundWebSocket = new OutboundWebSocket(this); + + @component + readonly input0 = new Input(this, 0); + + @component + readonly input1 = new Input(this, 1); + + @component + readonly input2 = new Input(this, 2); + + @component + readonly input3 = new Input(this, 3); + + @component + readonly light0 = new Light(this, 0); + + @component + readonly light1 = new Light(this, 1); + + @component + readonly light2 = new Light(this, 2); + + @component + readonly light3 = new Light(this, 3); + + @component + readonly script = new Script(this); + + @component + readonly ui = new Ui(this); +} + +Device.registerClass(ShellyPlusRGBWPM); From 16fe0c7e56a7abe8966d3677f229441b9f2291c9 Mon Sep 17 00:00:00 2001 From: Giullian Franke Date: Mon, 5 Jan 2026 10:34:46 +0100 Subject: [PATCH 2/2] Adding device to supported list --- README.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index ec5acfdd..f94017b8 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,7 @@ For the first generation, see [node-shellies](https://github.com/alexryd/node-sh - [Shelly Plus Plug IT](https://shelly-api-docs.shelly.cloud/gen2/Devices/Gen2/ShellyPlusPlugIT) - [Shelly Plus H&T +V3](https://shelly-api-docs.shelly.cloud/gen2/Devices/Gen2/ShellyPlusHT) - [Shelly Plus 0-10V Dimmer](https://shelly-api-docs.shelly.cloud/gen2/Devices/Gen2/ShellyPlus10V) +- [Shelly Plus RGBW PM](https://shelly-api-docs.shelly.cloud/gen2/Devices/Gen2/ShellyPlusRGBWPM) - [Shelly Dimmer 0/1-10V PM](https://shelly-api-docs.shelly.cloud/gen2/Devices/Gen3/ShellyDimmer0110VPMG3) - [Shelly Dimmer](https://shelly-api-docs.shelly.cloud/gen2/Devices/Gen3/ShellyDimmerG3) - [Shelly Pro 1](https://shelly-api-docs.shelly.cloud/gen2/Devices/Gen2/ShellyPro1) @@ -46,12 +47,12 @@ import { MdnsDeviceDiscoverer, Shellies, ShellyPlus1, -} from "shellies-ds9"; +} from 'shellies-ds9'; const shellies = new Shellies(); // handle discovered devices -shellies.on("add", async (device: Device) => { +shellies.on('add', async (device: Device) => { console.log(`${device.modelName} discovered`); console.log(`ID: ${device.id}`); @@ -65,8 +66,8 @@ shellies.on("add", async (device: Device) => { }); // handle asynchronous errors -shellies.on("error", (deviceId: DeviceId, error: Error) => { - console.error("An error occured:", error.message); +shellies.on('error', (deviceId: DeviceId, error: Error) => { + console.error('An error occured:', error.message); }); // create an mDNS device discoverer