Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

iobroker.shelly

Package Overview
Dependencies
Maintainers
1
Versions
107
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

iobroker.shelly - npm Package Compare versions

Comparing version 2.1.0 to 2.1.3

6

io-package.json
{
"common": {
"name": "shelly",
"version": "2.1.0",
"version": "2.1.3",
"news": {
"2.1.3": {
"en": "Support of Shelly RGBW2",
"de": "Shelly RGBW2 Unterstützung"
},
"2.1.0": {

@@ -7,0 +11,0 @@ "en": "New Status 'update available' for Shely1, Shelly2, Shelly4Pro and ShellyPlug",

1068

lib/datapoints.js

@@ -14,49 +14,49 @@ /* jshint -W097 */

'Relay0.AutoTimerOff': {
"name": "Auto Timer Off",
"type": "number",
"role": "level.timer",
"def": 0,
"unit": "s",
"read": true,
"write": true
'name': 'Auto Timer Off',
'type': 'number',
'role': 'level.timer',
'def': 0,
'unit': 's',
'read': true,
'write': true
},
'Relay0.AutoTimerOn': {
"name": "Auto Timer On",
"type": "number",
"role": "level.timer",
"read": true,
"write": true,
"def": 0,
"unit": "s"
'name': 'Auto Timer On',
'type': 'number',
'role': 'level.timer',
'read': true,
'write': true,
'def': 0,
'unit': 's'
},
'Relay0.Switch': {
"def": false,
"type": "boolean",
"read": true,
"write": true,
"name": "Switch",
"role": "switch"
'def': false,
'type': 'boolean',
'read': true,
'write': true,
'name': 'Switch',
'role': 'switch'
},
'Relay0.Timer': {
"name": "Timer",
"type": "number",
"role": "level.timer",
"read": true,
"write": true,
"def": 0,
"unit": "s"
'name': 'Timer',
'type': 'number',
'role': 'level.timer',
'read': true,
'write': true,
'def': 0,
'unit': 's'
},
'rssi': {
"name": 'Device RSSI status',
"type": 'number',
"role": 'value',
"read": true,
"write": false
'name': 'Device RSSI status',
'type': 'number',
'role': 'value',
'read': true,
'write': false
},
'firmware': {
"name": 'New firmware available',
"type": 'boolean',
"role": 'state',
"read": true,
"write": false
'name': 'New firmware available',
'type': 'boolean',
'role': 'state',
'read': true,
'write': false
}

@@ -67,149 +67,149 @@ };

'Relay0.AutoTimerOff': {
"name": "Auto Timer Off",
"type": "number",
"role": "level.timer",
"def": 0,
"unit": "s",
"read": true,
"write": true
'name': 'Auto Timer Off',
'type': 'number',
'role': 'level.timer',
'def': 0,
'unit': 's',
'read': true,
'write': true
},
'Relay0.AutoTimerOn': {
"name": "Auto Timer On",
"type": "number",
"role": "level.timer",
"read": true,
"write": true,
"def": 0,
"unit": "s"
'name': 'Auto Timer On',
'type': 'number',
'role': 'level.timer',
'read': true,
'write': true,
'def': 0,
'unit': 's'
},
'Relay0.Switch': {
"def": false,
"type": "boolean",
"read": true,
"write": true,
"name": "Switch",
"role": "switch"
'def': false,
'type': 'boolean',
'read': true,
'write': true,
'name': 'Switch',
'role': 'switch'
},
'Relay0.Timer': {
"name": "Timer",
"type": "number",
"role": "level.timer",
"read": true,
"write": true,
"def": 0,
"unit": "s"
'name': 'Timer',
'type': 'number',
'role': 'level.timer',
'read': true,
'write': true,
'def': 0,
'unit': 's'
},
'Relay1.AutoTimerOff': {
"name": "Auto Timer Off",
"type": "number",
"role": "level.timer",
"def": 0,
"unit": "s",
"read": true,
"write": true
'name': 'Auto Timer Off',
'type': 'number',
'role': 'level.timer',
'def': 0,
'unit': 's',
'read': true,
'write': true
},
'Relay1.AutoTimerOn': {
"name": "Auto Timer On",
"type": "number",
"role": "level.timer",
"read": true,
"write": true,
"def": 0,
"unit": "s"
'name': 'Auto Timer On',
'type': 'number',
'role': 'level.timer',
'read': true,
'write': true,
'def': 0,
'unit': 's'
},
'Relay1.Switch': {
"def": false,
"type": "boolean",
"read": true,
"write": true,
"name": "Switch",
"role": "switch"
'def': false,
'type': 'boolean',
'read': true,
'write': true,
'name': 'Switch',
'role': 'switch'
},
'Relay1.Timer': {
"name": "Timer",
"type": "number",
"role": "level.timer",
"read": true,
"write": true,
"def": 0,
"unit": "s"
'name': 'Timer',
'type': 'number',
'role': 'level.timer',
'read': true,
'write': true,
'def': 0,
'unit': 's'
},
'Power': {
"name": "Power",
"type": "number",
"role": "value.power",
"read": true,
"write": false,
"def": 0,
"unit": "W"
'name': 'Power',
'type': 'number',
'role': 'value.power',
'read': true,
'write': false,
'def': 0,
'unit': 'W'
},
'rssi': {
"name": 'Device RSSI status',
"type": 'number',
"role": 'value',
"read": true,
"write": false
'name': 'Device RSSI status',
'type': 'number',
'role': 'value',
'read': true,
'write': false
},
'firmware': {
"name": 'New firmware available',
"type": 'boolean',
"role": 'state',
"read": true,
"write": false
'name': 'New firmware available',
'type': 'boolean',
'role': 'state',
'read': true,
'write': false
},
'Shutter.Close': {
"name": "Close",
"type": "boolean",
"role": "button",
"read": false,
"write": true
'name': 'Close',
'type': 'boolean',
'role': 'button',
'read': false,
'write': true
},
'Shutter.Duration': {
"name": "Duration",
"type": "number",
"role": "level.timer",
"read": true,
"write": true,
"def": 0,
"unit": "s"
'name': 'Duration',
'type': 'number',
'role': 'level.timer',
'read': true,
'write': true,
'def': 0,
'unit': 's'
},
'Shutter.Open': {
"name": "Open",
"type": "boolean",
"role": "button",
"read": false,
"write": true
'name': 'Open',
'type': 'boolean',
'role': 'button',
'read': false,
'write': true
},
'Shutter.Pause': {
"name": "Pause",
"type": "boolean",
"role": "button.stop",
"read": false,
"write": true
'name': 'Pause',
'type': 'boolean',
'role': 'button.stop',
'read': false,
'write': true
},
'Shutter.Position': {
"name": "Position",
"type": "number",
"role": "level.blind",
"read": true,
"write": true,
"unit": "%",
"min": 0,
"max": 100
'name': 'Position',
'type': 'number',
'role': 'level.blind',
'read': true,
'write': true,
'unit': '%',
'min': 0,
'max': 100
},
'mode': {
"name": "Roller/Relay mode",
"type": "string",
"role": "state",
"read": true,
"write": true,
"states": "roller:roller;relay:relay"
'name': 'Roller/Relay mode',
'type': 'string',
'role': 'state',
'read': true,
'write': true,
'states': 'roller:roller;relay:relay'
},
'Shutter.state': {
"name": "Roller state",
"type": "string",
"role": "state",
"read": true,
"write": true,
"states": "close:close;open:open;stop:stop"
'name': 'Roller state',
'type': 'string',
'role': 'state',
'read': true,
'write': true,
'states': 'close:close;open:open;stop:stop'
}

@@ -220,190 +220,190 @@ };

'Relay0.Switch': {
"def": false,
"type": "boolean",
"read": true,
"write": true,
"name": "Switch",
"role": "switch"
'def': false,
'type': 'boolean',
'read': true,
'write': true,
'name': 'Switch',
'role': 'switch'
},
'Relay0.Timer': {
"name": "Timer",
"type": "number",
"role": "level.timer",
"read": true,
"write": true,
"def": 0,
"unit": "s"
'name': 'Timer',
'type': 'number',
'role': 'level.timer',
'read': true,
'write': true,
'def': 0,
'unit': 's'
},
'Relay0.AutoTimerOff': {
"name": "Auto Timer Off",
"type": "number",
"role": "level.timer",
"def": 0,
"unit": "s",
"read": true,
"write": true
'name': 'Auto Timer Off',
'type': 'number',
'role': 'level.timer',
'def': 0,
'unit': 's',
'read': true,
'write': true
},
'Relay0.AutoTimerOn': {
"name": "Auto Timer On",
"type": "number",
"role": "level.timer",
"read": true,
"write": true,
"def": 0,
"unit": "s"
'name': 'Auto Timer On',
'type': 'number',
'role': 'level.timer',
'read': true,
'write': true,
'def': 0,
'unit': 's'
},
'Relay0.Power': {
"name": "Power",
"type": "number",
"role": "value.power",
"read": true,
"write": false,
"def": 0,
"unit": "W"
'name': 'Power',
'type': 'number',
'role': 'value.power',
'read': true,
'write': false,
'def': 0,
'unit': 'W'
},
'Relay1.Switch': {
"def": false,
"type": "boolean",
"read": true,
"write": true,
"name": "Switch",
"role": "switch"
'def': false,
'type': 'boolean',
'read': true,
'write': true,
'name': 'Switch',
'role': 'switch'
},
'Relay1.Timer': {
"name": "Timer",
"type": "number",
"role": "level.timer",
"read": true,
"write": true,
"def": 0,
"unit": "s"
'name': 'Timer',
'type': 'number',
'role': 'level.timer',
'read': true,
'write': true,
'def': 0,
'unit': 's'
},
'Relay1.AutoTimerOff': {
"name": "Auto Timer Off",
"type": "number",
"role": "level.timer",
"def": 0,
"unit": "s",
"read": true,
"write": true
'name': 'Auto Timer Off',
'type': 'number',
'role': 'level.timer',
'def': 0,
'unit': 's',
'read': true,
'write': true
},
'Relay1.AutoTimerOn': {
"name": "Auto Timer On",
"type": "number",
"role": "level.timer",
"read": true,
"write": true,
"def": 0,
"unit": "s"
'name': 'Auto Timer On',
'type': 'number',
'role': 'level.timer',
'read': true,
'write': true,
'def': 0,
'unit': 's'
},
'Relay1.Power': {
"name": "Power",
"type": "number",
"role": "value.power",
"read": true,
"write": false,
"def": 0,
"unit": "W"
'name': 'Power',
'type': 'number',
'role': 'value.power',
'read': true,
'write': false,
'def': 0,
'unit': 'W'
},
'Relay2.Switch': {
"def": false,
"type": "boolean",
"read": true,
"write": true,
"name": "Switch",
"role": "switch"
'def': false,
'type': 'boolean',
'read': true,
'write': true,
'name': 'Switch',
'role': 'switch'
},
'Relay2.Timer': {
"name": "Timer",
"type": "number",
"role": "level.timer",
"read": true,
"write": true,
"def": 0,
"unit": "s"
'name': 'Timer',
'type': 'number',
'role': 'level.timer',
'read': true,
'write': true,
'def': 0,
'unit': 's'
},
'Relay2.AutoTimerOff': {
"name": "Auto Timer Off",
"type": "number",
"role": "level.timer",
"def": 0,
"unit": "s",
"read": true,
"write": true
'name': 'Auto Timer Off',
'type': 'number',
'role': 'level.timer',
'def': 0,
'unit': 's',
'read': true,
'write': true
},
'Relay2.AutoTimerOn': {
"name": "Auto Timer On",
"type": "number",
"role": "level.timer",
"read": true,
"write": true,
"def": 0,
"unit": "s"
'name': 'Auto Timer On',
'type': 'number',
'role': 'level.timer',
'read': true,
'write': true,
'def': 0,
'unit': 's'
},
'Relay2.Power': {
"name": "Power",
"type": "number",
"role": "value.power",
"read": true,
"write": false,
"def": 0,
"unit": "W"
'name': 'Power',
'type': 'number',
'role': 'value.power',
'read': true,
'write': false,
'def': 0,
'unit': 'W'
},
'Relay3.Switch': {
"def": false,
"type": "boolean",
"read": true,
"write": true,
"name": "Switch",
"role": "switch"
'def': false,
'type': 'boolean',
'read': true,
'write': true,
'name': 'Switch',
'role': 'switch'
},
'Relay3.Timer': {
"name": "Timer",
"type": "number",
"role": "level.timer",
"read": true,
"write": true,
"def": 0,
"unit": "s"
'name': 'Timer',
'type': 'number',
'role': 'level.timer',
'read': true,
'write': true,
'def': 0,
'unit': 's'
},
'Relay3.AutoTimerOff': {
"name": "Auto Timer Off",
"type": "number",
"role": "level.timer",
"def": 0,
"unit": "s",
"read": true,
"write": true
'name': 'Auto Timer Off',
'type': 'number',
'role': 'level.timer',
'def': 0,
'unit': 's',
'read': true,
'write': true
},
'Relay3.AutoTimerOn': {
"name": "Auto Timer On",
"type": "number",
"role": "level.timer",
"read": true,
"write": true,
"def": 0,
"unit": "s"
'name': 'Auto Timer On',
'type': 'number',
'role': 'level.timer',
'read': true,
'write': true,
'def': 0,
'unit': 's'
},
'Relay3.Power': {
"name": "Power",
"type": "number",
"role": "value.power",
"read": true,
"write": false,
"def": 0,
"unit": "W"
'name': 'Power',
'type': 'number',
'role': 'value.power',
'read': true,
'write': false,
'def': 0,
'unit': 'W'
},
'rssi': {
"name": 'Device RSSI status',
"type": 'number',
"role": 'value',
"read": true,
"write": false
'name': 'Device RSSI status',
'type': 'number',
'role': 'value',
'read': true,
'write': false
},
'firmware': {
"name": 'New firmware available',
"type": 'boolean',
"role": 'state',
"read": true,
"write": false
'name': 'New firmware available',
'type': 'boolean',
'role': 'state',
'read': true,
'write': false
}

@@ -415,58 +415,58 @@ };

'Relay0.AutoTimerOff': {
"name": "Auto Timer Off",
"type": "number",
"role": "level.timer",
"def": 0,
"unit": "s",
"read": true,
"write": true
'name': 'Auto Timer Off',
'type': 'number',
'role': 'level.timer',
'def': 0,
'unit': 's',
'read': true,
'write': true
},
'Relay0.AutoTimerOn': {
"name": "Auto Timer On",
"type": "number",
"role": "level.timer",
"read": true,
"write": true,
"def": 0,
"unit": "s"
'name': 'Auto Timer On',
'type': 'number',
'role': 'level.timer',
'read': true,
'write': true,
'def': 0,
'unit': 's'
},
'Relay0.Switch': {
"def": false,
"type": "boolean",
"read": true,
"write": true,
"name": "Switch",
"role": "switch"
'def': false,
'type': 'boolean',
'read': true,
'write': true,
'name': 'Switch',
'role': 'switch'
},
'Relay0.Timer': {
"name": "Timer",
"type": "number",
"role": "level.timer",
"read": true,
"write": true,
"def": 0,
"unit": "s"
'name': 'Timer',
'type': 'number',
'role': 'level.timer',
'read': true,
'write': true,
'def': 0,
'unit': 's'
},
'Relay0.Power': {
"name": "Power",
"type": "number",
"role": "value.power",
"read": true,
"write": false,
"def": 0,
"unit": "W"
'name': 'Power',
'type': 'number',
'role': 'value.power',
'read': true,
'write': false,
'def': 0,
'unit': 'W'
},
'rssi': {
"name": 'Device RSSI status',
"type": 'number',
"role": 'value',
"read": true,
"write": false
'name': 'Device RSSI status',
'type': 'number',
'role': 'value',
'read': true,
'write': false
},
'firmware': {
"name": 'New firmware available',
"type": 'boolean',
"role": 'state',
"read": true,
"write": false
'name': 'New firmware available',
'type': 'boolean',
'role': 'state',
'read': true,
'write': false
}

@@ -479,108 +479,108 @@ };

'lights.Switch': {
"def": false,
"type": "boolean",
"read": true,
"write": true,
"name": "Switch",
"role": "switch"
'def': false,
'type': 'boolean',
'read': true,
'write': true,
'name': 'Switch',
'role': 'switch'
},
"lights.red": {
"name": "Red",
"type": "number",
"role": "level.color.red",
"read": true,
"write": true,
"min": 0,
"max": 65535
'lights.red': {
'name': 'Red',
'type': 'number',
'role': 'level.color.red',
'read': true,
'write': true,
'min': 0,
'max': 65535
},
"lights.green": {
"name": "Green",
"type": "number",
"role": "level.color.green",
"read": true,
"write": true,
"min": 0,
"max": 65535
'lights.green': {
'name': 'Green',
'type': 'number',
'role': 'level.color.green',
'read': true,
'write': true,
'min': 0,
'max': 65535
},
"lights.blue": {
"name": "Blue",
"type": "number",
"role": "level.color.blue",
"read": true,
"write": true,
"min": 0,
"max": 65535
'lights.blue': {
'name': 'Blue',
'type': 'number',
'role': 'level.color.blue',
'read': true,
'write': true,
'min': 0,
'max': 65535
},
"lights.white": {
"name": "White",
"type": "number",
"role": "level.color.white",
"read": true,
"write": true,
"min": 0,
"max": 65535
'lights.white': {
'name': 'White',
'type': 'number',
'role': 'level.color.white',
'read': true,
'write': true,
'min': 0,
'max': 65535
},
"lights.gain": {
"name": "Gain",
"type": "number",
"role": "level",
"read": true,
"write": true,
"min": 0,
"max": 65535
'lights.gain': {
'name': 'Gain',
'type': 'number',
'role': 'level',
'read': true,
'write': true,
'min': 0,
'max': 65535
},
"lights.temp": {
"name": "Temperature",
"type": "number",
"role": "level.temperature",
"read": true,
"write": true,
"min": 0,
"max": 65535
'lights.temp': {
'name': 'Temperature',
'type': 'number',
'role': 'level.temperature',
'read': true,
'write': true,
'min': 0,
'max': 65535
},
"lights.brightness": {
"name": "Brightness",
"type": "number",
"role": "level.dimmer",
"read": true,
"write": true,
"min": 0,
"max": 65535
'lights.brightness': {
'name': 'Brightness',
'type': 'number',
'role': 'level.dimmer',
'read': true,
'write': true,
'min': 0,
'max': 65535
},
"lights.effect": {
"name": "Effect",
"type": "number",
"role": "state",
"read": true,
"write": true,
"min": 0,
"max": 65535
'lights.effect': {
'name': 'Effect',
'type': 'number',
'role': 'state',
'read': true,
'write': true,
'min': 0,
'max': 65535
},
// "lights.auto_on"
// 'lights.auto_on'
'lights.AutoTimerOff': {
"name": "Auto Timer Off",
"type": "number",
"role": "level.timer",
"def": 0,
"unit": "s",
"read": true,
"write": true
'name': 'Auto Timer Off',
'type': 'number',
'role': 'level.timer',
'def': 0,
'unit': 's',
'read': true,
'write': true
},
// "lights.auto_off"
// 'lights.auto_off'
'lights.AutoTimerOn': {
"name": "Auto Timer On",
"type": "number",
"role": "level.timer",
"read": true,
"write": true,
"def": 0,
"unit": "s"
'name': 'Auto Timer On',
'type': 'number',
'role': 'level.timer',
'read': true,
'write': true,
'def': 0,
'unit': 's'
},
'mode': {
"name": "Modus",
"type": "string",
"role": "state",
"read": true,
"write": true,
"states": "color:color;white:white"
'name': 'Modus',
'type': 'string',
'role': 'state',
'read': true,
'write': true,
'states': 'color:color;white:white'
}

@@ -590,60 +590,155 @@ };

let shellyht = {
"tmp.value": {
"name": "Temperature",
"type": "number",
"role": "value.temperature",
"read": true,
"write": false,
"min": -100,
"max": 100
'tmp.value': {
'name': 'Temperature',
'type': 'number',
'role': 'value.temperature',
'read': true,
'write': false,
'min': -100,
'max': 100
},
"hum.value": {
"name": "Relative humidity",
"type": "number",
"role": "value.humidity",
"read": true,
"write": false,
"min": 0,
"max": 100,
"unit": "%"
'hum.value': {
'name': 'Relative humidity',
'type': 'number',
'role': 'value.humidity',
'read': true,
'write': false,
'min': 0,
'max': 100,
'unit': '%'
},
"bat.value": {
"name": "Battery capacity",
"type": "number",
"role": "value.battery",
"read": true,
"write": false,
"min": 0,
"max": 100,
"unit": "%"
'bat.value': {
'name': 'Battery capacity',
'type': 'number',
'role': 'value.battery',
'read': true,
'write': false,
'min': 0,
'max': 100,
'unit': '%'
}
};
let shellyrgbww2 = {
// lights.ison
'lights.Switch': {
'def': false,
'type': 'boolean',
'read': true,
'write': true,
'name': 'Switch',
'role': 'switch'
},
'lights.red': {
'name': 'Red',
'type': 'number',
'role': 'level.color.red',
'read': true,
'write': true,
'min': 0,
'max': 255
},
'lights.green': {
'name': 'Green',
'type': 'number',
'role': 'level.color.green',
'read': true,
'write': true,
'min': 0,
'max': 255
},
'lights.blue': {
'name': 'Blue',
'type': 'number',
'role': 'level.color.blue',
'read': true,
'write': true,
'min': 0,
'max': 255
},
'lights.white': {
'name': 'White',
'type': 'number',
'role': 'level.color.white',
'read': true,
'write': true,
'min': 0,
'max': 255
},
'lights.gain': {
'name': 'Gain',
'type': 'number',
'role': 'level',
'read': true,
'write': true,
'min': 0,
'max': 100
},
'lights.effect': {
'name': 'Effect',
'type': 'number',
'role': 'state',
'read': true,
'write': true,
'min': 0,
'max': 100
},
// 'lights.auto_on'
'lights.AutoTimerOff': {
'name': 'Auto Timer Off',
'type': 'number',
'role': 'level.timer',
'def': 0,
'unit': 's',
'read': true,
'write': true
},
// 'lights.auto_off'
'lights.AutoTimerOn': {
'name': 'Auto Timer On',
'type': 'number',
'role': 'level.timer',
'read': true,
'write': true,
'def': 0,
'unit': 's'
},
'mode': {
'name': 'Modus',
'type': 'string',
'role': 'state',
'read': true,
'write': true,
'states': 'color:color;white:white'
}
};
let shellysmoke = {
"tmp.value": {
"name": "Temperature",
"type": "number",
"role": "value.temperature",
"read": true,
"write": false,
"min": -100,
"max": 100
},
"smoke.value": {
"name": "Smoke detected",
"type": "boolean",
"role": "sensor.alarm.fire",
"read": true,
"write": false
},
"bat.value": {
"name": "Battery capacity",
"type": "number",
"role": "value.battery",
"read": true,
"write": false,
"min": 0,
"max": 100,
"unit": "%"
}
'tmp.value': {
'name': 'Temperature',
'type': 'number',
'role': 'value.temperature',
'read': true,
'write': false,
'min': -100,
'max': 100
},
'smoke.value': {
'name': 'Smoke detected',
'type': 'boolean',
'role': 'sensor.alarm.fire',
'read': true,
'write': false
},
'bat.value': {
'name': 'Battery capacity',
'type': 'number',
'role': 'value.battery',
'read': true,
'write': false,
'min': 0,
'max': 100,
'unit': '%'
}
};

@@ -657,2 +752,3 @@

'shellyrgbww': shellyrgbww,
'shellyrgbww2': shellyrgbww2,
'shellyht': shellyht,

@@ -667,3 +763,3 @@ 'shellysmoke': shellysmoke

// getObjectByName("dingdong")
// getObjectByName('dingdong')
function getObjectByName(name) {

@@ -674,3 +770,3 @@ let all = getAll();

// getObjectByName("dingdong", "sip_token")
// getObjectByName('dingdong', 'sip_token')
function getObjectById(name, id) {

@@ -677,0 +773,0 @@ let obj = getObjectByName(name);

{
"name": "iobroker.shelly",
"version": "2.1.0",
"version": "2.1.3",
"description": "Shelly",

@@ -41,5 +41,6 @@ "author": {

"chai": "^4.2.0",
"eslint": "^5.11.1",
"eslint": "^5.14.0",
"eslint-config-airbnb-base": "^13.1.0",
"eslint-plugin-import": "^2.14.0",
"eslint-plugin-import": "^2.16.0",
"eslint-plugin-react": "^7.12.4",
"gulp": "^4.0.0",

@@ -46,0 +47,0 @@ "mocha": "^4.1.0"

@@ -29,9 +29,11 @@ ![Logo](admin/shelly.png)

* Shelly2 (SHSW-21/SHSW-22, Verified)
* ShellyRGBW (SHRGBWW-01, Verified)
* ShellyRGBW2 (SHRGBW2-01, not verified and tested)
* Shelly4Pro (SHSW-44, not verified and tested)
* ShellyPlug (SHPLG-1, not verified and tested)
* ShellyRGBW (SHRGBWW-01, not verified and tested)
* ShellyRGBW (SHRGBWW-01, Verified)
* Shelly H&T (SHHT-1, verified)
## More details needed to implement (Debug log)
* Shelly Sense (SHSEN-1)
* ShellySense (SHSEN-1)
* ShellyBulb (SHBLB-1d)

@@ -42,2 +44,5 @@ * Shelly2LED (SH2LED-1)

### 2.1.3 (16.02.2019)
* Support of Shelly RGBW2
### 2.1.0 (09.02.2019)

@@ -44,0 +49,0 @@ * New Status 'new firmware available' for Shely1, Shelly2, Shelly4Pro and ShellyPlug

@@ -265,4 +265,6 @@ /* jshint -W097 */

createShellyPlugStates(deviceId);
} else if (deviceId.startsWith('SHRGBWW') || deviceId.startsWith('SHBLB') || deviceId.startsWith(' SH2LED')) {
} else if (deviceId.startsWith('SHRGBWW') || deviceId.startsWith('SHBLB') || deviceId.startsWith('SH2LED')) {
createShellyRGBWWStates(deviceId);
} else if (deviceId.startsWith('SHRGBW2')) {
createShellyRGBWW2States(deviceId);
} else if (deviceId.startsWith('SHHT')) {

@@ -306,4 +308,6 @@ createShellyHTStates(deviceId);

updateShellyPlugStates(deviceId, callback);
} else if (deviceId.startsWith('SHRGBWW') || deviceId.startsWith('SHBLB') || deviceId.startsWith(' SH2LED')) {
} else if (deviceId.startsWith('SHRGBWW') || deviceId.startsWith('SHBLB') || deviceId.startsWith('SH2LED')) {
updateShellyRGBWWStates(deviceId, callback);
} else if (deviceId.startsWith('SHRGBW2')) {
updateShellyRGBWW2States(deviceId, callback);
} else if (deviceId.startsWith('SHHT')) {

@@ -477,3 +481,3 @@ updateShellyHTStates(deviceId, status, callback);

if (!error && data) {
if(deviceId == 'SHSW-1#056EE0#1') {
if (deviceId == 'SHSW-1#056EE0#1') {
let a = 1;

@@ -1464,2 +1468,187 @@ }

// *******************************************************************************
// Shelly RGBWW2
// *******************************************************************************
function createShellyRGBWW2States(deviceId) {
let devices = datapoints.getObjectByName('shellyrgbww2');
for (let i in devices) {
let common = devices[i];
let stateId = deviceId + '.' + i;
let controlFunction;
let value;
createChannel(deviceId, i);
if (i == 'lights.Switch') { // Implement all needed action stuff here based on the names
controlFunction = (value) => {
let params = {};
let timer = 0;
let timerId = deviceId + '.lights.Timer';
adapter.getState(timerId, (err, state) => {
// if timer > 0 sec. call rest with timer paramater
timer = state ? state.val : 0;
if (timer > 0) {
params = {
'turn': (value === true || value === 1) ? 'on' : 'off',
'timer': timer
};
} else {
params = {
'turn': (value === true || value === 1) ? 'on' : 'off'
};
}
adapter.log.debug('Lights Switch: ' + JSON.stringify(params));
shelly.callDevice(deviceId, '/color/0', params); // send REST call to devices IP with the given path and parameters
});
};
}
if (i == 'lights.red' || i == 'lights.green' || i == 'lights.blue' || i == 'lights.white' || i == 'lights.gain' || i == 'lights.effect') { // Implement all needed action stuff here based on the names
let id = i.replace('lights.', '');
controlFunction = (value) => {
let params = {};
params[id] = value;
adapter.log.debug('Set Colors: ' + JSON.stringify(params));
shelly.callDevice(deviceId, '/color/0', params); // send REST call to devices IP with the given path and parameters
};
}
if (i == 'lights.AutoTimerOff') {
controlFunction = (value) => {
let params;
params = {
'auto_off': value
};
adapter.log.debug('Auto Timer off: ' + JSON.stringify(params));
shelly.callDevice(deviceId, '/settings/color/0', params); // send REST call to devices IP with the given path and parameters
};
}
if (i == 'lights.AutoTimerOn') {
controlFunction = (value) => {
let params;
params = {
'auto_on': value
};
adapter.log.debug('Auto Timer off: ' + JSON.stringify(params));
shelly.callDevice(deviceId, '/settings/color/0', params); // send REST call to devices IP with the given path and parameters
};
}
if (i == 'mode') {
controlFunction = (value) => {
let params;
params = {
'mode': value
};
adapter.log.debug('Modus: ' + JSON.stringify(params));
shelly.callDevice(deviceId, '/settings', params); // send REST call to devices IP with the given path and parameters
};
}
if (i == 'lights.Timer') {
value = 0;
}
adapter.log.debug('Creating State ' + stateId);
objectHelper.setOrUpdateObject(stateId, {
type: 'state',
common: common
}, ['name'], value, controlFunction);
}
}
function updateShellyRGBWW2States(deviceId, callback) {
let devices = datapoints.getObjectByName('shellyrgbww2');
let parameter = {};
shelly.callDevice(deviceId, '/settings', parameter, (error, data) => {
if (!error && data) {
let ids = getIoBrokerStatesFromObj(data);
for (let i in ids) {
let id = i;
let value = ids[i];
let controlFunction;
// historical mapping
switch (id) {
case 'lights.ison':
id = 'lights.Switch';
break;
case 'lights.auto_on':
id = 'lights.AutoTimerOn';
break;
case 'lights.auto_off':
id = 'lights.AutoTimerOff';
break;
default:
}
if (shellyStates.hasOwnProperty(deviceId + '.' + id) && shellyStates[deviceId + '.' + id] == value) {
continue;
}
shellyStates[deviceId + '.' + id] = value;
if (devices.hasOwnProperty(id)) {
let stateId = deviceId + '.' + id;
let common = devices[id];
objectHelper.setOrUpdateObject(stateId, {
type: 'state',
common: common
}, ['name'], value, controlFunction);
}
}
}
shelly.callDevice(deviceId, '/status', parameter, (error, data) => {
if (!error && data) {
let ids = getIoBrokerStatesFromObj(data);
for (let i in ids) {
let id = i;
let value = ids[i];
let controlFunction;
// historical mapping
switch (id) {
case 'wifi_sta.rssi':
id = 'rssi';
break;
case 'update.has_update':
id = 'firmware';
break;
default:
}
if (shellyStates.hasOwnProperty(deviceId + '.' + id) && shellyStates[deviceId + '.' + id] == value) {
continue;
}
shellyStates[deviceId + '.' + id] = value;
if (devices.hasOwnProperty(id)) {
let stateId = deviceId + '.' + id;
let common = devices[id];
// adapter.log.debug(i + ' = ' + stateId);
objectHelper.setOrUpdateObject(stateId, {
type: 'state',
common: common
}, ['name'], value, controlFunction);
}
}
setOnlineStatus(deviceId, true);
} else {
setOnlineStatus(deviceId, false);
}
callback && callback();
});
});
}
// *******************************************************************************
// Shelly H&T

@@ -1466,0 +1655,0 @@ // *******************************************************************************

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc