Skip to content

Commit

Permalink
Blueprint of Shelly Plus 2PM (#314)
Browse files Browse the repository at this point in the history
initial version of Blueprint for Shelly Plus 2PM
  • Loading branch information
nkrasko authored Aug 13, 2024
1 parent d1cb87d commit e7f3ef8
Show file tree
Hide file tree
Showing 15 changed files with 6,815 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .marketplace/devices/devices.yml
Original file line number Diff line number Diff line change
Expand Up @@ -777,3 +777,13 @@
blueprint_options:
- blueprint: water_sensors/SJCGQ12LM
verification_level: verified

- id: shelly-plus-2pm
display_name: Shelly Pluse 2PM
description: Power metering switch with 2x10A relays
icon: enapter-light-switch
vendor: shelly
category: relays
blueprint_options:
- blueprint: relays/shelly_2pm
verification_level: verified
Binary file added .marketplace/vendors/icons/shelly.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions .marketplace/vendors/vendors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -242,3 +242,8 @@
display_name: Hunan Rika Electronic Tech
icon_url: https://raw.githubusercontent.com/Enapter/marketplace/main/.marketplace/vendors/icons/rika.png
website: https://www.rikasensor.com

- id: shelly
display_name: Shelly
icon_url: https://raw.githubusercontent.com/Enapter/marketplace/main/.marketplace/vendors/icons/shelly.png
website: https://www.shelly.com
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added relays/shelly_2pm/.assets/02_Shelly_Web_UI.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added relays/shelly_2pm/.assets/03_Configure_Wi-Fi.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added relays/shelly_2pm/.assets/04_Wi-Fi_Connected.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added relays/shelly_2pm/.assets/05_Settings.png
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.
Binary file added relays/shelly_2pm/.assets/06_Commands.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added relays/shelly_2pm/.assets/07_Configuration.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
61 changes: 61 additions & 0 deletions relays/shelly_2pm/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Shelly Plus 2PM

This [Enapter Device Blueprint](https://go.enapter.com/marketplace-readme) integrates **Shelly Plus 2PMT** - power metering switch with 2x10A relays. It can be used to control external electrical load such as lights, pumps and valves. It also can be used as roller shutter. This blueprint runs on Virtual UCM and integrates using [RPC over HTTP API](https://shelly-api-docs.shelly.cloud/gen2/General/RPCProtocol/), therefore gateway and Shelly Plus 2PM module needs to be in one network. It also supports digest authentication.

## Configuring Shelly Plus 2 PM

1. Power On Module and wait when ShellyPlus2PM-*ID* Wi-Fi network will be discoverable in the air.
2. Conntect to your ShellyPlus2PM-*ID* Wi-Fi network using your computer.

<img src="./.assets/01_Connect_To_Shelly.png" alt="Connect to Shelly Plus 2PM" width="25%" />

3. Navigate to `http://192.168.33.1` using your favourite browser.

<img src="./.assets/02_Shelly_Web_UI.png" alt="Access Shelly Plus 2PM Web GUI" width="25%" />

3. Navigate to `Settings`->`Wi-Fi` and set configuration of the network connection there. Select your Wi-Fi network from the list, put network password. It is also recommended to use static IPv4 settings.

<img src="./.assets/03_Configure_Wi-Fi.png" alt="Configure Shelly Plus 2PM Wi-Fi Network Settings" width="25%" />

4. Ensure that Wi-Fi icon changed to active status.

<img src="./.assets/04_Wi-Fi_Connected.png" alt="Ensure that Wi-Fi is connected" width="25%" />

5. It is also recommended to diable Access Point by removing `Enable AP Network` checkbox in the `Settings`->`Access Point` menu.

<img src="./.assets/05_Settings_Access_Point.png" alt="Disable Access Point" width="25%" />

## Connect to Enapter

1. Sign up to the Enapter Cloud using the [Web](https://cloud.enapter.com/) or mobile app ([iOS](https://apps.apple.com/app/id1388329910), [Android](https://play.google.com/store/apps/details?id=com.enapter&hl=en)).

2. Use the [Enapter Gateway](https://handbook.enapter.com/software/gateway/2.0.0/setup/) to run the Virtual UCM.

3. Create the [Enapter Virtual UCM](https://handbook.enapter.com/software/software.html#%F0%9F%92%8E-virtual-ucm).

4. Upload thie Blueprint using [Enapter Marketplace](https://marketplace.enapter.com) on your mobile device. Advanced users can upload using Web IDE or CLI by following [Developer Documentation](https://developers.enapter.com/docs/tutorial/uploading-blueprint/).

5. As soon as Blueprint will start the `IP Address Not Configured` event will be triggered.

6. Click `Commands` on device screen.

<img src="./.assets/06_Commands.jpg" alt="Shelly Plus 2PM Blueprint Commands" width="25%" />

7. On the commands list screen click on `Main Configuration` command:

<img src="./.assets/07_Configuration.jpg" alt="Shelly Plus 2PM Blueprint Configuration Settings" width="25%" />

You need to set the following parameters:

- IP Address

- Password (Optional)

9. Press `Run` button

The status data should be available on your dashboard as well as you will be able to use the valuies in [Enapter Rules Engine](https://developers.enapter.com/docs/reference/rules/time)

## References

- [Shelly Plus 2PM](https://www.shelly.com/en/products/shop/shelly-plus-2-pm)
- [Shelly Plus 2PM RPC over HTTP API](https://shelly-api-docs.shelly.cloud/gen2/0.14/Devices/ShellyPlus2PM/)
177 changes: 177 additions & 0 deletions relays/shelly_2pm/manifest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@
blueprint_spec: device/1.0

display_name: Shelly Plus 2PM
description: Power Metering Switch 2x10A
icon: enapter-light-switch
vendor: shelly
author: enapter
contributors:
- nkrasko
support:
url: https://go.enapter.com/enapter-blueprint-support
email: support@enapter.com
license: MIT

communication_module:
product: ENP-VIRTUAL
lua:
dir: src
dependencies:
- enapter-ucm
allow_dev_dependencies: true

properties:
vendor:
type: string
display_name: Vendor
model:
type: string
display_name: Model
mac:
type: string
display_name: MAC
ver:
type: string
display_name: FW Version

telemetry:
status:
type: string
enum:
- Online
- Offline
display_name: Module Status
rssi:
type: float
display_name: RSSI
switch0:
type: string
enum:
- 'On'
- 'Off'
display_name: Switch 1 Status
switch1:
type: string
enum:
- 'On'
- 'Off'
display_name: Switch 2 Status
voltage0:
type: float
display_name: Voltage 1
unit: V
current0:
type: float
display_name: Current 1
unit: A
power0:
type: float
display_name: Power 1
unit: W
voltage1:
type: float
display_name: Voltage 2
unit: V
current1:
type: float
display_name: Current 2
unit: A
power1:
type: float
display_name: Power 2
unit: W
input0:
type: string
enum:
- 'On'
- 'Off'
display_name: Input 1 Status
input1:
type: string
enum:
- 'On'
- 'Off'
display_name: Input 2 Status

alerts:
cannot_read_config:
severity: error
display_name: Cannot Read Configuration
description: Cannot read configuration from flash storage. Check the logs.
not_configured:
severity: info
display_name: Connection Not Configured
description: RPC over HTTP connection not configured. Please set the correct settings using "Configure" command.
communication_failed:
display_name: Communication Failed
severity: error
wrong_request:
severity: error
display_name: Shelly API returned invalid response.
description: Shelly API returned invalid response. Check that you are using valid cridentials and location.
wrong_password:
severity: error
display_name: Unable to authenticate into Shelly API.
description: |
Unable to authenticate into Shelly API. Check that you are using valid password in Virtual UCM configuration.
command_groups:
control:
display_name: Control
config:
display_name: Configuration

commands:
switch_on_0:
display_name: "#1 On"
group: control
ui:
icon: power-plug
quick_access: true
switch_off_0:
display_name: "#1 Off"
group: control
ui:
icon: power-plug-off
quick_access: true
switch_on_1:
display_name: "#2 On"
group: control
ui:
icon: power-plug
quick_access: true
switch_off_1:
display_name: "#2 Off"
group: control
ui:
icon: power-plug-off
quick_access: true
write_configuration:
display_name: Configure
group: config
populate_values_command: read_configuration
ui:
icon: file-document-edit-outline
arguments:
address:
display_name: IP address
type: string
required: true
password:
display_name: API password
type: string
read_configuration:
display_name: Read Config Parameters
group: config
ui:
icon: file-check-outline

.cloud:
category: switches
mobile_charts:
- voltage0
- current0
- power0
- voltage1
- current1
- power1
Loading

0 comments on commit e7f3ef8

Please sign in to comment.