Skip to content

Commit a8cd7d5

Browse files
authored
Merge pull request #131 from Luligu/dev
Release 2.0.0
2 parents c871c38 + 92af8bf commit a8cd7d5

71 files changed

Lines changed: 926 additions & 87101 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGELOG.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,58 @@ If you like this project and find it useful, please consider giving it a star on
66

77
You can also sponsor Tamer here https://buymeacoffee.com/6sjde6vkzl for his invaluable contribution to this project.
88

9+
### Breaking Changes
10+
11+
Since the plugin config got very complex and also confusing, from this release same options have been removed or simplified:
12+
13+
Removed options:
14+
15+
- exposeSwitch: the default is outlet (matter compliant). You can expose a device like a switch adding it it to the switchList or like a light adding it it to the lightList.
16+
- outletList: since the default is now outlet, outletList has been removed.
17+
18+
- exposeInput: inputs are now disabled by default. You can still expose them adding the device to inputContactList, inputMomentaryList or inputLatchingList.
19+
- exposeInputEvent: inputs events are now disabled by default. You can expose them adding the device to inputMomentaryList.
20+
- inputEventList: use inputMomentaryList instead.
21+
22+
- exposePowerMeter: electrical sensors are enabled by default on existing setups. You can disable them globally or on a per-device basis adding "PowerMeter" to entityBlackList or deviceEntityBlackList, see [COMPONENTS.md documentation.](https://github.com/Luligu/matterbridge-shelly/blob/main/COMPONENTS.md). On new setups the "PowerMeter" components are already globally disabled by default.
23+
24+
New setups:
25+
26+
- these components are blacklisted (with entityBlackList) by default: "PowerMeter", "Lux", "Illuminance", "Vibration", "Button". This allows to create simplified devices for the controllers that don't manage correctly composed devices (i.e. Alexa and SmartThings).
27+
- all switches are exposed like outlet (matter compliant).
28+
- shellyplusi4, shellyi4g3, shellyix3 and shellybutton1 are automatically added to inputMomentaryList when discovered.
29+
- expertMode is disabled. This makes the config showing only username, password and blackList.
30+
31+
Expert mode:
32+
33+
The expertMode option has been added to show an advanced or simplified config.
34+
35+
## [2.0.0] - 2025-02-27
36+
37+
### Added
38+
39+
- [platform]: Optimized memory and memory release.
40+
- [shelly]: Optimized memory and memory release.
41+
- [shelly]: Added online offline status on matter.
42+
- [BLU]: Verified firmware 1.0.21.
43+
- [TRV]: Verified firmware 1.2.0.
44+
- [WIFI]: Verified firmware 1.5.0.
45+
46+
### Changed
47+
48+
- [package]: Updated package.
49+
- [package]: Updated dependencies.
50+
- [plugin]: Requires Matterbridge 2.2.0.
51+
52+
### Fixed
53+
54+
- [platform]: Removed coiot component from Select.
55+
- [select]: Fix bthomesensor_event with select Button.
56+
57+
<a href="https://www.buymeacoffee.com/luligugithub">
58+
<img src="./yellow-button.png" alt="Buy me a coffee" width="120">
59+
</a>
60+
961
## [1.1.6] - 2025-02-11
1062

1163
### Added

COMPONENTS.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,15 @@ To expose only the temperature and humidity components while blacklisting all se
4747
```
4848
"deviceEntityBlackList": { "7c:c6:b6:65:2d:87": ["Button"] }
4949
```
50+
51+
## Example 5: How to disable for all devices the electrical measurements
52+
53+
```
54+
"entityBlackList": ["PowerMeter"]
55+
```
56+
57+
## Example 6: How to disable for a single device
58+
59+
```
60+
"deviceEntityBlackList": { "shellyplusrgbwpm-ECC9FF4CEAF0": ["PowerMeter"] }
61+
```

README.md

Lines changed: 13 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -145,30 +145,21 @@ Wait that the plugin has been configured before changing the config.
145145

146146
### username
147147

148-
If your devices are password protected put there the username. It must be unique for all the devices.
148+
If your devices are password protected put here the username. It must be unique for all the devices.
149+
149150
It is only used for gen 1 devices. Gen 2 and 3 devices have always admin.
150151

151152
### password
152153

153-
If your devices are password protected put there the password. It must be unique for all the devices.
154-
155-
### exposeSwitch
156-
157-
Choose how to expose on Matter the shelly switches: as a switch (don't use it with Alexa), light or outlet.
158-
159-
You can then configure one or more devices to be exposed differently. See the switchList, lightList and outletList.
154+
If your devices are password protected put here the password. It must be unique for all the devices.
160155

161156
### switchList
162157

163-
The devices in the list will be exposed as switches, regardless of the main option "exposeSwitch".
158+
The devices in the list will be exposed as switches (don't use it for Alexa).
164159

165160
### lightList
166161

167-
The devices in the list will be exposed as lights, regardless of the main option "exposeSwitch".
168-
169-
### outletList
170-
171-
The devices in the list will be exposed as outlets, regardless of the main option "exposeSwitch".
162+
The devices in the list will be exposed as lights.
172163

173164
### exposeInput
174165

@@ -178,36 +169,20 @@ Is useful only if you create automations on the controller side or you need the
178169

179170
### inputContactList
180171

181-
The devices in the list will expose the Input event component as a contact sensor, regardless of the main option (you can disable the Input component globally and enable it only for single devices like the shellyplusi4).
172+
The devices in the list will expose the Input component as a contact sensor.
182173

183174
### inputMomentaryList
184175

185-
The devices in the list will expose the Input event component as a momentary switch, regardless of the main option (you can disable the Input component globally and enable it only for single devices like the shellyplusi4).
176+
The devices in the list will expose the Input component as a momentary switch.
186177

187178
In Matter a momentary switch is button that can be pressed or released.
188179

189180
### inputLatchingList
190181

191-
The devices in the list will expose the Input event component as a latching switch, regardless of the main option (you can disable the Input component globally and enable it only for single devices like the shellyplusi4).
182+
The devices in the list will expose the Input component as a latching switch (latching switches are not supported by all controllers).
192183

193184
In Matter a latching switch is a switch that keeps its position open or closed.
194185

195-
### exposeInputEvent
196-
197-
Choose how to expose the shelly input events: momentary switch or disabled (default momentary).
198-
199-
This type of Input is used by devices like shellybutton1 or by Gen 2/3 devices with Input type=button.
200-
201-
Is useful only if you create automations on the controller side or you need the controller history.
202-
203-
### inputEventList
204-
205-
The devices in the list will expose the Input event component as a momentary switch, regardless of the main option (you can disable the Input event component globally and enable it only for single devices).
206-
207-
### exposePowerMeter
208-
209-
Choose how to expose the shelly power meters: disabled, matter13 (it uses Matter 1.3 electricalSensor device type that is supported only by Home Assistant so far). Unless your controller supports it, set it to disabled.
210-
211186
### blackList
212187

213188
If the blackList is defined the devices included in the list will not be exposed to Matter.
@@ -255,8 +230,11 @@ E.g. "shelly1minig3-543204547478": "192.168.1.221".
255230
### enableMdnsDiscover
256231

257232
Should always be enabled to discover new devices. It turns off automatically after 10 minutes to reduce network traffic.
233+
258234
Once a device is discovered, it is added to the shelly storage.
259235

236+
Once all the devices are loaded and stored, it is possible to disable this setting to reduce the network traffic.
237+
260238
### enableStorageDiscover
261239

262240
Should always be enabled to automatically add all the devices previously discovered.
@@ -269,6 +247,8 @@ Reset the storage discovery on the next restart (it will clear the storage of al
269247

270248
Should be enabled only if the mdns is not working in your network. It adds the devices defined in deviceIp.
271249

250+
Once all the devices are loaded and stored, disable this setting.
251+
272252
### enableBleDiscover
273253

274254
Should be enabled to discover the shelly BLU devices (it will register the BLU devices paired in each ble gateway, see https://github.com/Luligu/matterbridge-shelly/blob/dev/BLU.md for more informations).

eslint.config.js

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@
22

33
import eslint from '@eslint/js';
44
import tseslint from 'typescript-eslint';
5-
import jesteslint from 'eslint-plugin-jest';
5+
import eslintPluginJest from 'eslint-plugin-jest';
66
import eslintPluginPrettier from 'eslint-plugin-prettier/recommended';
7+
import eslintPluginN from 'eslint-plugin-n';
78

89
export default [
910
{
1011
name: 'global ignores',
11-
ignores: ['**/dist/', '**/build/', '**/node_modules/', '**/coverage/', '**/frontend/', '**/rock-s0/'],
12+
ignores: ['dist/', 'build/', 'node_modules/', 'coverage/', 'frontend/', 'rock-s0/'],
1213
},
1314
eslint.configs.recommended,
1415
...tseslint.configs.strict,
@@ -28,7 +29,6 @@ export default [
2829
'no-console': 'warn',
2930
'no-undef': 'off',
3031
'spaced-comment': ['error', 'always'],
31-
'no-useless-constructor': 'off',
3232
},
3333
},
3434
{
@@ -52,18 +52,25 @@ export default [
5252
plugins: {
5353
'@typescript-eslint': tseslint.plugin,
5454
},
55-
rules: {
56-
'@typescript-eslint/no-useless-constructor': 'off',
57-
},
5855
},
5956
{
6057
name: 'jest',
6158
files: ['**/__test__/*', '**/*.test.ts', '**/*.spec.ts'],
6259
plugins: {
6360
'@typescript-eslint': tseslint.plugin,
64-
jest: jesteslint,
61+
jest: eslintPluginJest,
6562
},
6663
...tseslint.configs.disableTypeChecked,
67-
...jesteslint.configs['flat/recommended'],
64+
...eslintPluginJest.configs['flat/recommended'],
65+
},
66+
{
67+
name: 'node',
68+
files: ['**/*.ts'],
69+
plugins: {
70+
n: eslintPluginN,
71+
},
72+
rules: {
73+
'n/prefer-node-protocol': 'error',
74+
},
6875
},
6976
];

jest.config.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,6 @@ export default {
2626
],
2727
},
2828
transformIgnorePatterns: ['/node_modules/'],
29+
testPathIgnorePatterns: ['/node_modules/', '/dist/', '/frontend/'],
30+
coveragePathIgnorePatterns: ['/node_modules/', '/dist/', '/frontend/', '/src/mock/'],
2931
};

matterbridge-shelly.schema.json

Lines changed: 14 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,15 @@
1414
"readOnly": true
1515
},
1616
"username": {
17-
"description": "Username (used only for gen 1 devices)",
17+
"description": "Username for password protected shelly devices (used only for gen 1 devices)",
1818
"type": "string"
1919
},
2020
"password": {
21-
"description": "Password (must be unique for all the devices)",
21+
"description": "Password for password protected shelly devices (must be unique for all the devices)",
2222
"type": "string"
2323
},
24-
"exposeSwitch": {
25-
"description": "Choose how to expose the shelly switches: as a switch (don't use it for Alexa), light or outlet",
26-
"type": "string",
27-
"enum": ["switch", "light", "outlet"],
28-
"default": "outlet"
29-
},
3024
"switchList": {
31-
"description": "The devices in the list will be exposed as switches, regardless of the main option.",
25+
"description": "The devices in the list will be exposed as switches (don't use it for Alexa).",
3226
"type": "array",
3327
"items": {
3428
"type": "string"
@@ -37,31 +31,16 @@
3731
"selectFrom": "serial"
3832
},
3933
"lightList": {
40-
"description": "The devices in the list will be exposed as lights, regardless of the main option.",
41-
"type": "array",
42-
"items": {
43-
"type": "string"
44-
},
45-
"uniqueItems": true,
46-
"selectFrom": "serial"
47-
},
48-
"outletList": {
49-
"description": "The devices in the list will be exposed as outlets, regardless of the main option.",
34+
"description": "The devices in the list will be exposed as lights.",
5035
"type": "array",
5136
"items": {
5237
"type": "string"
5338
},
5439
"uniqueItems": true,
5540
"selectFrom": "serial"
5641
},
57-
"exposeInput": {
58-
"description": "Choose how to expose the shelly inputs: disabled, contact, momentary or latching switch (you may need to pair again the controller when changed)",
59-
"type": "string",
60-
"enum": ["disabled", "contact", "momentary", "latching"],
61-
"default": "disabled"
62-
},
6342
"inputContactList": {
64-
"description": "The devices in the list will expose the Input event component as a contact sensor, regardless of the main option (you can disable the Input component globally and enable it only for single devices).",
43+
"description": "The devices in the list will expose the Input component as a contact sensor.",
6544
"type": "array",
6645
"items": {
6746
"type": "string"
@@ -70,7 +49,7 @@
7049
"selectFrom": "serial"
7150
},
7251
"inputMomentaryList": {
73-
"description": "The devices in the list will expose the Input event component as a momentary switch, regardless of the main option (you can disable the Input component globally and enable it only for single devices).",
52+
"description": "The devices in the list will expose the Input component as a momentary switch.",
7453
"type": "array",
7554
"items": {
7655
"type": "string"
@@ -79,35 +58,14 @@
7958
"selectFrom": "serial"
8059
},
8160
"inputLatchingList": {
82-
"description": "The devices in the list will expose the Input event component as a latching switch, regardless of the main option (you can disable the Input component globally and enable it only for single devices).",
61+
"description": "The devices in the list will expose the Input component as a latching switch.",
8362
"type": "array",
8463
"items": {
8564
"type": "string"
8665
},
8766
"uniqueItems": true,
8867
"selectFrom": "serial"
8968
},
90-
"exposeInputEvent": {
91-
"description": "Choose weather to expose the shelly input events: momentary or disabled (you may need to pair again the controller when changed)",
92-
"type": "string",
93-
"enum": ["momentary", "disabled"],
94-
"default": "disabled"
95-
},
96-
"inputEventList": {
97-
"description": "The devices in the list will expose the Input event component as a momentary switch, regardless of the main option (you can disable the Input event component globally and enable it only for single devices).",
98-
"type": "array",
99-
"items": {
100-
"type": "string"
101-
},
102-
"uniqueItems": true,
103-
"selectFrom": "serial"
104-
},
105-
"exposePowerMeter": {
106-
"description": "Choose how to expose the shelly power meters: disabled, matter13 (will use Matter 1.3 electricalSensor)",
107-
"type": "string",
108-
"enum": ["disabled", "matter13"],
109-
"default": "disabled"
110-
},
11169
"blackList": {
11270
"description": "The devices in the list will not be exposed. Use the device id (e.g. shellyplus2pm-5443B23D81F8) or BLU addr (i.e. 7c:c6:b6:65:2d:87)",
11371
"type": "array",
@@ -160,7 +118,7 @@
160118
"selectFrom": "serial"
161119
},
162120
"deviceIp": {
163-
"description": "Set the IP address for each device. Enter in the first field the shelly ID of the device and in the second field the IP address. (e.g. shelly1minig3-543204547478: 192.168.1.221). Enable enableConfigDiscover to load the devices from this setting.",
121+
"description": "Set the IP address for each device that is not discovered automatically. Enter in the first field the shelly ID of the device and in the second field the IP address. (e.g. shelly1minig3-543204547478: 192.168.1.221). Enable enableConfigDiscover to load the devices from this setting.",
164122
"type": "object",
165123
"uniqueItems": true,
166124
"selectFrom": "serial",
@@ -184,7 +142,7 @@
184142
"default": false
185143
},
186144
"enableConfigDiscover": {
187-
"description": "Enable config discovery for shelly devices (it will load the devices from deviceIp config setting)",
145+
"description": "Enable config discovery for shelly devices (it will load the devices from deviceIp config setting). It is only needed if a device is not discovered on your network. Once they are loaded and stored, disable this setting.",
188146
"type": "boolean",
189147
"default": false
190148
},
@@ -203,6 +161,11 @@
203161
"type": "string",
204162
"default": ""
205163
},
164+
"expertMode": {
165+
"description": "Enable the expert mode for the plugin configuration (restart required)",
166+
"type": "boolean",
167+
"default": false
168+
},
206169
"debug": {
207170
"description": "Enable the debug for the plugin (development only)",
208171
"type": "boolean",
@@ -223,10 +186,6 @@
223186
"type": "boolean",
224187
"default": false
225188
},
226-
"interfaceName": {
227-
"description": "Network interface name for shellies (development only)",
228-
"type": "string"
229-
},
230189
"unregisterOnShutdown": {
231190
"description": "Unregister all devices on shutdown (development only)",
232191
"type": "boolean",

0 commit comments

Comments
 (0)