-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #130 from Dirnei/fix/shelly25
Fix shelly25 node MQTT config
- Loading branch information
Showing
22 changed files
with
1,286 additions
and
197 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
.vscode | ||
.idea | ||
debug | ||
node_modules | ||
dist | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
# Shelly 2.5 | ||
|
||
The shelly 2.5 node controls the relays on a shelly and receives input, relay, and status changes. | ||
|
||
Tested with the following Shellies: | ||
- Shelly 1 | ||
- Shelly 2.5 | ||
|
||
## Configuration | ||
|
||
![img](img/shelly25-config.png) | ||
|
||
### Broker | ||
|
||
For more information see [mqtt-config](../config/mqtt-config.md) | ||
|
||
### Device | ||
|
||
The device section configures a shelly's MQTT topic and, optionally, its friendly name. | ||
For example, `shellies/my-device`, the shelly node will subscribe and publish on this topic. | ||
|
||
### Channel | ||
|
||
The channel configures which relay will be triggered when the node receives an input. Furthermore, the node only publishes relay and input changes for the selected input. | ||
Possible options are: | ||
- `Channel 1`: Switches and subscribes to channel 1 (MQTT topic `relay/0` and `input/0`). | ||
- `Channel 2`: Switches and subscribes to channel 2 (MQTT topic `relay/1` and `input/1`). | ||
- `Both`: Switches and subscribes to channels 1 and 2. | ||
|
||
For the shelly 1, one should stick to channel one, as it has only one input and relay. | ||
|
||
### State | ||
The state is used to control the relay when the node receives an input. | ||
- `On`: Switches the relay for the selected channel to on. | ||
- `Off`: Switches the relay for the selected channel to off. | ||
- `Toggle`: Switches the relay for the selected channel on if it is off and vice versa. | ||
|
||
### Enable Input | ||
This option enables the input connector on the node. Only when it is enabled is it possible to switch the relays. | ||
|
||
### Custom payload | ||
The custom payload allows you to define a specific payload to be published when the shelly's input state changes since the default are `0` and `1`, which might not be too helpful, primarily if two channels are used. For example: | ||
- Payload 1: Input one was triggered | ||
- Payload 2: Input zero was triggered | ||
|
||
|
||
## Usage | ||
|
||
### Control a shelly's relay | ||
|
||
On input, the shelly 2.5 node prepares a payload sent to the shelly by [send-messages](send-messages.md) via MQTT. | ||
|
||
The inject node triggers the shelly node to create a payload. The shelly node is configured to toggle its state between on and off. Moreover, only channel one is selected. The send-messages node is configured to use an MQTT broker as well as a zigbee2mqtt topic. The zigbee2mqtt topic is ignored for shellies, and they publish at the configured topic, usually `shellies/my-device`. | ||
|
||
|
||
![img](img/shelly25-toggle-relay-settings.png) | ||
|
||
![img](img/shelly25-toggle-relay.png) | ||
|
||
To try it, have a look at the example: [shelly25-toggle-relay.json](../../examples/shelly-25/shelly25-toggle-relay.json) | ||
|
||
|
||
### Receive input or relay changes from a shelly | ||
|
||
When the relay actuates, or a payload is sent to the first output to the 'Log shelly relay' debug node. | ||
When the input changes, a payload is sent to the second output to the 'Log shelly input' debug node. | ||
|
||
![img](img/shelly25-listen-input.png) | ||
|
||
To try it, have a look at the example: [shelly25-listen-to-input.json](../../examples/shelly-25/shelly25-listen-to-input.json) | ||
|
||
|
||
[*← back to the index*](../documentation.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
[ | ||
{ | ||
"id": "ddc73c09685b6ca2", | ||
"type": "debug", | ||
"z": "d6c6189e516c5861", | ||
"name": "Log shelly input", | ||
"active": true, | ||
"tosidebar": true, | ||
"console": false, | ||
"tostatus": false, | ||
"complete": "true", | ||
"targetType": "full", | ||
"statusVal": "", | ||
"statusType": "auto", | ||
"x": 440, | ||
"y": 200, | ||
"wires": [] | ||
}, | ||
{ | ||
"id": "876f6827a210a969", | ||
"type": "shelly-25", | ||
"z": "d6c6189e516c5861", | ||
"name": "Shelly 1 Terrace Light", | ||
"mqtt": "b1503ab27dfa3ccd", | ||
"shelly": "daf62c0c2a5c1ebd", | ||
"enableInput": false, | ||
"state": "on", | ||
"channel": "2", | ||
"inputs": 0, | ||
"outputs": 2, | ||
"customPayload": true, | ||
"payloadInput0": "", | ||
"typeInput0": "str", | ||
"payloadInput1": "", | ||
"typeInput1": "str", | ||
"x": 200, | ||
"y": 180, | ||
"wires": [ | ||
[ | ||
"2212d8cf185ffa8e" | ||
], | ||
[ | ||
"ddc73c09685b6ca2" | ||
] | ||
] | ||
}, | ||
{ | ||
"id": "2212d8cf185ffa8e", | ||
"type": "debug", | ||
"z": "d6c6189e516c5861", | ||
"name": "Log shelly relay", | ||
"active": true, | ||
"tosidebar": true, | ||
"console": false, | ||
"tostatus": false, | ||
"complete": "true", | ||
"targetType": "full", | ||
"statusVal": "", | ||
"statusType": "auto", | ||
"x": 440, | ||
"y": 160, | ||
"wires": [] | ||
}, | ||
{ | ||
"id": "b1503ab27dfa3ccd", | ||
"type": "mqtt-broker", | ||
"name": "Mosquitto", | ||
"broker": "127.0.0.1", | ||
"port": "1883", | ||
"clientid": "", | ||
"autoConnect": true, | ||
"usetls": false, | ||
"protocolVersion": "4", | ||
"keepalive": "60", | ||
"cleansession": true, | ||
"birthTopic": "", | ||
"birthQos": "0", | ||
"birthPayload": "", | ||
"birthMsg": {}, | ||
"closeTopic": "", | ||
"closeQos": "0", | ||
"closePayload": "", | ||
"closeMsg": {}, | ||
"willTopic": "", | ||
"willQos": "0", | ||
"willPayload": "", | ||
"willMsg": {}, | ||
"sessionExpiry": "", | ||
"credentials": {} | ||
}, | ||
{ | ||
"id": "daf62c0c2a5c1ebd", | ||
"type": "shelly-config", | ||
"name": "terrace-light", | ||
"prefix": "shellies/terrace-light" | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
[ | ||
{ | ||
"id": "8bcc1c584da5c6f6", | ||
"type": "shelly-25", | ||
"z": "d6c6189e516c5861", | ||
"name": "Shelly 1 Terrace Light", | ||
"mqtt": "b1503ab27dfa3ccd", | ||
"shelly": "daf62c0c2a5c1ebd", | ||
"enableInput": true, | ||
"state": "toggle", | ||
"channel": "0", | ||
"inputs": 1, | ||
"outputs": 3, | ||
"customPayload": false, | ||
"payloadInput0": "", | ||
"typeInput0": "str", | ||
"payloadInput1": "", | ||
"typeInput1": "str", | ||
"x": 440, | ||
"y": 400, | ||
"wires": [ | ||
[], | ||
[], | ||
[ | ||
"0e5a9766c04a1a6a" | ||
] | ||
] | ||
}, | ||
{ | ||
"id": "2b95eb1c49dc7662", | ||
"type": "inject", | ||
"z": "d6c6189e516c5861", | ||
"name": "Virtual light switch", | ||
"props": [ | ||
{ | ||
"p": "payload" | ||
}, | ||
{ | ||
"p": "topic", | ||
"vt": "str" | ||
} | ||
], | ||
"repeat": "", | ||
"crontab": "", | ||
"once": false, | ||
"onceDelay": 0.1, | ||
"topic": "", | ||
"payload": "", | ||
"payloadType": "date", | ||
"x": 170, | ||
"y": 400, | ||
"wires": [ | ||
[ | ||
"8bcc1c584da5c6f6" | ||
] | ||
] | ||
}, | ||
{ | ||
"id": "0e5a9766c04a1a6a", | ||
"type": "send-messages", | ||
"z": "d6c6189e516c5861", | ||
"name": "", | ||
"bridge": "11358734e0ff49d5", | ||
"x": 660, | ||
"y": 400, | ||
"wires": [] | ||
}, | ||
{ | ||
"id": "b1503ab27dfa3ccd", | ||
"type": "mqtt-broker", | ||
"name": "Mosquitto", | ||
"broker": "127.0.0.1", | ||
"port": "1883", | ||
"clientid": "", | ||
"autoConnect": true, | ||
"usetls": false, | ||
"protocolVersion": "4", | ||
"keepalive": "60", | ||
"cleansession": true, | ||
"birthTopic": "", | ||
"birthQos": "0", | ||
"birthPayload": "", | ||
"birthMsg": {}, | ||
"closeTopic": "", | ||
"closeQos": "0", | ||
"closePayload": "", | ||
"closeMsg": {}, | ||
"willTopic": "", | ||
"willQos": "0", | ||
"willPayload": "", | ||
"willMsg": {}, | ||
"sessionExpiry": "" | ||
}, | ||
{ | ||
"id": "daf62c0c2a5c1ebd", | ||
"type": "shelly-config", | ||
"name": "terrace-light", | ||
"prefix": "shellies/terrace-light" | ||
}, | ||
{ | ||
"id": "11358734e0ff49d5", | ||
"type": "zigbee2mqtt-bridge-config", | ||
"name": "Mosquitto", | ||
"broker": "b1503ab27dfa3ccd", | ||
"baseTopic": "zigbee2mqtt", | ||
"enabledLogging": false, | ||
"allowDeviceStatusRefresh": true | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.