# Shelly Binding

This Binding integrates [Shelly devices](https://shelly.cloud) developed by Allterco.

Allterco provides a rich set of smart home devices. All of them are WiFi enabled (2,4GHz, IPv4 only) and provide a documented API.
The binding is officially acknowledged by Allterco and openHAB is listed as a reference and directly supports the openHAB community.

The binding controls the devices independently from the Allterco Shelly Cloud (in fact it can be disabled).
The binding co-exists with Shelly App for Smartphones, Shelly Device Web UI, Shelly Cloud, MQTT and other 3rd party Apps.

The binding focuses on reporting the device status and device control.
Initial setup and device configuration has to be performed using the Shelly Apps (Web UI or Smartphone App).
The binding gets in sync with the next status refresh.

**If you're upgrading, check the channel migration and deprecated-channel notes in the [Channels](#channels) section below.**

Refer to [Advanced Users](doc/AdvancedUsers.md) for more information on openHAB Shelly integration, e.g. firmware update, network communication or log filtering.

Also check out the [Shelly Manager](doc/ShellyManager.md), which

- provides detailed information on your Shellys
- helps to diagnose WiFi issues or device instabilities
- includes some statistical data and common actions
- simplifies firmware updates

[Shelly Manager](doc/ShellyManager.md) could also act as a firmware upgrade proxy - the device doesn't need to connect directly to the Internet, instead openHAB services as a download proxy, which improves device security.

## Supported Devices

The binding supports both hardware generations

- Generation 1: The original Shelly devices like the Shelly 1, Shelly 2.5, Shelly Flood etc.
- Generation 2+3+4: Plus / Pro series of devices
- Shelly Plus Mini: Shelly Plus devices in compact format (Gen 2+3+4)
- Shelly BLU: Bluetooth based series of devices

The binding provides the same feature set across all devices as good as possible and depending on device specific features.

`Note:`
Using BLU devices or the Plus/Pro Range Extender mode require some additional configuration steps.
See section [Discovery](#discovery) for details.

### Generation 1

| thing-type        | Model                                                  | Vendor ID |
| ----------------- | ------------------------------------------------------ | --------- |
| shelly1           | Shelly 1 Single Relay Switch                           | SHSW-1    |
| shelly1l          | Shelly 1L Single Relay Switch                          | SHSW-L    |
| shelly1pm         | Shelly Single Relay Switch with integrated Power Meter | SHSW-PM   |
| shelly2-relay     | Shelly Double Relay Switch in relay mode               | SHSW-21   |
| shelly2-roller    | Shelly2 in Roller Mode                                 | SHSW-21   |
| shelly25-relay    | Shelly 2.5 in Relay Switch                             | SHSW-25   |
| shelly25-roller   | Shelly 2.5 in Roller Mode                              | SHSW-25   |
| shelly4pro        | Shelly 4x Relay Switch                                 | SHSW-44   |
| shellydimmer      | Shelly Dimmer                                          | SHDM-1    |
| shellydimmer2     | Shelly Dimmer2                                         | SHDM-2    |
| shellyix3         | Shelly ix3                                             | SHIX3-1   |
| shellyuni         | Shelly UNI, Shelly Plus UNI                            | SHUNI-1   |
| shellyplug        | Shelly Plug                                            | SHPLG2-1  |
| shellyplugs       | Shelly Plug-S                                          | SHPLG-S   |
| shellyem          | Shelly EM with integrated Power Meters                 | SHEM      |
| shellyem3         | Shelly 3EM with 3 integrated Power Meter               | SHEM-3    |
| shellyrgbw2-color | Shelly RGBW2 Controller in Color Mode                  | SHRGBW2   |
| shellyrgbw2-white | Shelly RGBW2 Controller in White Mode                  | SHRGBW2   |
| shellybulb-color  | Shelly Bulb in Color Mode                              | SHBLB-1   |
| shellybulb-white  | Shelly Bulb in White Mode                              | SHBLB-1   |
| shellybulbduo     | Shelly Duo White                                       | SHBDUO-1  |
| shellybulbduo     | Shelly Duo White G10                                   | SHBDUO-1  |
| shellycolorbulb   | Shelly Duo Color G10                                   | SHCB-1    |
| shellyvintage     | Shelly Vintage (White Mode)                            | SHVIN-1   |
| shellyht          | Shelly Sensor (temperature+humidity)                   | SHHT-1    |
| shellyflood       | Shelly Flood Sensor                                    | SHWT-1    |
| shellysmoke       | Shelly Smoke Sensor                                    | SHSM-1    |
| shellymotion      | Shelly Motion Sensor                                   | SHMOS-01  |
| shellymotion2     | Shelly Motion Sensor 2                                 | SHMOS-02  |
| shellygas         | Shelly Gas Sensor                                      | SHGS-1    |
| shellydw          | Shelly Door/Window                                     | SHDW-1    |
| shellydw2         | Shelly Door/Window 2                                   | SHDW-2    |
| shellybutton1     | Shelly Button 1                                        | SHBTN-1   |
| shellybutton2     | Shelly Button 2                                        | SHBTN-2   |
| shellysense       | Shelly Motion and IR Controller                        | SHSEN-1   |
| shellytrv         | Shelly TRV                                             | SHTRV-01  |

### Shelly Plus series (Generation 2+3+4)

| thing-type           | Model                                                    | Vendor ID                                                                 |
| -------------------- | -------------------------------------------------------- | ------------------------------------------------------------------------- |
| shellyplus1          | Shelly Plus 1 with 1x relay                              | SNSW-001X16EU, S3SW-001X16EU, S4SW-001X16EU                               |
| shellyplus1l         | Shelly Plus 1L with 1x relay                             | S3SW-0A1X1EUL, S4SW-0A1X1EUL                                              |
| shellyplus1pm        | Shelly Plus 1PM with 1x relay + power meter              | SNSW-001P16EU, S3SW-001P16EU, S4SW-001P16EU                               |
| shellyplus2l         | Shelly Plus 2L with 2x relay                             | S3SW-0A2X4EUL, S4SW-0A2X4EUL                                              |
| shellyplus2pm-relay  | Shelly Plus 2PM with 2x relay + power meter, relay mode  | SNSW-002P16EU, SNSW-102P16EU, S3SW-002P16EU, SNSW-002P15UL, S4SW-002P16EU |
| shellyplus2pm-roller | Shelly Plus 2PM with 2x relay + power meter, roller mode | SNSW-002P16EU, SNSW-102P16EU, S3SW-002P16EU, SNSW-002P15UL, S4SW-002P16EU |
| shellyplusshutter    | Shelly Plus Shutter for 1x roller                        | S3SH-0A2P4EU                                                              |
| shellyplusem         | Shelly Plus EM                                           | S3EM-002CXCEU                                                             |
| shellyplus3em63      | Shelly Plus 3EM-63                                       | S3EM-002CXCEU                                                             |
| shellyplusplug       | Shelly Plug-S                                            | SNPL-00112EU, SNPL-10112EU, S3PL-00112EU                                  |
| shellyplusplug       | Shelly Plug-IT                                           | SNPL-00110IT                                                              |
| shellyplusplug       | Shelly Plug-UK                                           | SNPL-00112UK                                                              |
| shellyplusplug       | Shelly Plug-S Gen 3                                      | S3PL-00112EU                                                              |
| shellyplusplug       | Shelly AZ Plug                                           | S3PL-10112EU                                                              |
| shellyplusplug       | Shelly Outdoor Plug-S                                    | S3PL-20112EU                                                              |
| shellyplusplug       | Shelly Plug M Gen3                                       | S3PL-30110EU                                                              |
| shellyplusplugus     | Shelly Plug-US                                           | SNPL-00116US                                                              |
| shellyplugusg4       | Shelly Plug US Gen4                                      | S4PL-00116US                                                              |
| shellyplusplugcpm    | Shelly Plus Plug CPM (EU C-type, Gen4)                   | S4PL-00116EU                                                              |
| shellyplusstrip      | Shelly Plus Power Strip 4                                | S4PL-00416EU                                                              |
| shellyplusi4         | Shelly Plus i4 with 4x AC input                          | SNSN-0024X, S3SN-0024X                                                    |
| shellyplusi4dc       | Shelly Plus i4 with 4x DC input                          | SNSN-0D24X                                                                |
| shellyplus10v        | Shelly Plus Dimmer 0/10V (Gen 2) or 0/1/10V (Gen 3)      | SNDM-00100WW, S3DM-0010WW                                                 |
| shellyplusuni        | Shelly Plus UNI                                          | SNSN-0043X                                                                |
| shellyplusht         | Shelly Plus HT with temperature + humidity sensor        | SNSN-0013A, S3SN-0U12A                                                    |
| shellyplussmoke      | Shelly Plus Smoke sensor                                 | SNSN-0031Z                                                                |
| shellyplusflood      | Shelly Flood Gen4 water leak sensor                      | S4SN-0071A                                                                |
| shellypluswdus       | Shelly Plus Wall Dimmer US                               | SNDM-0013US                                                               |
| shellyplusdimmer     | Shelly Plus Dimmer Gen 3                                 | S3DM-0A101WWL                                                             |
| shellyprodm2pm       | Shelly Pro Dimmer 2PM                                    | SPDM-002PE01EU                                                            |
| shellyplusrgbwpm     | Shelly Plus RGBW PM                                      | SNDC-0D4P10WW                                                             |
| shellywalldisplay    | Shelly Plus Wall Display                                 | SAWD-0A1XX10EU1                                                           |
| shellyblugw          | Shelly BLU Gateway                                       | SNGW-BT01                                                                 |
| shellyblugw3         | Shelly BLU Gateway 3                                     | S3GW-1DBT001                                                              |

### Shelly Plus Mini series (Generation 2+3+4)

| thing-type    | Model                                            | Vendor ID                                |
| ------------- | ------------------------------------------------ | ---------------------------------------- |
| shelly1mini   | Shelly Plus 1 Mini with 1x relay                 | SNSW-001X8EU, S3SW-001X8EU, S4SW-001X8EU |
| shelly1pmmini | Shelly Plus 1PM Mini with 1x relay + power meter | SNSW-001P8EU, S3SW-001P8EU, S4SW-001P8EU |
| shellypmmini  | Shelly Plus PM Mini with 1x power meter          | SNPM-001PCEU16, S3PM-001PCEU16           |
| shellyemmini  | Shelly Plus EM Mini with 1x power meter          | S4EM-001PXCEU16                          |

### Shelly Pro Series (Generation 2+3)

| thing-type          | Model                                                     | Vendor ID                                      |
| ------------------- | --------------------------------------------------------- | ---------------------------------------------- |
| shellypro1          | Shelly Pro 1 with 1x relay                                | SPSW-001XE16EU, SPSW-101XE16EU, SPSW-201XE16EU |
| shellypro1pm        | Shelly Pro 1 PM with 1x relay + power meter               | SPSW-001PE16EU, SPSW-101PE16EU, SPSW-201PE16EU |
| shellypro1cb        | Shelly Pro 1 Circuit Breaker with 1x relay + volt meter   | SPCB-01VENEU                                   |
| shellypro2-relay    | Shelly Pro 2 with 2x relay, relay mode                    | SPSW-002XE16EU, SPSW-102XE16EU, SPSW-202XE16EU |
| shellypro2pm-relay  | Shelly Pro 2 PM with 2x relay + power meter, relay mode   | SPSW-002PE16EU, SPSW-102PE16EU, SPSW-202PE16EU |
| shellypro2pm-roller | Shelly Pro 2 PM with 2x relay + power meter, roller mode  | SPSW-002PE16EU, SPSW-102PE16EU, SPSW-202PE16EU |
| shellypro3          | Shelly Pro 3 with 3x relay (dry contacts)                 | SPSW-003XE16EU                                 |
| shellypro4pm        | Shelly Pro 4 PM with 4x relay + power meter               | SHPSW04P, SPSW-004PE16EU, SPSW-104PE16EU       |
| shellyproem50       | Shelly Pro EM-50 - 2 channel, single phase energy meter   | SPEM-002CEBEU50                                |
| shellypro3em        | Shelly Pro 3EM - 3-phase energy meter                     | SPEM-003CEBEU, SPEM-003CEBEU120                |
| shellypro3em3ct63   | Shelly Pro 3EM-3CT63 - single or three-phase energy meter | SPEM-003CEBEU63                                |
| shellypro3em400     | Shelly Pro 3EM-400 - 3-phase energy meter                 | SPEM-003CEBEU400                               |

### Shelly BLU

| thing-type           | Model                                                  | Vendor ID               |
| -------------------- | ------------------------------------------------------ | ----------------------- |
| shellyblubutton      | Shelly BLU Button 1, Shelly BLU Tough                  | SBBT-002C               |
| shellyblubutton      | Shelly BLU Tough ZB                                    | SBBT-102C               |
| shellybluwallswitch4 | Shelly BLU Wallswitch 4                                | SBBT-EU5027             |
| shellyblurcbutton4   | Shelly BLU RC Button 4                                 | SBBT-004CUS             |
| shellyblurcbutton4   | Shelly BLU RC Button 4 ZB                              | SBBT-104CUS             |
| shellybluht          | Shelly BLU H&T                                         | SBHT-003C               |
| shellybluht          | Shelly BLU H&T ZB                                      | SBHT-203C               |
| shellybluht          | Shelly BLU H&T Display ZB                              | SBHT-103C               |
| shellybludw          | Shelly BLU Door/Windows                                | SBDW-002C               |
| shellybludw          | Shelly BLU Door/Window ZB                              | SBDW-103C               |
| shellyblumotion      | Shelly BLU Motion                                      | SBMO-003Z               |
| shellyblumotion      | Shelly BLU Motion ZB                                   | SBMO-103Z               |
| shellybludistance    | Shelly BLU Distance                                    | SBDI-003E               |
| shellybluremote      | Shelly BLU Remote Control                              | SBRC-005B               |
| shellybluws90        | Ecowitt WS90 Weather Station (Shelly BLU)              | SBWS-90CM               |

### Special Thing Types

| thing-type    | Model                                                 | Vendor ID |
| ------------- | ----------------------------------------------------- | --------- |
| shellydevice  | A password protected Shelly device or an unknown type |           |
| shellyunknown | An unknown Shelly device / model has been detected    |           |

## Binding Configuration

The binding has the following configuration options:

### Generation 1

| Parameter       | Description                                                         | Mandatory | Default |
| --------------- | ------------------------------------------------------------------- | --------- | ------- |
| defaultUserId   | Default user id for HTTP authentication when not set in the Thing   | no        | admin   |
| defaultPassword | Default password for HTTP authentication when not set in the Thing  | no        | admin   |
| autoCoIoT       | Auto-enable CoIoT events when firmware 1.6+ is enabled (Gen1 only). | no        | true    |

`defaultUserId` and `defaultPassword:` will be used by the binding if device protection is enabled.
However, the Plus/Pro devices have a fixed user id admin`. Nevertheless the binding provide that option to allow a mixed operation of Gen 1 and 2 devices in the same installation having same defaults.

`Generation 1`: The binding defaults to CoIoT events when firmware 1.6 or newer is detected.
CoIoT provides near-realtime updates on device status changes.

This mode also overrules event settings in the Thing configuration.
Disabling this feature allows granular control, which event types will be used.
This is also required when the Shelly devices are not located on the same IP subnet (e.g. using a VPN).
In this case autoCoIoT should be disabled, CoIoT events will not work, because the underlying CoAP protocol is based on Multicast IP, which usually doesn't passes a VPN or routed network.

## Firmware

`Generation 1`: The binding requires firmware version 1.9.2 or newer to enable all features.
`Generation 2+3` Those Shelly devices require firmware version 1.0.0 or newer (1.10.0+ is recommended).
`Shelly BLU series`: Use the Shelly app to update to version 1.0+ of the firmware.

Some of the features are enabled dynamically or are not available depending on device type and firmware release.
The Web UI of the Shelly device displays the current firmware version under Settings:Firmware and shows an update option when a newer version is available.

The current firmware version is reported in the Thing Properties.
A dedicated channel indicates the availability of a newer firmware (`device#updateAvailable`, not available for BLU devices).
Use the device's Web UI or the Shelly App to perform the update.

Check [Advanced Users](doc/AdvancedUsers.md) for information how to update your device.

Once you have updated the device **you should delete and re-discover** the openHAB Thing.
This makes sure that the Thing is correctly initialized and all supported channels are created.
openHAB will restore the channel/item linkage from the previous configuration, there is no need to re-create those manually.

## Discovery

In general devices need to be active to be discovered by the binding.
Battery powered devices need to wake up by pressing the button, they will stay active for a minute or so, which gives you enough time to start the discovery.

The binding uses mDNS to discover the Shelly devices.
They periodically announce their presence, which is used by the binding to find them on the local network.
Sometimes you need to run the manual discovery multiple times until you see all your devices.

`Important for Generation 1 Devices:`
It's strongly recommended to enable CoIoT in the device settings for faster response times (event driven rather than polling).
Open the device's Web UI, section "COIOT settings" and select "Enable COCIOT".
It's recommended to switch the Shelly devices to CoAP peer mode if you have only your openHAB system controlling the device.
This allows routing the CoIoT/CoAP messages across multiple IP subnets without special network setup required.
You could use Shelly Manager (doc/ShellyManager.md) to easily do the setup (configuring the openHAB host as CoAP peer address).
Keep Multicast mode if you have multiple hosts, which should receive the CoAP updates.

### Discovery of BLU Devices

The BLU devices use Bluetooth Low Energy (BLE).
The binding can't communicate directly with the device, so a Shelly Plus/Pro device is required with enabled Bluetooth to use those devices as a hub.
The binding automatically installs a script on the Shelly Device (oh-blu-scanner.js), which forwards the BLU events to the binding.

Follow these steps to add the Shelly BLU Device to openHAB:

- Make sure a Shelly is nearby the BLU device, and enable Bluetooth on this device (**disabling the 'Bluetooth Gateway' mode** in the Shelly app/UI is recommended).
- Add this Thing to openHAB, make sure Thing gets online
- Enable "BLU Gateway Support" in the Thing configuration of the Shelly device acting as gateway.
- Now press the button on your BLU device, this wakes up the device and the script forwards this event to the binding
- As a result the corresponding Thing should show up in the Inbox
- Add the Thing (at this point no channels are created), the new Thing will show status CONFIG_PENDING
- Click the device button again, the binding gets another event and creates the channels and Thing changes status to ONLINE
- Finally link the channels to the equipment in the model

`Note:`

- During initialization the script 'oh-blu-scanner.js' gets installed and activated on the Shelly Gateway device.
- Shelly BLU Motion: It may take some time until channels like Lux show up.
- Ecowitt WS90: The WS90 is solar-powered and broadcasts continuously — no button press is required to add it to the Inbox.
  It will appear automatically once it is within range of a configured BLU gateway.

Try moving the device to force status updates.

Every time an event is received sensors#lastUpdate and channels are updated with the reported values.
`device#wifiSignal` indicates the Bluetooth signal strength and gets updated when the device sends an event.

The binding supports multiple Shelly Plus/Pro as gateway devices unless they are added as Thing and are ONLINE.
In this scenario the channel `device#gatewayDevice` will report the last hub device, which forwarded a status update.

### Password Protected Devices

The Shelly devices can be configured to require authorization through a user id and password.
In this case you need to set these values in the Thing configuration after approving the Inbox entry.

If you have multiple devices protected by the same credentials it's recommended to set the default user id and password in the binding configuration BEFORE running the discovery.
In this case the binding could directly access the device to retrieve the required information using those credentials.
Otherwise a Thing of type shellyprotected is created in the Inbox and you could set the credentials while adding the Thing.
In this case the credentials are persisted as part of the Thing configuration.

### Range Extender Mode

The Plus/Pro devices support the so-called Range Extender Mode (not available for Gen1).
This allows connecting Shellys that are normally not reachable due to a lack of Wi-Fi signal.
Once enabled the Shelly acts as a hub to the linked devices, like a WiFi repeater.
The hub device enables the access point, which can be seen by the linked device.
The binding can then access the secondary device using &lt;hub Shelly IP&gt;:&lt;special port&gt;.
A special port on the hub device will be created for every linked device, so one hub device can support multiple linked devices.

The binding communicates with the Shelly hub device, which then forwards the request to the secondary device.
Once the Thing for the primary Shelly goes online the binding detects the enabled range extender mode and adds all connected secondary devices to the Inbox.
This means: The primary Shelly has to complete initialization before linked secondary devices are discovered.

- Discover primary/hub Shelly
- Add Thing and wait until it goes ONLINE
- Check Inbox to find the secondary/linked devices
- Add secondary device as usual

If you add another secondary device to the same hub device, suspend and resume the primary Thing; this will run a new initialization and add the new secondary device to the Inbox.

### Dynamic creation of channels

The Shelly series of devices has many combinations of relays, meters (different versions), sensors etc.
For this the binding creates various channels dynamically based on the status information provided by the device at initialization time.
If a channel is missing make sure the Thing was discovered correctly and is ONLINE.
If a channel is missing delete the Thing and re-discover it.
Creation of those channels takes about 5-10sec, maybe you need to reload the page to update the browser status.

### Important for battery powered devices

Make sure to wake up battery powered devices, so that they show up on the network.
The Shelly Button 1 needs to be connected to USB, other devices like Flood have a push button inside.
For those open the case, press that button and the LED starts flashing.
Wait a moment and then start the discovery. The device should show up in the Inbox and can be added.
Sometimes you need to run the discovery multiple times.

### Roller Favorites

Firmware 1.9.2+ for Shelly 2.5 and 0.11+ for Plus 2PM in roller mode supports so called roller favorites for positions.
You could use the Shelly App to setup 4 different positions (percentage) and assign id 1-4.
The channel `roller#rollerFav` allows to select those from openHAB and the roller moves to the desired position.
In the Thing configuration you could also configure an id when the `roller#control` channel receives UP or DOWN.
Values 1-4 are selecting the corresponding favorite id in the Shelly App, 0 means no favorite.

## Power / Energy Meters

There are different types of meters.

- Standard relay and roller devices have Meters or Enhanced Meters - e.g. Shelly Plus 1PM, 2PM
- There are various devices providing an Energy Meter like 3EM/EM-50, EM Mini etc. - those are specifically designed for energy management

The device dynamically detects which meter data is provided and creates channels representing the data.
Each meter is represented by a meter channel group.
Devices with a single meter only have the `meter` group, devices with more than one meter have `meter1`, `meter2`... channel groups.

| Device family                   | Meters | Total energy | Returned energy | Reactive power | Apparent power | Minute energy | Frequency |
| ------------------------------- | ------ | ------------ | --------------- | -------------- | -------------- | ------------- | --------- |
| Gen1 relay-PM (Shelly 1PM, 2.5) | 1      | Yes          | —               | —              | —              | Yes           | —         |
| Gen1 3EM                        | 3      | Yes          | Yes             | Yes            | —              | Yes           | —         |
| Plus 1PM / Plus 2PM (Gen2/Gen3) | 1–2    | Yes          | —               | —              | —              | Yes           | —         |
| Plus 1PM Gen4                   | 1      | Yes          | —               | —              | —              | Yes           | Yes       |
| Plus Plug S                     | 1      | Yes          | —               | —              | —              | Yes           | —         |
| Pro 3EM / 3EM-63 / 3EM-400      | 3      | Yes          | Yes             | —              | Yes            | Yes           | Yes       |
| Pro EM-50                       | 1–2    | Yes          | Yes             | —              | Yes            | Yes           | Yes       |
| Plus EM Mini Gen4               | 1      | Yes          | Yes             | —              | Yes            | Yes           | Yes       |

The Pro 3EM monophase profile treats its three clamps as three independent single-phase meters rather than one 3-phase meter.

Channels are created depending on device generation / series (1..4, BLU), capabilities and firmware.
Therefore, not all channels are available for all devices.

### Minute Energy — Units and Conversion

The firmware reports the energy of the last complete minute in different raw units per generation.
The binding converts both to Wh so the value is directly comparable across devices:

| Generation | Source field           | Raw unit              | Conversion        |
| ---------- | ---------------------- | --------------------- | ----------------- |
| Gen1       | `meters[].counters[0]` | Watt-minutes (W-min)  | value ÷ 60 → Wh   |
| Gen2+      | `aenergy.by_minute[0]` | Milliwatt-hours (mWh) | value ÷ 1000 → Wh |

This applies to Gen1 devices with a power meter (e.g. 1PM, Plug-S, Shelly 2/2.5, dimmers) and to Gen2+ relay, roller and PM devices.
EM/3EM energy-meter devices of any generation (e.g. Shelly EM, 3EM, Plus EM, EM Mini, Pro 3EM, Pro EM-50) do not report per-minute energy at all, so `energyHistMin1`/`2`/`3` and `energyAvgLast3Min` are never created for those devices.

### Last-Minute Energy Samples and 3-Minute Average

The device firmware reports the energy of each of the previous 3 complete minutes as independent per-minute sums, not as a running average.
`energyHistMin1`, `energyHistMin2` and `energyHistMin3` expose those raw per-minute totals (in Wh) unchanged — `energyHistMin1` is the total for minute -1 (the most recently completed minute), `energyHistMin2` for minute -2, and `energyHistMin3` for minute -3.
They only get created if the device actually reports that many per-minute samples — some devices only report the most recent minute.

`energyAvgLast3Min` (advanced channel) is computed by the binding as the average of `energyHistMin1`/`2`/`3` (their sum divided by 3) and is only created once all three samples are available.
It smooths out short spikes and dips, which is useful for automations that should react to a sustained load change rather than a single noisy sample.

### Power Factor Range

Power factor is reported as a plain number between −1.0 and +1.0 (not a dimensionless quantity), consistent across all devices that report it (3EM, EM-50, EM Mini).

### Returned (Fed-Back) Energy

Devices that measure bidirectional energy flow (3EM, EM-50, EM Mini, solar/grid-tie setups) report returned energy separately from consumed energy.
Single-clamp devices (EM Mini, Pro EM-50 single clamp) report the clamp's own returned-energy total; the same value doubles as the device-level total when only one clamp is present.
Three-phase devices (Pro 3EM) report returned energy per phase and an aggregated device-level total across all phases.

openHAB 5.2.1 renamed several meter-related channels; see [Channel Migration and Deprecated Channels](#channel-migration-and-deprecated-channels) for the full old-to-new mapping.

### Resetting Accumulated Energy

The `resetTotals` channel (type Switch) resets a device's accumulated energy counters when set to ON.
Its placement depends on the device type:

- Gen2+ devices with a meter (relay-PM, roller, PM, EM/EM1 clamp meters, EM-50, EM Mini) and the Gen1 EM expose `resetTotals` per meter group (`meter#resetTotals`, `meter1#resetTotals`, ...), resetting only that meter's counters.
- Three-phase 3EM devices (Gen1 3EM, Plus 3EM-63, Pro 3EM) expose `resetTotals` once in the common `device` group; it resets all phases together.
- Gen1 devices with a simple power meter (e.g. 1PM, Plug-S, Shelly 2/2.5, dimmers) have no reset API in the firmware, so no `resetTotals` channel is created for them.

### Thing Status

The binding sets the following Thing status depending on the device status:

| Status                | Description                                                                                                                                                                                                                  |
| --------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| INITIALIZING          | This is the default status while initializing the Thing. Once the initialization is triggered the Thing switches to Status ONLINE.CONFIGURATION_PENDING.                                                                     |
| UNKNOWN               | Indicates that the status is currently unknown, which must not show a problem. Once the device is reachable and was initialized the Thing switches to status ONLINE.                                                         |
| CONFIGURATION_PENDING | Device initialization in progress or pending (e.g., waiting for device wake-up).                                                                                                                                             |
| ONLINE                | Device is accessible and responding. Battery-powered devices stay ONLINE while in sleep mode. An integrated watchdog timer supervises the device. Switches to OFFLINE on communication errors.                               |
| OFFLINE               | Communication with the device failed. Check Thing status and openHAB logs for error details.                                                                                                                                 |
| COMMUNICATION_ERROR   | Communication with the device has reported an error, check detailed status. If the problem persists make sure to have stable WiFi, set the correct password etc. Try restarting OH or deleting and re-discovering the Thing. |
| FIRMWARE_UPDATING     | Device firmware is updating, just wait. The device should come back to ONLINE within 2 minutes.                                                                                                                              |
| DUTY_CYCLE            | The device is re-initializing and reported a restart event, e.g. after a firmware update or manual reboot.                                                                                                                   |

`Note:`
For more details see  [Thing Concept](https://www.openhab.org/docs/concepts/things.html#status-details) in openHAB documentation.

`Battery powered devices:`
If the device is in sleep mode and can't be reached by the binding, the Thing will change into CONFIG_PENDING.
Once the device wakes up, the Thing will perform initialization and the state will change to ONLINE.

The first time a device is discovered and initialized successfully, the binding will be able to perform auto-initialization when OH is restarted.  Waking up the device triggers the a status report (CoIoT packet for event url for Gen1 and WebSocket call for Gen2), which is processed by the binding and triggers initialization. Once a device is initialized, it is no longer necessary to manually wake it up after an openHAB restart unless you change the battery. In this case press the button and run the discovery again.

### Device Watchdog

The binding supervises availability of the device once it becomes ONLINE by sending periodic status requests to the device. The watchdog is restarted when the device is responding properly.

Communication errors are handled depending on the device type:

- regular power devices change to OFFLINE, because this status indicates an error
- battery powered devices stay ONLINE, because usually the device is in sleep mode

The binding also monitors that the device is responding at least once within a given time period.
The period is computed depending on the device type and configuration:

- battery  powered devices: &lt;sleepPeriod from device config&gt; + 10min, usually 12h+10min=730min
- else, if CoIoT or WebSocket is enabled: 3*&lt;update Period from device settings&gt;+10sec, usually3*15+10=45sec
- else 2*60+10sec = 130sec

Once the timer expires the device switches to OFFLINE and the bindings starts to re-initialize the device periodically.

You could also create a rule to catch those status changes or device alarms (see rule examples).

## Thing Configuration

| Parameter          | Description                                                   | Mandatory | Default                                            |
| ------------------ | ------------------------------------------------------------- | --------- | -------------------------------------------------- |
| deviceIp           | IP address of the Shelly device                               | yes       | none                                               |
| userId             | The user id used for HTTP authentication                      | no        | none                                               |
| password           | Password for HTTP authentication                              | no        | none                                               |
| brightnessAutoOn   | true: Output will be activated when brightness > 0 is set     | no        | true                                               |
| lowBattery         | Threshold for battery level. Set alert when level is below.   | no        | 20 (=20%), only for battery powered devices        |
| updateInterval     | Interval for the background status check in seconds.          | no        | 1h for battery powered devices, 60s for all others |
| eventsButton       | true: register event "trigger when a button is pushed"        | no        | false                                              |
| eventsPush         | true: register event "trigger on short and long push"         | no        | false                                              |
| eventsSwitch       | true: register event "trigger of switching the relay output"  | no        | true                                               |
| eventsSensorReport | true: register event "posted updated sensor data"             | no        | true for sensor devices                            |
| eventsCoIoT        | true: Listen for CoIoT/COAP events                            | no        | true for battery devices, false for others         |
| eventsRoller       | true: register event "trigger" when the roller updates status | no        | true for roller devices                            |
| favoriteUP         | 0-4: Favorite id for UP (see Roller Favorites)                | no        | 0 = no favorite id                                 |
| favoriteDOWN       | 0-4: Favorite id for DOWN (see Roller Favorites)              | no        | 0 = no favorite id                                 |
| enableBluGateway   | true: Activate BLU gateway support (install script)           | no        | false                                              |

### General Notes

Every device has a channel group `device` with the following channels:

| Group  | Channel                   | Type          | read-only | Description                                                                    |
| ------ | ------------------------- | ------------- | --------- | ------------------------------------------------------------------------------ |
| device | deviceName                | String        | yes       | Device name as configured in the Shelly App                                    |
|        | uptime                    | Number        | yes       | Number of seconds since the device was powered up                              |
|        | wifiSignal                | Number        | yes       | WiFi signal strength (4=excellent, 3=good, 2=not string, 1=unreliable, 0=none) |
|        | internalTemp              | Number        | yes       | Internal device temperature (when provided by the device)                      |
|        | selfTest                  | String        | yes       | Result from device self-test (pending/not_completed/running/completed/unknown) |
|        | alarm                     | Trigger       | yes       | Self-Test result not_completed/completed/running/pending                       |
|        | supplyVoltage             | Number        | yes       | Shelly 1PM, 1L, 2.5: Supply voltage (fixed or measured depending on device)    |
|        | accumulatedPower          | Number:Power  | yes       | Total instantaneous active power across all meters of the device               |
|        | totalEnergy               | Number:Energy | yes       | Total energy consumption of the device in kWh (device total or binding sum)    |
|        | accumulatedReturnedEnergy | Number:Energy | yes       | Accumulated returned energy in kWh for the device (including all meters)       |
|        | accumulatedApparent       | Number:Power  | yes       | Accumulated apparent power in VA for the device (including all meters)         |
|        | resetTotals               | Switch        | r/w       | 3EM devices only: Send ON to reset accumulated energy counters (all phases)    |
|        | heartBeat                 | DateTime      | yes       | Timestamp of the last successful device communication                          |
|        | updateAvailable           | Switch        | yes       | ON: A firmware update is available                                             |
|        | statusLed                 | Switch        | r/w       | ON: Status LED is disabled, OFF: LED enabled                                   |
|        | powerLed                  | Switch        | r/w       | ON: Power LED is disabled, OFF: LED enabled                                    |
|        | charger                   | Switch        | yes       | ON: USB charging cable is connected external power supply activated.           |
|        | calibrated                | Switch        | yes       | ON: Device/sensor is calibrated (if supported by device).                      |

Availability of channels is depending on the device type.
The binding detects many of those channels on-the-fly (when Thing changes to ONLINE state) and adjusts the Thing's channel structure.
The device must be discovered and ONLINE to successfully complete this process.
The accumulated channels are only available for devices with more than 1 meter.
`accumulatedReturnedEnergy` and `accumulatedApparent` are available for multi-meter EM devices (Gen1: Shelly EM, 3EM; Gen2: Plus EM, Plus 3EM-63, Pro 3EM, Pro EM-50).
The LED channels are available for the Plug-S with firmware 1.6x and for various other devices with firmware 1.8 or newer.
The binding detects them automatically.

## Events

### Generation 1: Action URLs vs. CoIoT

Depending on the firmware release, Shelly devices support two different mechanisms to report sensor updates or events.

Action URLs
Usually the binding polls the device to update the status and maps the returned values to the various channels.
In addition the binding can register so-called Action URLs. Those events are triggered by the device to report special events.
You need to disable autoCoIoT in the binding configuration to make specific selections for the Action events.

The following event types could be registered when enabled in the Thing configuration:

| Event Type         | Description                                                                                                                 |
| ------------------ | --------------------------------------------------------------------------------------------------------------------------- |
| eventsButton       | This event is triggered when the device is in button mode. The device reports the ON/OFF status of the button.              |
| eventsSwitch       | This event reports the status of the relay output. This could change by the button or API calls.                            |
| eventsPush         | The device reports the short/longpush events when in  button mode momentary, momentary_on_release, one_button or two_button |
| eventsSensorReport | Sensor devices (like H&T) provide sensor updates when this action URL is enabled.                                           |

`Important:`
The binding defaults to CoIoT when firmware 1.6 or newer is detected.
This has significant experience improvements and also prevents interfering with other applications, because the device only supports one set of Action URLs.

CoIoT / CoAP
Starting with version 1.6 the devices reports most status values via the CoIoT protocol.
CoIoT provides near-realtime updates and better event support.
Firmware 1.7 adds additional status values, also supported by the binding.
Version 1.8 introduces CoIoT version 2, which fixes various issues with version 1 and provides almost all relevant status updates.

If there is no specific reason you should enable CoIoT.
Check section [Network Settings](doc/AdvancedUsers.md) for more information.

Enable the autoCoIoT option in the binding configuration or eventsCoIoT in the Thing configuration to activate CoIoT.

### Generation 2: WebSockets

The Plus and Pro series of devices use WebSockets for device communication.
Usually the binding establishes a WebSocket connection to the device (http port 80).
However, battery powered devices like the Plus HT are not reachable while the device is in sleep mode.
For those the binding sets up a so called "Outbound WebSocket" during device initialization.
Afterwards the device wakes up and calls the configured URL, which is the processed by the binding.
The device UI shows the URL when active.
Battery powered devices could only report events to a single host, take care if you have multiple openHAB instances on the same network.

### Button events

Various devices signal an event when the physical button is pressed.
This could be a switch connected to the SW input of the relay or the Button 1 or 2.

The following trigger types are sent:

| Event Type         | Description                                                         |
| ------------------ | ------------------------------------------------------------------- |
| SHORT_PRESSED      | The button was pressed once for a short time (lastEvent=S)          |
| DOUBLE_PRESSED     | The button was pressed twice with short delay (lastEvent=SS)        |
| TRIPLE_PRESSED     | The button was pressed three times with short delay (lastEvent=SSS) |
| LONG_PRESSED       | The button was pressed for a longer time (lastEvent=L)              |
| SHORT_LONG_PRESSED | A short followed by a long button push (lastEvent=SL)               |
| LONG_SHORT_PRESSED | A long followed by a short button push (lastEvent=LS)               |
| HOLDING            | Button held for at least 3 sec                                      |

Check the channel definitions for the various devices to see if the device supports those events.
You could use the Shelly App to set the timing for those events.

If you want to use those events triggering a rule:

- If a physical switch is connected to the Shelly use the input channel(`input` or `input1`/`input2`) to trigger a rule
- For a momentary button use the `button` trigger channel as trigger, channels `lastEvent` and `eventCount` will provide details on the event

### Alarms

The binding provides health monitoring functions for the device.
When an alarm condition is detected the channel alarm gets triggered and provides one of the following alarm types:

A new alarm will be triggered on a new condition or every 5 minutes if the condition persists.

### Non-battery powered devices

| Event Type   | Description                                                                       |
| ------------ | --------------------------------------------------------------------------------- |
| RESTARTED    | The device has been restarted. This could be an indicator for a firmware problem. |
| WEAK_SIGNAL  | An alarm is triggered when RSSI is < -80, which indicates an unstable connection. |
| OVERTEMP     | The device is overheating, check installation and housing.                        |
| OVERLOAD     | An over load condition has been detected, e.g. from the roller motor.             |
| OVERPOWER    | Maximum allowed power was exceeded. The relay was turned off.                     |
| LOAD_ERROR   | Device reported a load problem.                                                   |
| SENSOR_ERROR | Device reported a sensor problem.                                                 |
| VALVE_ERROR  | Device reported a problem with the valve.                                         |
| VIBRATION    | Device reported vibration.                                                        |
| LOW_BATTERY  | Device reported low battery.                                                      |

### Sensors

| Event Type | Description                                                                                      |
| ---------- | ------------------------------------------------------------------------------------------------ |
| POWERON    | Device was powered on.                                                                           |
| PERIODIC   | Periodic wakeup.                                                                                 |
| BUTTON     | Button was pressed, e.g. to wake up the device.                                                  |
| SENSOR     | Wake-up due to updated sensor data.                                                              |
| ALARM      | Alarm condition was detected, check status, could be OPENED for the DW, flood alarm, smoke alarm |
| BATTERY    | Device reported an update to the battery status.                                                 |
| TEMP_UNDER | Below "temperature under" threshold                                                              |
| TEMP_OVER  | Above "temperature over" threshold                                                               |
| VIBRATION  | A vibration/tamper was detected (DW2 only)                                                       |

Refer to section [Full Example](#full-example) for examples how to catch alarm triggers in openHAB rules.

## Channels

Depending on the device type and firmware release channels might be not available or stay with value NaN.

### Channel Migration and Deprecated Channels

openHAB 5.2.1 renamed several meter-related channels for naming consistency.
The binding migrates existing Things automatically at startup (one-time, schema-versioned); no re-discovery is required.
Old channel IDs stay active as deprecated, advanced channels and keep receiving updates, so existing item links and rules keep working; move to the new channel ID at your convenience since deprecated channels will be removed in a future release.

| Old channel ID               | New channel ID                     | Notes                                                                    |
| ---------------------------- | ---------------------------------- | ------------------------------------------------------------------------ |
| `meterN#currentWatts`        | `meterN#currentPower`              | unit unchanged (W)                                                       |
| `meterN#totalKWH`            | `meterN#totalEnergy`               | unit unchanged (kWh)                                                     |
| `meterN#returnedKWH`         | `meterN#returnedEnergy`            | unit unchanged (kWh)                                                     |
| `meterN#reactiveWatts`       | `meterN#reactivePower`             | old channel keeps its W unit, new channel reports VAR                    |
| `meterN#lastPower1`          | `meterN#energyHistMin1`            | old channel reports average power in W, new channel reports energy in Wh |
| `device#accumulatedWatts`    | `device#accumulatedPower`          | unit unchanged (W)                                                       |
| `device#accumulatedReturned` | `device#accumulatedReturnedEnergy` | unit unchanged (kWh)                                                     |
| `device#accumulatedWTotal`   | `device#totalEnergy`               | old channel reported incorrect values; use the new channel               |
| `device#totalKWH`            | `device#totalEnergy`               | unit unchanged (kWh)                                                     |
| `nmeter#nmTreshhold`         | `nmeter#nmThreshold`               | unit unchanged (A)                                                       |

`meterN#powerFactor` additionally changed type from `Number:Dimensionless` to plain `Number` (range −1.0 to +1.0).
This is an in-place type change on the same channel ID, not a rename, so there is no dual-write; items statically linked as `Number:Dimensionless` need relinking.

### Shelly 1 (thing-type: shelly1)

| Group   | Channel      | Type     | read-only | Description                                                                       |
| ------- | ------------ | -------- | --------- | --------------------------------------------------------------------------------- |
| relay   | output       | Switch   | r/w       | Controls the relay's output channel (on/off)                                      |
|         | outputName   | String   | yes       | Logical name of this relay output as configured in the Shelly App                 |
|         | input        | Switch   | yes       | ON: Input/Button is powered, see general notes on channels                        |
|         | button       | Trigger  | yes       | Event trigger with payload, see SHORT_PRESSED or LONG_PRESSED                     |
|         | lastEvent    | String   | yes       | Last event type (S/SS/SSS/L)                                                      |
|         | eventCount   | Number   | yes       | Counter gets incremented every time the device issues a button event.             |
|         | autoOn       | Number   | r/w       | Relay #1: Sets a  timer to turn the device ON after every OFF command; in seconds |
|         | autoOff      | Number   | r/w       | Relay #1: Sets a  timer to turn the device OFF after every ON command; in seconds |
|         | timerActive  | Switch   | yes       | Relay #1: ON: An auto-on/off timer is active                                      |
| sensors | temperature1 | Number   | yes       | Temperature value of external sensor #1 (if connected to temp/hum addon)          |
|         | temperature2 | Number   | yes       | Temperature value of external sensor #2 (if connected to temp/hum addon)          |
|         | temperature3 | Number   | yes       | Temperature value of external sensor #3 (if connected to temp/hum addon)          |
|         | humidity     | Number   | yes       | Humidity in percent (if connected to temp/hum addon)                              |
|         | lastUpdate   | DateTime | yes       | Timestamp of the last sensor update (heartbeat)                                   |
|         | input1       | Contact  | yes       | Status of the reed contact (OPEN/CLOSE), only with external switch add-on         |

### Shelly 1L (thing-type: shelly1l)

| Group   | Channel      | Type     | read-only | Description                                                                       |
| ------- | ------------ | -------- | --------- | --------------------------------------------------------------------------------- |
| relay   | output       | Switch   | r/w       | Controls the relay's output channel (on/off)                                      |
|         | outputName   | String   | yes       | Logical name of this relay output as configured in the Shelly App                 |
|         | input1       | Switch   | yes       | ON: Input/Button for input 1 is powered, see general notes on channels            |
|         | button1      | Trigger  | yes       | Event trigger, see section Button Events                                          |
|         | lastEvent1   | String   | yes       | Last event type (S/SS/SSS/L) for input 1                                          |
|         | eventCount1  | Number   | yes       | Counter gets incremented every time the device issues a button event.             |
|         | input2       | Switch   | yes       | ON: Input/Button for channel 2 is powered, see general notes on channels          |
|         | button2      | Trigger  | yes       | Event trigger, see section Button Events                                          |
|         | lastEvent2   | String   | yes       | Last event type (S/SS/SSS/L) for input 2                                          |
|         | eventCount2  | Number   | yes       | Counter gets incremented every time the device issues a button event.             |
|         | autoOn       | Number   | r/w       | Relay #1: Sets a  timer to turn the device ON after every OFF command; in seconds |
|         | autoOff      | Number   | r/w       | Relay #1: Sets a  timer to turn the device OFF after every ON command; in seconds |
|         | timerActive  | Switch   | yes       | Relay #1: ON: An auto-on/off timer is active                                      |
| meter   | currentPower | Number   | yes       | Current power consumption in Watts                                                |
|         | lastUpdate   | DateTime | yes       | Timestamp of the last measurement                                                 |
| sensors | temperature1 | Number   | yes       | Temperature value of external sensor #1 (if connected to temp/hum addon)          |
|         | temperature2 | Number   | yes       | Temperature value of external sensor #2 (if connected to temp/hum addon)          |
|         | temperature3 | Number   | yes       | Temperature value of external sensor #3 (if connected to temp/hum addon)          |
|         | humidity     | Number   | yes       | Humidity in percent (if connected to temp/hum addon)                              |
|         | lastUpdate   | DateTime | yes       | Timestamp of the last sensor update (heartbeat)                                   |
|         | input1       | Contact  | yes       | Status of the reed contact (OPEN/CLOSE), only with external switch add-on         |

`Note:`
The `meter` for the Shelly 1L is kind of fake.
It doesn't have a real power meter, but you could setup an estimated consumption in the Shelly App, e.g. 60W if you have attached a good old light bulb to the output channel.
In this case the is no real measurement based on power consumption, but the Shelly reports the configured value when the relay is ON.

### Shelly 1PM (thing-type: shelly1pm)

| Group   | Channel           | Type     | read-only | Description                                                                                        |
| ------- | ----------------- | -------- | --------- | -------------------------------------------------------------------------------------------------- |
| relay   | output            | Switch   | r/w       | Controls the relay's output channel (on/off)                                                       |
|         | outputName        | String   | yes       | Logical name of this relay output as configured in the Shelly App                                  |
|         | input             | Switch   | yes       | ON: Input/Button is powered, see General Notes on Channels                                         |
|         | button            | Trigger  | yes       | Event trigger, see section Button Events                                                           |
| meter   | currentPower      | Number   | yes       | Current power consumption in Watts                                                                 |
|         | energyHistMin1    | Number   | yes       | Total energy consumed during the previous complete minute, minute -1 (Wh)                          |
|         | energyHistMin2    | Number   | yes       | Total energy consumed during the complete minute 2 minutes ago, minute -2 (Wh)                     |
|         | energyHistMin3    | Number   | yes       | Total energy consumed during the complete minute 3 minutes ago, minute -3 (Wh)                     |
|         | energyAvgLast3Min | Number   | yes       | Average of the total energy per minute over the previous 3 complete minutes, minutes -1 to -3 (Wh) |
|         | totalEnergy       | Number   | yes       | Total energy consumption in kWh                                                                    |
|         | frequency         | Number   | yes       | Grid frequency (Hz) - Gen4 only                                                                    |
|         |                   |          |           |                                                                                                    |
|         | lastUpdate        | DateTime | yes       | Timestamp of the last measurement                                                                  |
| sensors | temperature1      | Number   | yes       | Temperature value of external sensor #1 (if connected to temp/hum addon)                           |
|         | temperature2      | Number   | yes       | Temperature value of external sensor #2 (if connected to temp/hum addon)                           |
|         | temperature3      | Number   | yes       | Temperature value of external sensor #3 (if connected to temp/hum addon)                           |
|         | humidity          | Number   | yes       | Humidity in percent (if connected to temp/hum addon)                                               |
|         | lastUpdate        | DateTime | yes       | Timestamp of the last sensor update (heartbeat)                                                    |
|         | input1            | Contact  | yes       | Status of the reed contact (OPEN/CLOSE), only with external switch add-on                          |

`Note`:
totalEnergy might reset on restart depending on device type and firmware version

### Shelly EM (thing-type: shellyem)

| Group  | Channel           | Type         | read-only | Description                                                                                        |
| ------ | ----------------- | ------------ | --------- | -------------------------------------------------------------------------------------------------- |
| relay  | output            | Switch       | r/w       | Controls the relay's output channel (on/off)                                                       |
|        | outputName        | String       | yes       | Logical name of this relay output as configured in the Shelly App                                  |
|        | input             | Switch       | yes       | ON: Input/Button is powered, see general notes on channels                                         |
|        | button            | Trigger      | yes       | Event trigger, see section Button Events                                                           |
|        | lastEvent         | String       | yes       | Last event type (S/SS/SSS/L)                                                                       |
|        | eventCount        | Number       | yes       | Counter gets incremented every time the device issues a button event.                              |
|        | autoOn            | Number       | r/w       | Relay #1: Sets a  timer to turn the device ON after every OFF command; in seconds                  |
|        | autoOff           | Number       | r/w       | Relay #1: Sets a  timer to turn the device OFF after every ON command; in seconds                  |
|        | timerActive       | Switch       | yes       | Relay #1: ON: An auto-on/off timer is active                                                       |
| meter1 | currentPower      | Number       | yes       | Current power consumption in Watts                                                                 |
|        | totalEnergy       | Number       | yes       | Total energy consumption in kWh                                                                    |
|        | returnedEnergy    | Number       | yes       | Total returned energy, kWh                                                                         |
|        | reactivePower     | Number:Power | yes       | Instantaneous reactive power (VAR)                                                                 |
|        | apparentPower     | Number:Power | yes       | Instantaneous apparent power (VA)                                                                  |
|        | voltage           | Number       | yes       | RMS voltage, Volts                                                                                 |
|        | powerFactor       | Number       | yes       | Power factor (-1.0 to 1.0)                                                                         |
|        | resetTotals       | Switch       | r/w       | Send ON to reset the accumulated energy counters for this meter                                    |
|        | lastUpdate        | DateTime     | yes       | Timestamp of the last measurement                                                                  |
| meter2 | currentPower      | Number       | yes       | Current power consumption in Watts                                                                 |
|        | totalEnergy       | Number       | yes       | Total energy consumption in kWh                                                                    |
|        | returnedEnergy    | Number       | yes       | Total returned energy, kWh                                                                         |
|        | reactivePower     | Number:Power | yes       | Instantaneous reactive power (VAR)                                                                 |
|        | apparentPower     | Number:Power | yes       | Instantaneous apparent power (VA)                                                                  |
|        | voltage           | Number       | yes       | RMS voltage, Volts                                                                                 |
|        | powerFactor       | Number       | yes       | Power factor (-1.0 to 1.0)                                                                         |
|        | resetTotals       | Switch       | r/w       | Send ON to reset the accumulated energy counters for this meter                                    |
|        | lastUpdate        | DateTime     | yes       | Timestamp of the last measurement                                                                  |

`Note`:
totalEnergy might reset on restart depending on device type and firmware version

### Shelly 3EM (thing-type: shellyem3)

`Note:`
The product is called Shelly 3EM whereas the device propagates the service under shellyem3.
The Thing id is derived from the service name, so that's the reason why the Thing is named shelly**em3** and not shelly3em.

| Group  | Channel           | Type         | read-only | Description                                                                                        |
| ------ | ----------------- | ------------ | --------- | -------------------------------------------------------------------------------------------------- |
| relay  | output            | Switch       | r/w       | Controls the relay's output channel (on/off)                                                       |
|        | outputName        | String       | yes       | Logical name of this relay output as configured in the Shelly App                                  |
|        | input             | Switch       | yes       | ON: Input/Button is powered, see general notes on channels                                         |
|        | button            | Trigger      | yes       | Event trigger, see section Button Events                                                           |
|        | lastEvent         | String       | yes       | Last event type (S/SS/SSS/L)                                                                       |
|        | eventCount        | Number       | yes       | Counter gets incremented every time the device issues a button event.                              |
|        | autoOn            | Number       | r/w       | Relay #1: Sets a  timer to turn the device ON after every OFF command; in seconds                  |
|        | autoOff           | Number       | r/w       | Relay #1: Sets a  timer to turn the device OFF after every ON command; in seconds                  |
|        | timerActive       | Switch       | yes       | Relay #1: ON: An auto-on/off timer is active                                                       |
| meter1 | currentPower      | Number       | yes       | Current power consumption in Watts                                                                 |
|        | totalEnergy       | Number       | yes       | Total energy consumption in kWh                                                                    |
|        | returnedEnergy    | Number       | yes       | Total returned energy, kWh                                                                         |
|        | reactivePower     | Number:Power | yes       | Instantaneous reactive power (VAR)                                                                 |
|        | apparentPower     | Number:Power | yes       | Instantaneous apparent power (VA)                                                                  |
|        | voltage           | Number       | yes       | RMS voltage, Volts                                                                                 |
|        | current           | Number       | yes       | Current in A                                                                                       |
|        | powerFactor       | Number       | yes       | Power factor (-1.0 to 1.0)                                                                         |
|        | lastUpdate        | DateTime     | yes       | Timestamp of the last measurement                                                                  |
| meter2 | currentPower      | Number       | yes       | Current power consumption in Watts                                                                 |
|        | totalEnergy       | Number       | yes       | Total energy consumption in kWh                                                                    |
|        | returnedEnergy    | Number       | yes       | Total returned energy, kWh                                                                         |
|        | reactivePower     | Number:Power | yes       | Instantaneous reactive power (VAR)                                                                 |
|        | apparentPower     | Number:Power | yes       | Instantaneous apparent power (VA)                                                                  |
|        | voltage           | Number       | yes       | RMS voltage, Volts                                                                                 |
|        | current           | Number       | yes       | Current in A                                                                                       |
|        | powerFactor       | Number       | yes       | Power factor (-1.0 to 1.0)                                                                         |
|        | lastUpdate        | DateTime     | yes       | Timestamp of the last measurement                                                                  |
| meter3 | currentPower      | Number       | yes       | Current power consumption in Watts                                                                 |
|        | totalEnergy       | Number       | yes       | Total energy consumption in kWh                                                                    |
|        | returnedEnergy    | Number       | yes       | Total returned energy, kWh                                                                         |
|        | reactivePower     | Number:Power | yes       | Instantaneous reactive power (VAR)                                                                 |
|        | apparentPower     | Number:Power | yes       | Instantaneous apparent power (VA)                                                                  |
|        | voltage           | Number       | yes       | RMS voltage, Volts                                                                                 |
|        | current           | Number       | yes       | Current in A                                                                                       |
|        | powerFactor       | Number       | yes       | Power factor (-1.0 to 1.0)                                                                         |
|        | lastUpdate        | DateTime     | yes       | Timestamp of the last measurement                                                                  |
| nmeter | ncurrent          | Number       | yes       | Neutral current based on N clamp (requires calibration)                                            |
|        | ixsum             | Number       | yes       | Measured current over all phases                                                                   |
|        | nmismatch         | Switch       | yes       | ON: abs(ncurrent-ixsum) is greater than nmThreshold                                                |
|        | nmThreshold       | Number       | yes       | Threshold (delta) before nMismatch goes ON                                                         |

`Note:`

- totalEnergy might reset on restart depending on device type and firmware version
- You should calibrate the device if you want to use "neutral current" measurements.
- Check the Shelly documentation for details.

### Shelly 2 - relay mode (thing-type: shelly2-relay)

| Group  | Channel           | Type     | read-only | Description                                                                                        |
| ------ | ----------------- | -------- | --------- | -------------------------------------------------------------------------------------------------- |
| relay1 | output            | Switch   | r/w       | Relay #1: Controls the relay's output channel (on/off)                                             |
|        | outputName        | String   | yes       | Logical name of this relay output as configured in the Shelly App                                  |
|        | input             | Switch   | yes       | ON: Input/Button is powered, see General Notes on Channels                                         |
|        | autoOn            | Number   | r/w       | Relay #1: Sets a  timer to turn the device ON after every OFF command; in seconds                  |
|        | autoOff           | Number   | r/w       | Relay #1: Sets a  timer to turn the device OFF after every ON command; in seconds                  |
|        | timerActive       | Switch   | yes       | Relay #1: ON: An auto-on/off timer is active                                                       |
|        | button            | Trigger  | yes       | Event trigger, see section Button Events                                                           |
| relay2 | output            | Switch   | r/w       | Relay #2: Controls the relay's output channel (on/off)                                             |
|        | outputName        | String   | yes       | Logical name of this relay output as configured in the Shelly App                                  |
|        | input             | Switch   | yes       | ON: Input/Button is powered, see General Notes on Channels                                         |
|        | autoOn            | Number   | r/w       | Relay #2: Sets a  timer to turn the device ON after every OFF command; in seconds                  |
|        | autoOff           | Number   | r/w       | Relay #2: Sets a  timer to turn the device OFF after every ON command; in seconds                  |
|        | timerActive       | Switch   | yes       | Relay #2: ON: An auto-on/off timer is active                                                       |
|        | button            | Trigger  | yes       | Event trigger, see section Button Events                                                           |
| meter  | currentPower      | Number   | yes       | Current power consumption in Watts                                                                 |
|        | energyHistMin1    | Number   | yes       | Total energy consumed during the previous complete minute, minute -1 (Wh)                          |
|        | energyHistMin2    | Number   | yes       | Total energy consumed during the complete minute 2 minutes ago, minute -2 (Wh)                     |
|        | energyHistMin3    | Number   | yes       | Total energy consumed during the complete minute 3 minutes ago, minute -3 (Wh)                     |
|        | energyAvgLast3Min | Number   | yes       | Average of the total energy per minute over the previous 3 complete minutes, minutes -1 to -3 (Wh) |
|        | totalEnergy       | Number   | yes       | Total energy consumption in kWh                                                                    |
|        | lastUpdate        | DateTime | yes       | Timestamp of the last measurement                                                                  |
|        | returnedEnergy    | Number   | yes       | Total returned energy, kWh                                                                         |

`Note`:
totalEnergy might reset on restart depending on device type and firmware version

| Group  | Channel           | Type          | read-only | Description                                                                                        |
| ------ | ----------------- | ------------- | --------- | -------------------------------------------------------------------------------------------------- |
| roller | control           | Rollershutter | r/w       | can be open (0%), stop, or close (100%); could also handle ON (open) and OFF (close)               |
|        | input             | Switch        | yes       | ON: Input/Button is powered, see General Notes on Channels                                         |
|        | event             | Trigger       | yes       | Roller event/trigger with payload ROLLER_OPEN / ROLLER_CLOSE / ROLLER_STOP                         |
|        | rollerpos         | Number        | r/w       | Roller position: 100%=open...0%=closed; gets updated when the roller stops, see Notes              |
|        | rollerFav         | Number        | r/w       | Select roller position favorite (1-4, 0=no), see Notes                                             |
|        | state             | String        | yes       | Roller state: open/close/stop                                                                      |
|        | stopReason        | String        | yes       | Last stop reasons: normal, safety_switch or obstacle                                               |
|        | safety            | Switch        | yes       | Indicates status of the Safety Switch, ON=problem detected, powered off                            |
| meter  | currentPower      | Number        | yes       | Current power consumption in Watts                                                                 |
|        | energyHistMin1    | Number        | yes       | Total energy consumed during the previous complete minute, minute -1 (Wh)                          |
|        | energyHistMin2    | Number        | yes       | Total energy consumed during the complete minute 2 minutes ago, minute -2 (Wh)                     |
|        | energyHistMin3    | Number        | yes       | Total energy consumed during the complete minute 3 minutes ago, minute -3 (Wh)                     |
|        | energyAvgLast3Min | Number        | yes       | Average of the total energy per minute over the previous 3 complete minutes, minutes -1 to -3 (Wh) |
|        | totalEnergy       | Number        | yes       | Total energy consumption in kWh                                                                    |
|        | lastUpdate        | DateTime      | yes       | Timestamp of the last measurement                                                                  |

`Note:`
The Roller should be calibrated using the device Web UI or Shelly App, otherwise the position can't be set.

The roller positioning calibration has to be performed using the Shelly Web UI or App before the position can be set in percent.
Refer to [Smartify Roller Shutters with openHAB and Shelly](doc/UseCaseSmartRoller.md) for more information on roller integration.

totalEnergy might reset on restart depending on device type and firmware version

### Shelly 2.5 - relay mode (thing-type: shelly25-relay)

The Shelly 2.5 includes 2 meters, one for each channel.
Firmware 1.9.2 or newer is required to use the roller position favorites, which are defined in the Shelly App.

| Group  | Channel | Type | read-only | Description                   |
| ------ | ------- | ---- | --------- | ----------------------------- |
| relay1 |         |      |           | See group relay1 for Shelly 2 |
| relay2 |         |      |           | See group relay1 for Shelly 2 |
| meter1 |         |      |           | See group meter1 for Shelly 2 |
| meter2 |         |      |           | See group meter1 for Shelly 2 |

### Shelly 2.5 - roller mode (thing-type: shelly25-roller)

The Shelly 2.5 includes 2 meters, one for each channel.
However, it doesn't make sense to differ power consumption for the roller moving up vs. moving down.
For this the binding aggregates the power consumption of both relays and includes the values in "meter1".

| Group  | Channel    | Type          | read-only | Description                                                                          |
| ------ | ---------- | ------------- | --------- | ------------------------------------------------------------------------------------ |
| roller | control    | Rollershutter | r/w       | can be open (0%), stop, or close (100%); could also handle ON (open) and OFF (close) |
|        | rollerpos  | Dimmer        | r/w       | Roller position: 100%=open...0%=closed; gets updated when the roller stopped         |
|        | input      | Switch        | yes       | ON: Input/Button is powered, see General Notes on Channels                           |
|        | state      | String        | yes       | Roller state: open/close/stop                                                        |
|        | stopReason | String        | yes       | Last stop reasons: normal, safety_switch or obstacle                                 |
|        | safety     | Switch        | yes       | Indicates status of the Safety Switch, ON=problem detected, powered off              |
|        | event      | Trigger       | yes       | Roller event/trigger with payload ROLLER_OPEN / ROLLER_CLOSE / ROLLER_STOP           |
| meter1 |            |               |           | See group meter1 for Shelly 2                                                        |
| meter2 |            |               |           | See group meter1 for Shelly 2                                                        |

The roller positioning calibration has to be performed using the Shelly Web UI or App before the position can be set in percent.
Refer to [Smartify Roller Shutters with openHAB and Shelly](doc/UseCaseSmartRoller.md) for more information on roller integration.

### Shelly 4Pro (thing-type: shelly4pro)

The Shelly 4Pro provides 4 relays and 4 power meters.

| Group  | Channel | Type | read-only | Description                   |
| ------ | ------- | ---- | --------- | ----------------------------- |
| relay1 |         |      |           | See group relay1 for Shelly 2 |
| relay2 |         |      |           | See group relay1 for Shelly 2 |
| relay3 |         |      |           | See group relay1 for Shelly 2 |
| relay4 |         |      |           | See group relay1 for Shelly 2 |
| meter1 |         |      |           | See group meter1 for Shelly 2 |
| meter2 |         |      |           | See group meter1 for Shelly 2 |
| meter3 |         |      |           | See group meter1 for Shelly 2 |
| meter4 |         |      |           | See group meter1 for Shelly 2 |

### Shelly Plug-S (thing-type: shellyplugs)

| Group | Channel | Type | read-only | Description                   |
| ----- | ------- | ---- | --------- | ----------------------------- |
| relay |         |      |           | See group relay1 for Shelly 2 |
| meter |         |      |           | See group meter1 for Shelly 2 |

### Shelly Dimmer 1 + 2 (thing-type: shellydimmer, shellydimmer2)

| Group | Channel           | Type     | read-only | Description                                                                                        |
| ----- | ----------------- | -------- | --------- | -------------------------------------------------------------------------------------------------- |
| relay | brightness        | Dimmer   | r/w       | Currently selected brightness.                                                                     |
|       | outputName        | String   | yes       | Logical name of this relay output as configured in the Shelly App                                  |
|       | input1            | Switch   | yes       | ON: Input/Button for input 1 is powered, see general notes on channels                             |
|       | button1           | Trigger  | yes       | Event trigger, see section Button Events                                                           |
|       | lastEvent1        | String   | yes       | Last event type (S/SS/SSS/L) for input 1                                                           |
|       | eventCount1       | Number   | yes       | Counter gets incremented every time the device issues a button event.                              |
|       | input2            | Switch   | yes       | ON: Input/Button for channel 2 is powered, see general notes on channels                           |
|       | button2           | Trigger  | yes       | Event trigger, see section Button Events                                                           |
|       | lastEvent2        | String   | yes       | Last event type (S/SS/SSS/L) for input 2                                                           |
|       | eventCount2       | Number   | yes       | Counter gets incremented every time the device issues a button event.                              |
|       | autoOn            | Number   | r/w       | Relay #1: Sets a  timer to turn the device ON after every OFF command; in seconds                  |
|       | autoOff           | Number   | r/w       | Relay #1: Sets a  timer to turn the device OFF after every ON command; in seconds                  |
|       | timerActive       | Switch   | yes       | Relay #1: ON: An auto-on/off timer is active                                                       |
| meter | currentPower      | Number   | yes       | Current power consumption in Watts                                                                 |
|       | energyHistMin1    | Number   | yes       | Total energy consumed during the previous complete minute, minute -1 (Wh)                          |
|       | energyHistMin2    | Number   | yes       | Total energy consumed during the complete minute 2 minutes ago, minute -2 (Wh)                     |
|       | energyHistMin3    | Number   | yes       | Total energy consumed during the complete minute 3 minutes ago, minute -3 (Wh)                     |
|       | energyAvgLast3Min | Number   | yes       | Average of the total energy per minute over the previous 3 complete minutes, minutes -1 to -3 (Wh) |
|       | totalEnergy       | Number   | yes       | Total energy consumption in kWh                                                                    |
|       | lastUpdate        | DateTime | yes       | Timestamp of the last measurement                                                                  |

`Note:`
The Dimmer should be calibrated using the device Web UI or Shelly App.

Using the Thing configuration option `brightnessAutoOn` you could decide if the light is turned on when a brightness > 0 is set.
`true`:  Brightness will be set and device output is powered = light turns on with the new brightness
`false`: Brightness will be set, but output stays unchanged so light will not be switched on when it's currently off.

totalEnergy might reset on restart depending on device type and firmware version

### Shelly ix3 (thing-type: shellyix3)

| Group   | Channel    | Type    | read-only | Description                                                           |
| ------- | ---------- | ------- | --------- | --------------------------------------------------------------------- |
| status1 | input      | Switch  | yes       | State of Input 1                                                      |
|         | button     | Trigger | yes       | Event trigger: Event trigger, see section Button Events               |
|         | lastEvent  | String  | yes       | S/SS/SSS for 1/2/3x Shortpush or L for Longpush                       |
|         | eventCount | Number  | yes       | Counter gets incremented every time the device issues a button event. |
| status2 |            |         |           | Same for Input 2                                                      |
| status3 |            |         |           | Same for Input 3                                                      |

Channels lastEvent and eventCount are only available if input type is set to momentary button

### Shelly UNI, Shelly Plus UNI (thing-type: shellyuni)

| Group   | Channel      | Type     | read-only | Description                                                              |
| ------- | ------------ | -------- | --------- | ------------------------------------------------------------------------ |
| relay1  |              |          |           | See group relay1 for Shelly 2, no autoOn/autoOff/timerActive channels    |
| relay2  |              |          |           | See group relay1 for Shelly 2, no autoOn/autoOff/timerActive channels    |
| sensors | temperature1 | Number   | yes       | Temperature value of external sensor #1 (if connected to temp/hum addon) |
|         | temperature2 | Number   | yes       | Temperature value of external sensor #2 (if connected to temp/hum addon) |
|         | temperature3 | Number   | yes       | Temperature value of external sensor #3 (if connected to temp/hum addon) |
|         | humidity     | Number   | yes       | Humidity in percent (if connected to temp/hum addon)                     |
|         | lastUpdate   | DateTime | yes       | Timestamp of the last sensor update (heartbeat)                          |
|         | voltage      | Number   | yes       | ADCS voltage                                                             |
| status  | input1       | Switch   | yes       | State of Input 1                                                         |
|         | input2       | Switch   | yes       | State of Input 2                                                         |
|         | button       | Trigger  | yes       | Event trigger, see section Button Events                                 |
|         | lastEvent    | String   | yes       | S/SS/SSS for 1/2/3x Shortpush or L for Longpush                          |
|         | eventCount   | Number   | yes       | Counter gets incremented every time the device issues a button event.    |

### Shelly Bulb (thing-type: shellybulb)

| Group   | Channel     | Type   | read-only | Description                                                            |
| ------- | ----------- | ------ | --------- | ---------------------------------------------------------------------- |
| control | power       | Switch | r/w       | Switch light ON/OFF                                                    |
|         | mode        | Switch | r/w       | Color mode: color or white                                             |
|         | autoOn      | Number | r/w       | Sets a  timer to turn the device ON after every OFF; in sec            |
|         | autoOff     | Number | r/w       | Sets a  timer to turn the device OFF after every ON: in sec            |
|         | timerActive | Switch | yes       | ON: An auto-on/off timer is active                                     |
| color   |             |        |           | Color settings: only valid in COLOR mode                               |
|         | hsb         | HSB    | r/w       | Represents the color picker (HSBType), control r/g/b, but not white    |
|         | full        | String | r/w       | Set Red / Green / Blue / Yellow / White mode and switch mode           |
|         |             |        | r/w       | Valid settings: "red", "green", "blue", "yellow", "white" or "r,g,b,w" |
|         | red         | Dimmer | r/w       | Red brightness: 0..100% or 0..255 (control only the red channel)       |
|         | green       | Dimmer | r/w       | Green brightness: 0..100% or 0..255 (control only the green channel)   |
|         | blue        | Dimmer | r/w       | Blue brightness: 0..100% or 0..255 (control only the blue channel)     |
|         | white       | Dimmer | r/w       | White brightness: 0..100% or 0..255 (control only the white channel)   |
|         | gain        | Dimmer | r/w       | Gain setting: 0..100%     or 0..100                                    |
|         | effect      | Number | r/w       | Puts the light into effect mode: 0..6)                                 |
|         |             |        |           | 0=No effect, 1=Meteor Shows, 2=Gradual Change, 3=Breath                |
|         |             |        |           | 4=Flash, 5=On/Off Gradual, 6=Red/Green Change                          |
| white   |             |        |           | Color settings: only valid in WHITE mode                               |
|         | temperature | Number | r/w       | color temperature (K): 0..100% or 3000..6500                           |
|         | brightness  | Dimmer |           | Brightness: 0..100% or 0..100                                          |

`Note:`
The openHAB color picker has only values for red/green/blue (RGB), not for white as supported by the RGBW2.
Beside channel `hsb` the binding also offers the `white` channel (hsb as only RGB values).
Or control each color separately with channels `red`, `blue`, `green` (those are advanced channels).

### Shelly Duo (thing-type: shellybulbduo)

This information applies to the Shelly Duo-1 as well as the Duo White for the G10 socket.

| Group   | Channel           | Type     | read-only | Description                                                                                        |
| ------- | ----------------- | -------- | --------- | -------------------------------------------------------------------------------------------------- |
| control | autoOn            | Number   | r/w       | Sets a  timer to turn the device ON after every OFF; in sec                                        |
|         | autoOff           | Number   | r/w       | Sets a  timer to turn the device OFF after every ON: in sec                                        |
|         | timerActive       | Switch   | yes       | ON: An auto-on/off timer is active                                                                 |
| white   |                   |          |           | Color settings: only valid in WHITE mode                                                           |
|         | temperature       | Number   | r/w       | color temperature (K): 0..100% or 2700..6500                                                       |
|         | brightness        | Dimmer   |           | Brightness: 0..100% or 0..100                                                                      |
| meter   | currentPower      | Number   | yes       | Current power consumption in Watts                                                                 |
|         | energyHistMin1    | Number   | yes       | Total energy consumed during the previous complete minute, minute -1 (Wh)                          |
|         | energyHistMin2    | Number   | yes       | Total energy consumed during the complete minute 2 minutes ago, minute -2 (Wh)                     |
|         | energyHistMin3    | Number   | yes       | Total energy consumed during the complete minute 3 minutes ago, minute -3 (Wh)                     |
|         | energyAvgLast3Min | Number   | yes       | Average of the total energy per minute over the previous 3 complete minutes, minutes -1 to -3 (Wh) |
|         | totalEnergy       | Number   | yes       | Total energy consumption in kWh                                                                    |
|         | lastUpdate        | DateTime | yes       | Timestamp of the last measurement                                                                  |

`Note`:
totalEnergy might reset on restart depending on device type and firmware version

### Shelly Vintage (thing-type: shellyvintage)

| Group   | Channel           | Type     | read-only | Description                                                                                        |
| ------- | ----------------- | -------- | --------- | -------------------------------------------------------------------------------------------------- |
| control | autoOn            | Number   | r/w       | Sets a  timer to turn the device ON after every OFF; in sec                                        |
|         | autoOff           | Number   | r/w       | Sets a  timer to turn the device OFF after every ON: in sec                                        |
|         | timerActive       | Switch   | yes       | ON: An auto-on/off timer is active                                                                 |
| white   |                   |          |           | Color settings: only valid in WHITE mode                                                           |
|         | brightness        | Dimmer   |           | Brightness: 0..100% or 0..100                                                                      |
| meter   | currentPower      | Number   | yes       | Current power consumption in Watts                                                                 |
|         | energyHistMin1    | Number   | yes       | Total energy consumed during the previous complete minute, minute -1 (Wh)                          |
|         | energyHistMin2    | Number   | yes       | Total energy consumed during the complete minute 2 minutes ago, minute -2 (Wh)                     |
|         | energyHistMin3    | Number   | yes       | Total energy consumed during the complete minute 3 minutes ago, minute -3 (Wh)                     |
|         | energyAvgLast3Min | Number   | yes       | Average of the total energy per minute over the previous 3 complete minutes, minutes -1 to -3 (Wh) |
|         | totalEnergy       | Number   | yes       | Total energy consumption in kWh                                                                    |
|         | lastUpdate        | DateTime | yes       | Timestamp of the last measurement                                                                  |

`Note`:
totalEnergy might reset on restart depending on device type and firmware version

### Shelly Duo Color (thing-type: shellyduocolor-color)

| Group   | Channel      | Type    | read-only | Description                                                                              |
| ------- | ------------ | ------- | --------- | ---------------------------------------------------------------------------------------- |
| control | power        | Switch  | r/w       | Switch light ON/OFF                                                                      |
|         | button       | Trigger | yes       | Event trigger, see section Button Events                                                 |
|         | autoOn       | Number  | r/w       | Sets a  timer to turn the device ON after every OFF command; in seconds                  |
|         | autoOff      | Number  | r/w       | Sets a  timer to turn the device OFF after every ON command; in seconds                  |
|         | timerActive  | Switch  | yes       | ON: An auto-on/off timer is active                                                       |
| color   |              |         |           | Color settings: only valid in COLOR mode                                                 |
|         | hsb          | HSB     | r/w       | Represents the color picker (HSBType), control r/g/b, but not white                      |
|         | full         | String  | r/w       | Set Red / Green / Blue / Yellow / White mode and switch mode                             |
|         |              |         | r/w       | Valid settings: "red", "green", "blue", "yellow", "white" or "r,g,b,w"                   |
|         | red          | Dimmer  | r/w       | Red brightness: 0..100% or 0..255 (control only the red channel)                         |
|         | green        | Dimmer  | r/w       | Green brightness: 0..100% or 0..255 (control only the green channel)                     |
|         | blue         | Dimmer  | r/w       | Blue brightness: 0..100% or 0..255 (control only the blue channel)                       |
|         | white        | Dimmer  | r/w       | White brightness: 0..100% or 0..255 (control only the white channel)                     |
|         | gain         | Dimmer  | r/w       | Gain setting: 0..100%     or 0..100                                                      |
|         | effect       | Number  | r/w       | Puts the light into effect mode: 0=No effect, 1=Meteor Shower, 2=Gradual Change, 3=Flash |
| white   |              |         |           | Color settings: only valid in WHITE mode                                                 |
|         | temperature  | Number  | r/w       | color temperature (K): 0..100% or 3000..6500                                             |
|         | brightness   | Dimmer  |           | Brightness: 0..100% or 0..100                                                            |
| meter   | currentPower | Number  | yes       | Current power consumption in Watts                                                       |

Using the Thing configuration option `brightnessAutoOn` you could decide if the light is turned on when a brightness > 0 is set.
`true`:  Brightness will be set and device output is powered = light turns on with the new brightness
`false`: Brightness will be set, but output stays unchanged so light will not be switched on when it's currently off.

### Shelly Duo RGBW Color Bulb (thing-type: shellycolorbulb)

| Group   | Channel      | Type    | read-only | Description                                                             |
| ------- | ------------ | ------- | --------- | ----------------------------------------------------------------------- |
| control | power        | Switch  | r/w       | Switch light ON/OFF                                                     |
|         | button       | Trigger | yes       | Event trigger, see section Button Events                                |
|         | autoOn       | Number  | r/w       | Sets a  timer to turn the device ON after every OFF command; in seconds |
|         | autoOff      | Number  | r/w       | Sets a  timer to turn the device OFF after every ON command; in seconds |
|         | timerActive  | Switch  | yes       | ON: An auto-on/off timer is active                                      |
| color   |              |         |           | Color settings: only valid in COLOR mode                                |
|         | hsb          | HSB     | r/w       | Represents the color picker (HSBType); control r/g/b, bright, not white |
|         | full         | String  | r/w       | Set Red / Green / Blue / Yellow / White mode and switch mode            |
|         |              |         | r/w       | Valid settings: "red", "green", "blue", "yellow", "white" or "r,g,b,w"  |
|         | red          | Dimmer  | r/w       | Red brightness: 0..100% or 0..255 (control only the red channel)        |
|         | green        | Dimmer  | r/w       | Green brightness: 0..100% or 0..255 (control only the green channel)    |
|         | blue         | Dimmer  | r/w       | Blue brightness: 0..100% or 0..255 (control only the blue channel)      |
|         | white        | Dimmer  | r/w       | White brightness: 0..100% or 0..255 (control only the white channel)    |
|         | gain         | Dimmer  | r/w       | Gain setting: 0..100%     or 0..100                                     |
|         | effect       | Number  | r/w       | Puts the light into effect mode: 0..3)                                  |
|         |              |         |           | 0=No effect, 1=Meteor Shower, 2=Gradual Change, 3=Flash                 |
| meter   | currentPower | Number  | yes       | Current power consumption in Watts                                      |

Channels in group `color`or `white`apply depending on the selected mode - they are not active at the same time.

Using the Thing configuration option `brightnessAutoOn` you could decide if the light is turned on when a brightness > 0 is set.
`true`:  Brightness will be set and device output is powered = light turns on with the new brightness
`false`: Brightness will be set, but output stays unchanged so light will not be switched on when it's currently off.

### Shelly RGBW2 in Color Mode (thing-type: shellyrgbw2-color)

| Group   | Channel           | Type     | read-only | Description                                                                                        |
| ------- | ----------------- | -------- | --------- | -------------------------------------------------------------------------------------------------- |
| control | power             | Switch   | r/w       | Switch light ON/OFF                                                                                |
|         | autoOn            | Number   | r/w       | Sets a  timer to turn the device ON after every OFF command; in seconds                            |
|         | autoOff           | Number   | r/w       | Sets a  timer to turn the device OFF after every ON command; in seconds                            |
|         | timerActive       | Switch   | yes       | ON: An auto-on/off timer is active                                                                 |
| color   | hsb               | HSB      | r/w       | Represents the color picker (HSBType); control r/g/b, bright, not white                            |
|         | full              | String   | r/w       | Set Red / Green / Blue / Yellow / White mode and switch mode                                       |
|         |                   |          | r/w       | Valid settings: "red", "green", "blue", "yellow", "white" or "r,g,b,w"                             |
|         | red               | Dimmer   | r/w       | Red brightness: 0..100% or 0..255 (control only the red channel)                                   |
|         | green             | Dimmer   | r/w       | Green brightness: 0..100% or 0..255 (control only the green channel)                               |
|         | blue              | Dimmer   | r/w       | Blue brightness: 0..100% or 0..255 (control only the blue channel)                                 |
|         | white             | Dimmer   | r/w       | White brightness: 0..100% or 0..255 (control only the white channel)                               |
|         | gain              | Dimmer   | r/w       | Gain setting: 0..100%     or 0..100                                                                |
|         | effect            | Number   | r/w       | Puts the light into effect mode: 0..3)                                                             |
|         |                   |          |           | 0=No effect, 1=Meteor Shower, 2=Gradual Change, 3=Flash                                            |
| meter   | currentPower      | Number   | yes       | Current power consumption in Watts                                                                 |
|         | energyHistMin1    | Number   | yes       | Total energy consumed during the previous complete minute, minute -1 (Wh)                          |
|         | energyHistMin2    | Number   | yes       | Total energy consumed during the complete minute 2 minutes ago, minute -2 (Wh)                     |
|         | energyHistMin3    | Number   | yes       | Total energy consumed during the complete minute 3 minutes ago, minute -3 (Wh)                     |
|         | energyAvgLast3Min | Number   | yes       | Average of the total energy per minute over the previous 3 complete minutes, minutes -1 to -3 (Wh) |
|         | totalEnergy       | Number   | yes       | Total energy consumption in kWh                                                                    |
|         | lastUpdate        | DateTime | yes       | Timestamp of the last measurement                                                                  |

`Note`:
totalEnergy might reset on restart depending on device type and firmware version

### Shelly RGBW2 in White Mode (thing-type: shellyrgbw2-white)

| Group    | Channel      | Type    | read-only | Description                                                             |
| -------- | ------------ | ------- | --------- | ----------------------------------------------------------------------- |
| control  | input        | Switch  | yes       | State of Input                                                          |
| channel1 | brightness   | Dimmer  | r/w       | Channel 1: Brightness: 0..100, control power state with ON/OFF          |
|          | button       | Trigger | yes       | Event trigger, see section Button Events                                |
|          | autoOn       | Number  | r/w       | Sets a  timer to turn the device ON after every OFF command; in seconds |
|          | autoOff      | Number  | r/w       | Sets a  timer to turn the device OFF after every ON command; in seconds |
|          | timerActive  | Switch  | yes       | ON: An auto-on/off timer is active                                      |
| channel2 | brightness   | Dimmer  | r/w       | Channel 2: Brightness: 0..100, control power state with ON/OFF          |
|          | button       | Trigger | yes       | Event trigger, see section Button Events                                |
|          | autoOn       | Number  | r/w       | Sets a  timer to turn the device ON after every OFF command; in seconds |
|          | autoOff      | Number  | r/w       | Sets a  timer to turn the device OFF after every ON command; in seconds |
|          | timerActive  | Switch  | yes       | ON: An auto-on/off timer is active                                      |
| channel3 | brightness   | Dimmer  | r/w       | Channel 3: Brightness: 0..100, control power state with ON/OFF          |
|          | button       | Trigger | yes       | Event trigger, see section Button Events                                |
|          | autoOn       | Number  | r/w       | Sets a  timer to turn the device ON after every OFF command; in seconds |
|          | autoOff      | Number  | r/w       | Sets a  timer to turn the device OFF after every ON command; in seconds |
|          | timerActive  | Switch  | yes       | ON: An auto-on/off timer is active                                      |
| channel4 | brightness   | Dimmer  | r/w       | Channel 4: Brightness: 0..100, control power state with ON/OFF          |
|          | button       | Trigger | yes       | Event trigger, see section Button Events                                |
|          | autoOn       | Number  | r/w       | Sets a  timer to turn the device ON after every OFF command; in seconds |
|          | autoOff      | Number  | r/w       | Sets a  timer to turn the device OFF after every ON command; in seconds |
|          | timerActive  | Switch  | yes       | ON: An auto-on/off timer is active                                      |
| meter    | currentPower | Number  | yes       | Current power consumption in Watts (all channels)                       |

Please note that the settings of channel group color are only valid in color mode and vice versa for white mode.
The current firmware doesn't support the timestamp report for the meters.
The binding emulates this by using the system time on every update.

In white mode each RGBW2 channel is defined as DimmableLight.
This means that the brightness channel has 2 functions

- Sending ON/OFF (OnOffType) to power on/off the channel
- Sending a Number to set the brightness (percentage 0..100)

Sending brightness 0 will automatically turn off the channel if it's currently on.
Sending brightness > 0 will automatically turn on the channel if it's currently off.
You can define 2 items (1 Switch, 1 Number) mapping to the same channel, see example rules.

### Shelly H&T (thing-type: shellyht)

| Group   | Channel      | Type     | read-only | Description                                             |
| ------- | ------------ | -------- | --------- | ------------------------------------------------------- |
| sensors | temperature  | Number   | yes       | Temperature, unit is reported by tempUnit               |
|         | humidity     | Number   | yes       | Relative humidity in %                                  |
|         | lastUpdate   | DateTime | yes       | Timestamp of the last update (any sensor value changed) |
| battery | batteryLevel | Number   | yes       | Battery Level in %                                      |
|         | lowBattery   | Switch   | yes       | Low battery alert (< 20%)                               |

`Note:`
If you have connected an USB cable to the H&T, but channel charger is off make sure that "Use external power supply" settings is activated in the Shelly App's device settings.

### Shelly Flood (thing-type: shellyflood)

| Group   | Channel      | Type     | read-only | Description                                             |
| ------- | ------------ | -------- | --------- | ------------------------------------------------------- |
| sensors | temperature  | Number   | yes       | Temperature, unit is reported by tempUnit               |
|         | flood        | Switch   | yes       | ON: Flooding condition detected, OFF: no flooding       |
|         | lastUpdate   | DateTime | yes       | Timestamp of the last update (any sensor value changed) |
| battery | batteryLevel | Number   | yes       | Battery Level in %                                      |
|         | lowBattery   | Switch   | yes       | Low battery alert (< 20%)                               |

### Shelly Door/Window (thing-type: shellydw, shellydw2)

| Group   | Channel      | Type     | read-only | Description                                                       |
| ------- | ------------ | -------- | --------- | ----------------------------------------------------------------- |
| sensors | state        | Contact  | yes       | OPEN: Contact is open, CLOSED: Contact is closed                  |
|         | lux          | Number   | yes       | Brightness in Lux                                                 |
|         | illumination | String   | yes       | Current illumination: dark/twilight/bright                        |
|         | tilt         | Number   | yes       | Tilt in ° (angle), -1 indicates that the sensor is not calibrated |
|         | vibration    | Switch   | yes       | ON: Vibration detected                                            |
|         | lastUpdate   | DateTime | yes       | Timestamp of the last update (any sensor value changed)           |
|         | lastError    | String   | yes       | Last device error.                                                |
| battery | batteryLevel | Number   | yes       | Battery Level in %                                                |
|         | lowBattery   | Switch   | yes       | Low battery alert (< 20%)                                         |
| device  | alarm        | Trigger  | yes       | Will receive trigger VIBRATION if DW2 detects vibration           |

### Shelly Motion (thing-type: shellymotion)

`Note:`
You might need to restart the device to enable the discovery mode for 3 minutes(use the Web UI).
As an alternativ you could press the reset button shortly (refer to the manual to locate the reset button).
While the device is in low power mode (usual operation) it will not respond to discovery requests

| Group   | Channel         | Type     | read-only | Description                                                            |
| ------- | --------------- | -------- | --------- | ---------------------------------------------------------------------- |
| sensors | motion          | Switch   | yes       | ON: Motion was detected                                                |
|         | motionTimestamp | DateTime | yes       | Time when motion started/was detected                                  |
|         | lux             | Number   | yes       | Brightness in Lux                                                      |
|         | illumination    | String   | yes       | Current illumination: dark/twilight/bright                             |
|         | vibration       | Switch   | yes       | ON: Vibration detected                                                 |
|         | charger         | Switch   | yes       | ON: USB charging cable is connected external power supply activated.   |
|         | motionActive    | Switch   | yes       | ON: Motion detection is currently active                               |
|         | sensorSleepTime | Number   | no        | Specifies the number of sec the sensor should not report events      ] |
|         | lastUpdate      | DateTime | yes       | Timestamp of the last update (any sensor value changed)                |
| battery | batteryLevel    | Number   | yes       | Battery Level in %                                                     |
|         | lowBattery      | Switch   | yes       | Low battery alert (< 20%)                                              |

Use case for the 'sensorSleepTime':
You have a Motion controlling your light.
You switch off the light and want to leave the room, but the motion sensor immediately switches light back on.
Using 'sensorSleepTime' you can suppress motion events while leaving the room (e.g., for 5 seconds) so the light doesn't switch on.

### Shelly Motion 2 (thing-type: shellymotion2)

| Group   | Channel         | Type     | read-only | Description                                                            |
| ------- | --------------- | -------- | --------- | ---------------------------------------------------------------------- |
| sensors | motion          | Switch   | yes       | ON: Motion was detected                                                |
|         | motionTimestamp | DateTime | yes       | Time when motion started/was detected                                  |
|         | lux             | Number   | yes       | Brightness in Lux                                                      |
|         | illumination    | String   | yes       | Current illumination: dark/twilight/bright                             |
|         | temperature     | Number   | yes       | Temperature measured by the sensor                                     |
|         | vibration       | Switch   | yes       | ON: Vibration detected                                                 |
|         | charger         | Switch   | yes       | ON: USB charging cable is connected external power supply activated.   |
|         | motionActive    | Switch   | yes       | ON: Motion detection is currently active                               |
|         | sensorSleepTime | Number   | no        | Specifies the number of sec the sensor should not report events      ] |
|         | lastUpdate      | DateTime | yes       | Timestamp of the last update (any sensor value changed)                |
| battery | batteryLevel    | Number   | yes       | Battery Level in %                                                     |
|         | lowBattery      | Switch   | yes       | Low battery alert (< 20%)                                              |

### Shelly TRV (thing-type: shellytrv)

`Note:`
You might need to reboot the device to enable the discovery mode for 3 minutes(use the Web UI).
As an alternative you could press the reset button shortly (refer to the manual to locate the reset button).
While the device is in low power mode (usual operation) it will not respond to discovery requests

You should calibrate the valve using the device Web UI or Shelly App before starting to control it using openHAB.

| Group   | Channel         | Type     | read-only | Description                                                         |
| ------- | --------------- | -------- | --------- | ------------------------------------------------------------------- |
| sensors | temperature     | Number   | yes       | Current Temperature in °C                                           |
|         | state           | Contact  | yes       | Valve status: OPEN or CLOSED (position = 0)                         |
|         | lastUpdate      | DateTime | yes       | Timestamp of the last update (any sensor value changed)             |
| control | targetTemp      | Number   | no        | Temperature in °C: 4=Low/Min; 5..30=target temperature;31=Hi/Max    |
|         | position        | Dimmer   | no        | Set valve to manual mode (0..100%) disables auto-temp)              |
|         | mode            | String   | no        | Switch between manual and automatic mode                            |
|         | selectedProfile | String   | no        | Select profile Id: "0"=disable, "1"-"n": profile index              |
|         | boost           | Number   | no        | Enable/disable boost mode (full heating power)                      |
|         | boostTimer      | Number   | no        | Number of minutes to heat at full power while boost mode is enabled |
|         | schedule        | Switch   | yes       | ON: Schedule is active                                              |
| battery | batteryLevel    | Number   | yes       | Battery Level in %                                                  |
|         | batteryAlert    | Switch   | yes       | Low battery alert                                                   |

### Shelly Button 1 or 2 (thing-type: shellybutton1 / shellybutton2)

| Group   | Channel      | Type     | read-only | Description                                                           |
| ------- | ------------ | -------- | --------- | --------------------------------------------------------------------- |
| status  | lastEvent    | String   | yes       | S/SS/SSS for 1/2/3x Shortpush or L for Longpush                       |
|         | eventCount   | Number   | yes       | Counter gets incremented every time the device issues a button event. |
|         | input        | Switch   | yes       | ON: Input/Button is powered, see General Notes on Channels            |
|         | button       | Trigger  | yes       | Event trigger with payload SHORT_PRESSED, DOUBLE_PRESSED...           |
|         | lastUpdate   | DateTime | yes       | Timestamp of the last update (any value changed)                      |
| battery | batteryLevel | Number   | yes       | Battery Level in %                                                    |
|         | lowBattery   | Switch   | yes       | Low battery alert (< 20%)                                             |

### Shelly Smoke (thing-type: shellysmoke)

| Group   | Channel      | Type     | read-only | Description                                             |
| ------- | ------------ | -------- | --------- | ------------------------------------------------------- |
| sensors | temperature  | Number   | yes       | Temperature, unit is reported by tempUnit               |
|         | smoke        | Number   | yes       | ON: Smoke detected                                      |
|         | lastUpdate   | DateTime | yes       | Timestamp of the last update (any sensor value changed) |
|         | lastError    | String   | yes       | Last device error.                                      |
| battery | batteryLevel | Number   | yes       | Battery Level in %                                      |
|         | lowBattery   | Switch   | yes       | Low battery alert (< 20%)                               |

### Shelly Gas (thing-type: shellygas)

| Group   | Channel     | Type     | read-only | Description                                             |
| ------- | ----------- | -------- | --------- | ------------------------------------------------------- |
| sensors | ppm         | Number   | yes       | Gas concentration (ppm)                                 |
|         | sensorState | String   | yes       | Sensor state: unknown/warmup/normal/fault               |
|         | alarmState  | String   | yes       | Alarm state: unknown/none/mild/heavy/test               |
|         | lastUpdate  | DateTime | yes       | Timestamp of the last update (any sensor value changed) |

### Shelly Sense (thing-type: shellysense)

| Group   | Channel      | Type     | read-only | Description                                                           |
| ------- | ------------ | -------- | --------- | --------------------------------------------------------------------- |
| control | key          | String   | r/w       | Send an IR key to the sense. There a 3 different types supported      |
|         |              |          |           | Stored key: send the key code defined by the App , e.g. 123_1_up      |
|         |              |          |           | Pronto hex: send a Pronto Code in hex format, e.g. 0000 006C 0022 ... |
|         |              |          |           | Pronto base64: in base64 format, will be send 1:1 to the Sense        |
|         | motionTime   | Number   | r/w       | Define the number of seconds when the Sense should report motion      |
|         | motionLED    | Switch   | r/w       | Control the motion LED: ON when motion is detected or OFF             |
|         | charger      | Switch   | yes       | ON: charger connected, OFF: charger not connected.                    |
| sensors | temperature  | Number   | yes       | Temperature in °C                                                     |
|         | humidity     | Number   | yes       | Relative humidity in %                                                |
|         | lux          | Number   | yes       | Brightness in Lux                                                     |
|         | motion       | Switch   | yes       | ON: Motion detected, OFF: No motion (check also motionTime)           |
|         | lastUpdate   | DateTime | yes       | Timestamp of the last update (any sensor value changed)               |
| battery | batteryLevel | Number   | yes       | Battery Level in %                                                    |
|         | batteryAlert | Switch   | yes       | Low battery alert                                                     |

## Shelly Plus Series

### Shelly Plus 1 (thing-type: shellyplus1, shellyplus1l)

| Group | Channel     | Type    | read-only | Description                                                                       |
| ----- | ----------- | ------- | --------- | --------------------------------------------------------------------------------- |
| relay | output      | Switch  | r/w       | Relay #1: Controls the relay's output channel (on/off)                            |
|       | outputName  | String  | yes       | Logical name of this relay output as configured in the Shelly App                 |
|       | input       | Switch  | yes       | ON: Input/Button is powered, see General Notes on Channels                        |
|       | autoOn      | Number  | r/w       | Relay #1: Sets a  timer to turn the device ON after every OFF command; in seconds |
|       | autoOff     | Number  | r/w       | Relay #1: Sets a  timer to turn the device OFF after every ON command; in seconds |
|       | timerActive | Switch  | yes       | Relay #1: ON: An auto-on/off timer is active                                      |
|       | button      | Trigger | yes       | Event trigger, see section Button Events                                          |

If the Shelly Add-On is installed:

| Group   | Channel      | Type     | read-only | Description                                               |
| ------- | ------------ | -------- | --------- | --------------------------------------------------------- |
| sensors | temperature1 | Number   | yes       | Temperature value of external sensor #1                   |
|         | temperature2 | Number   | yes       | Temperature value of external sensor #2                   |
|         | temperature3 | Number   | yes       | Temperature value of external sensor #3                   |
|         | temperature4 | Number   | yes       | Temperature value of external sensor #4                   |
|         | temperature5 | Number   | yes       | Temperature value of external sensor #5                   |
|         | humidity     | Number   | yes       | Relative Humidity in percent                              |
|         | voltage      | Number   | yes       | Measured voltage                                          |
|         | analogInput  | Number   | yes       | Percentage of reference voltage (VREF) at analogous input |
|         | digitalInput | Switch   | yes       | State of digital input (ON/OFF)                           |
|         | lastUpdate   | DateTime | yes       | Timestamp of the last sensor update (heartbeat)           |

### Shelly Plus 1PM (thing-type: shellyplus1pm)

| Group | Channel           | Type     | read-only | Description                                                                                        |
| ----- | ----------------- | -------- | --------- | -------------------------------------------------------------------------------------------------- |
| relay | output            | Switch   | r/w       | Relay #1: Controls the relay's output channel (on/off)                                             |
|       | outputName        | String   | yes       | Logical name of this relay output as configured in the Shelly App                                  |
|       | input             | Switch   | yes       | ON: Input/Button is powered, see General Notes on Channels                                         |
|       | autoOn            | Number   | r/w       | Relay #1: Sets a  timer to turn the device ON after every OFF command; in seconds                  |
|       | autoOff           | Number   | r/w       | Relay #1: Sets a  timer to turn the device OFF after every ON command; in seconds                  |
|       | timerActive       | Switch   | yes       | Relay #1: ON: An auto-on/off timer is active                                                       |
|       | button            | Trigger  | yes       | Event trigger, see section Button Events                                                           |
| meter | currentPower      | Number   | yes       | Current power consumption in Watts                                                                 |
|       | energyHistMin1    | Number   | yes       | Total energy consumed during the previous complete minute, minute -1 (Wh)                          |
|       | energyHistMin2    | Number   | yes       | Total energy consumed during the complete minute 2 minutes ago, minute -2 (Wh)                     |
|       | energyHistMin3    | Number   | yes       | Total energy consumed during the complete minute 3 minutes ago, minute -3 (Wh)                     |
|       | energyAvgLast3Min | Number   | yes       | Average of the total energy per minute over the previous 3 complete minutes, minutes -1 to -3 (Wh) |
|       | totalEnergy       | Number   | yes       | Total energy consumption in kWh                                                                    |
|       | resetTotals       | Switch   | r/w       | Send ON to reset the accumulated energy counters for this meter                                    |
|       | lastUpdate        | DateTime | yes       | Timestamp of the last measurement                                                                  |

`Note`:
totalEnergy might reset on restart depending on device type and firmware version

If the Shelly Add-On is installed:

| Group   | Channel      | Type     | read-only | Description                                               |
| ------- | ------------ | -------- | --------- | --------------------------------------------------------- |
| sensors | temperature1 | Number   | yes       | Temperature value of external sensor #1                   |
|         | temperature2 | Number   | yes       | Temperature value of external sensor #2                   |
|         | temperature3 | Number   | yes       | Temperature value of external sensor #3                   |
|         | temperature4 | Number   | yes       | Temperature value of external sensor #4                   |
|         | temperature5 | Number   | yes       | Temperature value of external sensor #5                   |
|         | humidity     | Number   | yes       | Relative Humidity in percent                              |
|         | voltage      | Number   | yes       | Measured voltage                                          |
|         | analogInput  | Number   | yes       | Percentage of reference voltage (VREF) at analogous input |
|         | digitalInput | Switch   | yes       | State of digital input (ON/OFF)                           |
|         | lastUpdate   | DateTime | yes       | Timestamp of the last sensor update (heartbeat)           |

### Shelly Plus 2PM - relay mode (thing-type: shellyplus2pm-relay)

| Group  | Channel           | Type     | read-only | Description                                                                                        |
| ------ | ----------------- | -------- | --------- | -------------------------------------------------------------------------------------------------- |
| relay1 | output            | Switch   | r/w       | Relay #1: Controls the relay's output channel (on/off)                                             |
|        | outputName        | String   | yes       | Logical name of this relay output as configured in the Shelly App                                  |
|        | input             | Switch   | yes       | ON: Input/Button is powered, see General Notes on Channels                                         |
|        | autoOn            | Number   | r/w       | Relay #1: Sets a  timer to turn the device ON after every OFF command; in seconds                  |
|        | autoOff           | Number   | r/w       | Relay #1: Sets a  timer to turn the device OFF after every ON command; in seconds                  |
|        | timerActive       | Switch   | yes       | Relay #1: ON: An auto-on/off timer is active                                                       |
|        | button            | Trigger  | yes       | Event trigger, see section Button Events                                                           |
| meter1 | currentPower      | Number   | yes       | Current power consumption in Watts                                                                 |
|        | energyHistMin1    | Number   | yes       | Total energy consumed during the previous complete minute, minute -1 (Wh)                          |
|        | energyHistMin2    | Number   | yes       | Total energy consumed during the complete minute 2 minutes ago, minute -2 (Wh)                     |
|        | energyHistMin3    | Number   | yes       | Total energy consumed during the complete minute 3 minutes ago, minute -3 (Wh)                     |
|        | energyAvgLast3Min | Number   | yes       | Average of the total energy per minute over the previous 3 complete minutes, minutes -1 to -3 (Wh) |
|        | totalEnergy       | Number   | yes       | Total energy consumption in kWh                                                                    |
|        | resetTotals       | Switch   | r/w       | Send ON to reset the accumulated energy counters for this meter                                    |
|        | lastUpdate        | DateTime | yes       | Timestamp of the last measurement                                                                  |
| relay2 | output            | Switch   | r/w       | Relay #2: Controls the relay's output channel (on/off)                                             |
|        | outputName        | String   | yes       | Logical name of this relay output as configured in the Shelly App                                  |
|        | input             | Switch   | yes       | ON: Input/Button is powered, see General Notes on Channels                                         |
|        | autoOn            | Number   | r/w       | Relay #2: Sets a  timer to turn the device ON after every OFF command; in seconds                  |
|        | autoOff           | Number   | r/w       | Relay #2: Sets a  timer to turn the device OFF after every ON command; in seconds                  |
|        | timerActive       | Switch   | yes       | Relay #2: ON: An auto-on/off timer is active                                                       |
|        | button            | Trigger  | yes       | Event trigger, see section Button Events                                                           |
| meter2 | currentPower      | Number   | yes       | Current power consumption in Watts                                                                 |
|        | energyHistMin1    | Number   | yes       | Total energy consumed during the previous complete minute, minute -1 (Wh)                          |
|        | energyHistMin2    | Number   | yes       | Total energy consumed during the complete minute 2 minutes ago, minute -2 (Wh)                     |
|        | energyHistMin3    | Number   | yes       | Total energy consumed during the complete minute 3 minutes ago, minute -3 (Wh)                     |
|        | energyAvgLast3Min | Number   | yes       | Average of the total energy per minute over the previous 3 complete minutes, minutes -1 to -3 (Wh) |
|        | totalEnergy       | Number   | yes       | Total energy consumption in kWh                                                                    |
|        | resetTotals       | Switch   | r/w       | Send ON to reset the accumulated energy counters for this meter                                    |
|        | lastUpdate        | DateTime | yes       | Timestamp of the last measurement                                                                  |

`Note`:
totalEnergy might reset on restart depending on device type and firmware version

### Shelly Plus 2L (thing-type: shellyplus2l)

| Group  | Channel     | Type    | read-only | Description                                                                       |
| ------ | ----------- | ------- | --------- | --------------------------------------------------------------------------------- |
| relay1 | output      | Switch  | r/w       | Relay #1: Controls the relay's output channel (on/off)                            |
|        | outputName  | String  | yes       | Logical name of this relay output as configured in the Shelly App                 |
|        | input       | Switch  | yes       | ON: Input/Button is powered, see General Notes on Channels                        |
|        | autoOn      | Number  | r/w       | Relay #1: Sets a  timer to turn the device ON after every OFF command; in seconds |
|        | autoOff     | Number  | r/w       | Relay #1: Sets a  timer to turn the device OFF after every ON command; in seconds |
|        | timerActive | Switch  | yes       | Relay #1: ON: An auto-on/off timer is active                                      |
|        | button      | Trigger | yes       | Event trigger, see section Button Events                                          |
| relay2 | output      | Switch  | r/w       | Relay #2: Controls the relay's output channel (on/off)                            |
|        | outputName  | String  | yes       | Logical name of this relay output as configured in the Shelly App                 |
|        | input       | Switch  | yes       | ON: Input/Button is powered, see General Notes on Channels                        |
|        | autoOn      | Number  | r/w       | Relay #2: Sets a  timer to turn the device ON after every OFF command; in seconds |
|        | autoOff     | Number  | r/w       | Relay #2: Sets a  timer to turn the device OFF after every ON command; in seconds |
|        | timerActive | Switch  | yes       | Relay #2: ON: An auto-on/off timer is active                                      |
|        | button      | Trigger | yes       | Event trigger, see section Button Events                                          |

### Shelly Plus 2PM - roller mode (thing-type: shellyplus2pm-roller)

| Group  | Channel    | Type          | read-only | Description                                                                          |
| ------ | ---------- | ------------- | --------- | ------------------------------------------------------------------------------------ |
| roller | control    | Rollershutter | r/w       | can be open (0%), stop, or close (100%); could also handle ON (open) and OFF (close) |
|        | rollerPos  | Dimmer        | r/w       | Roller position: 100%=open...0%=closed; gets updated when the roller stopped         |
|        | input      | Switch        | yes       | ON: Input/Button is powered, see General Notes on Channels                           |
|        | state      | String        | yes       | Roller state: open/close/stop                                                        |
|        | stopReason | String        | yes       | Last stop reasons: normal, safety_switch or obstacle                                 |
|        | safety     | Switch        | yes       | Indicates status of the Safety Switch, ON=problem detected, powered off              |
|        | event      | Trigger       | yes       | Roller event/trigger with payload ROLLER_OPEN / ROLLER_CLOSE / ROLLER_STOP           |
| meter  |            |               |           | See group meter description                                                          |

The roller positioning calibration has to be performed using the Shelly Web UI or App before the position can be set in percent.
Refer to [Smartify Roller Shutters with openHAB and Shelly](doc/UseCaseSmartRoller.md) for more information on roller integration.

### Shelly Plus Shutter (thing-type: shellyplusshutter)

| Group  | Channel    | Type          | read-only | Description                                                                          |
| ------ | ---------- | ------------- | --------- | ------------------------------------------------------------------------------------ |
| roller | control    | Rollershutter | r/w       | can be open (0%), stop, or close (100%); could also handle ON (open) and OFF (close) |
|        | rollerPos  | Dimmer        | r/w       | Roller position: 100%=open...0%=closed; gets updated when the roller stopped         |
|        | input      | Switch        | yes       | ON: Input/Button is powered, see General Notes on Channels                           |
|        | state      | String        | yes       | Roller state: open/close/stop                                                        |
|        | stopReason | String        | yes       | Last stop reasons: normal, safety_switch or obstacle                                 |
|        | safety     | Switch        | yes       | Indicates status of the Safety Switch, ON=problem detected, powered off              |
|        | event      | Trigger       | yes       | Roller event/trigger with payload ROLLER_OPEN / ROLLER_CLOSE / ROLLER_STOP           |
| meter  |            |               |           | See group meter description                                                          |

The roller positioning calibration has to be performed using the Shelly Web UI or App before the position can be set in percent.
Refer to [Smartify Roller Shutters with openHAB and Shelly](doc/UseCaseSmartRoller.md) for more information on roller integration.

### Shelly Plus Plug-S/IT/UK/US/CPM/USG4 (thing-type: shellyplusplug, shellyplusplugus, shellyplusplugcpm, shellyplugusg4)

| Group | Channel           | Type     | read-only | Description                                                                                        |
| ----- | ----------------- | -------- | --------- | -------------------------------------------------------------------------------------------------- |
| relay | output            | Switch   | r/w       | Controls the relay's output channel (on/off)                                                       |
|       | outputName        | String   | yes       | Logical name of this relay output as configured in the Shelly App                                  |
|       | input             | Switch   | yes       | ON: Input/Button is powered, see General Notes on Channels                                         |
|       | autoOn            | Number   | r/w       | Sets a  timer to turn the device ON after every OFF command; in seconds                            |
|       | autoOff           | Number   | r/w       | Sets a  timer to turn the device OFF after every ON command; in seconds                            |
|       | timerActive       | Switch   | yes       | ON: An auto-on/off timer is active                                                                 |
|       | button            | Trigger  | yes       | Event trigger, see section Button Events                                                           |
| meter | currentPower      | Number   | yes       | Current power consumption in Watts                                                                 |
|       | energyHistMin1    | Number   | yes       | Total energy consumed during the previous complete minute, minute -1 (Wh)                          |
|       | energyHistMin2    | Number   | yes       | Total energy consumed during the complete minute 2 minutes ago, minute -2 (Wh)                     |
|       | energyHistMin3    | Number   | yes       | Total energy consumed during the complete minute 3 minutes ago, minute -3 (Wh)                     |
|       | energyAvgLast3Min | Number   | yes       | Average of the total energy per minute over the previous 3 complete minutes, minutes -1 to -3 (Wh) |
|       | totalEnergy       | Number   | yes       | Total energy consumption in kWh                                                                    |
|       | resetTotals       | Switch   | r/w       | Send ON to reset the accumulated energy counters for this meter                                    |
|       | lastUpdate        | DateTime | yes       | Timestamp of the last measurement                                                                  |

`Note`:
totalEnergy might reset on restart depending on device type and firmware version

### Shelly Plus Power Strip 4 (thing-type: shellyplusstrip)

| Group  | Channel | Type | read-only | Description                                     |
| ------ | ------- | ---- | --------- | ----------------------------------------------- |
| relay1 |         |      | r/w       | Relay #1 with control options and status values |
| relay2 |         |      | r/w       | Relay #2 with control options and status values |
| relay3 |         |      | r/w       | Relay #3 with control options and status values |
| relay4 |         |      | r/w       | Relay #4 with control options and status values |
| meter1 |         |      | r/w       | Power Meter #1 with measurement values          |
| meter2 |         |      | r/w       | Power Meter #1 with measurement values          |
| meter3 |         |      | r/w       | Power Meter #1 with measurement values          |
| meter4 |         |      | r/w       | Power Meter #1 with measurement values          |

### Shelly Plus EM (thing-type: shellyplusem)

| Group  | Channel           | Type         | read-only | Description                                                                                        |
| ------ | ----------------- | ------------ | --------- | -------------------------------------------------------------------------------------------------- |
| relay  | output            | Switch       | r/w       | Controls the relay's output channel (on/off)                                                       |
|        | outputName        | String       | yes       | Logical name of this relay output as configured in the Shelly App                                  |
|        | input             | Switch       | yes       | ON: Input/Button is powered, see general notes on channels                                         |
|        | button            | Trigger      | yes       | Event trigger, see section Button Events                                                           |
|        | lastEvent         | String       | yes       | Last event type (S/SS/SSS/L)                                                                       |
|        | eventCount        | Number       | yes       | Counter gets incremented every time the device issues a button event.                              |
|        | autoOn            | Number       | r/w       | Relay #1: Sets a  timer to turn the device ON after every OFF command; in seconds                  |
|        | autoOff           | Number       | r/w       | Relay #1: Sets a  timer to turn the device OFF after every ON command; in seconds                  |
|        | timerActive       | Switch       | yes       | Relay #1: ON: An auto-on/off timer is active                                                       |
| meter1 | currentPower      | Number       | yes       | Current power consumption in Watts                                                                 |
|        | totalEnergy       | Number       | yes       | Total energy consumption in kWh                                                                    |
|        | returnedEnergy    | Number       | yes       | Total returned energy, kWh                                                                         |
|        | reactivePower     | Number:Power | yes       | Instantaneous reactive power (VAR)                                                                 |
|        | apparentPower     | Number:Power | yes       | Instantaneous apparent power (VA)                                                                  |
|        | voltage           | Number       | yes       | RMS voltage, Volts                                                                                 |
|        | powerFactor       | Number       | yes       | Power factor (-1.0 to 1.0)                                                                         |
|        | resetTotals       | Switch       | r/w       | Send ON to reset the accumulated energy counters for this meter                                    |
|        | lastUpdate        | DateTime     | yes       | Timestamp of the last measurement                                                                  |
| meter2 | currentPower      | Number       | yes       | Current power consumption in Watts                                                                 |
|        | totalEnergy       | Number       | yes       | Total energy consumption in kWh                                                                    |
|        | returnedEnergy    | Number       | yes       | Total returned energy, kWh                                                                         |
|        | reactivePower     | Number:Power | yes       | Instantaneous reactive power (VAR)                                                                 |
|        | apparentPower     | Number:Power | yes       | Instantaneous apparent power (VA)                                                                  |
|        | voltage           | Number       | yes       | RMS voltage, Volts                                                                                 |
|        | powerFactor       | Number       | yes       | Power factor (-1.0 to 1.0)                                                                         |
|        | resetTotals       | Switch       | r/w       | Send ON to reset the accumulated energy counters for this meter                                    |
|        | lastUpdate        | DateTime     | yes       | Timestamp of the last measurement                                                                  |

`Note`:
totalEnergy might reset on restart depending on device type and firmware version

### Shelly Plus 3EM-63 (thing-type: shellyplus3em63)

| Group  | Channel           | Type         | read-only | Description                                                                                        |
| ------ | ----------------- | ------------ | --------- | -------------------------------------------------------------------------------------------------- |
| relay  | output            | Switch       | r/w       | Controls the relay's output channel (on/off)                                                       |
|        | outputName        | String       | yes       | Logical name of this relay output as configured in the Shelly App                                  |
|        | input             | Switch       | yes       | ON: Input/Button is powered, see general notes on channels                                         |
|        | button            | Trigger      | yes       | Event trigger, see section Button Events                                                           |
|        | lastEvent         | String       | yes       | Last event type (S/SS/SSS/L)                                                                       |
|        | eventCount        | Number       | yes       | Counter gets incremented every time the device issues a button event.                              |
|        | autoOn            | Number       | r/w       | Relay #1: Sets a  timer to turn the device ON after every OFF command; in seconds                  |
|        | autoOff           | Number       | r/w       | Relay #1: Sets a  timer to turn the device OFF after every ON command; in seconds                  |
|        | timerActive       | Switch       | yes       | Relay #1: ON: An auto-on/off timer is active                                                       |
| meter1 | currentPower      | Number       | yes       | Current power consumption in Watts                                                                 |
|        | totalEnergy       | Number       | yes       | Total energy consumption in kWh                                                                    |
|        | returnedEnergy    | Number       | yes       | Total returned energy, kWh                                                                         |
|        | reactivePower     | Number:Power | yes       | Instantaneous reactive power (VAR)                                                                 |
|        | apparentPower     | Number:Power | yes       | Instantaneous apparent power (VA)                                                                  |
|        | voltage           | Number       | yes       | RMS voltage, Volts                                                                                 |
|        | current           | Number       | yes       | Current in A                                                                                       |
|        | powerFactor       | Number       | yes       | Power factor (-1.0 to 1.0)                                                                         |
|        | lastUpdate        | DateTime     | yes       | Timestamp of the last measurement                                                                  |
| meter2 | currentPower      | Number       | yes       | Current power consumption in Watts                                                                 |
|        | totalEnergy       | Number       | yes       | Total energy consumption in kWh                                                                    |
|        | returnedEnergy    | Number       | yes       | Total returned energy, kWh                                                                         |
|        | reactivePower     | Number:Power | yes       | Instantaneous reactive power (VAR)                                                                 |
|        | apparentPower     | Number:Power | yes       | Instantaneous apparent power (VA)                                                                  |
|        | voltage           | Number       | yes       | RMS voltage, Volts                                                                                 |
|        | current           | Number       | yes       | Current in A                                                                                       |
|        | powerFactor       | Number       | yes       | Power factor (-1.0 to 1.0)                                                                         |
|        | lastUpdate        | DateTime     | yes       | Timestamp of the last measurement                                                                  |
| meter3 | currentPower      | Number       | yes       | Current power consumption in Watts                                                                 |
|        | totalEnergy       | Number       | yes       | Total energy consumption in kWh                                                                    |
|        | returnedEnergy    | Number       | yes       | Total returned energy, kWh                                                                         |
|        | reactivePower     | Number:Power | yes       | Instantaneous reactive power (VAR)                                                                 |
|        | apparentPower     | Number:Power | yes       | Instantaneous apparent power (VA)                                                                  |
|        | voltage           | Number       | yes       | RMS voltage, Volts                                                                                 |
|        | current           | Number       | yes       | Current in A                                                                                       |
|        | powerFactor       | Number       | yes       | Power factor (-1.0 to 1.0)                                                                         |
|        | lastUpdate        | DateTime     | yes       | Timestamp of the last measurement                                                                  |
| nmeter | ncurrent          | Number       | yes       | Neutral current based on N clamp (requires calibration)                                            |
|        | ixsum             | Number       | yes       | Measured current over all phases                                                                   |
|        | nmismatch         | Switch       | yes       | ON: abs(ncurrent-ixsum) is greater than nmThreshold                                                |
|        | nmThreshold       | Number       | yes       | Threshold (delta) before nMismatch goes ON                                                         |

`Note`:
totalEnergy might reset on restart depending on device type and firmware version

### Shelly Plus Dimmer / 10V (thing-type: shellyplusdimmer, shellyplus10v)

| Group | Channel           | Type     | read-only | Description                                                                                        |
| ----- | ----------------- | -------- | --------- | -------------------------------------------------------------------------------------------------- |
| relay | brightness        | Dimmer   | r/w       | Currently selected brightness.                                                                     |
|       | outputName        | String   | yes       | Logical name of this relay output as configured in the Shelly App                                  |
|       | input1            | Switch   | yes       | ON: Input/Button for input 1 is powered, see general notes on channels                             |
|       | button1           | Trigger  | yes       | Event trigger, see section Button Events                                                           |
|       | lastEvent1        | String   | yes       | Last event type (S/SS/SSS/L) for input 1                                                           |
|       | eventCount1       | Number   | yes       | Counter gets incremented every time the device issues a button event.                              |
|       | input2            | Switch   | yes       | ON: Input/Button for channel 2 is powered, see general notes on channels                           |
|       | button2           | Trigger  | yes       | Event trigger, see section Button Events                                                           |
|       | lastEvent2        | String   | yes       | Last event type (S/SS/SSS/L) for input 2                                                           |
|       | eventCount2       | Number   | yes       | Counter gets incremented every time the device issues a button event.                              |
|       | autoOn            | Number   | r/w       | Relay #1: Sets a  timer to turn the device ON after every OFF command; in seconds                  |
|       | autoOff           | Number   | r/w       | Relay #1: Sets a  timer to turn the device OFF after every ON command; in seconds                  |
|       | timerActive       | Switch   | yes       | Relay #1: ON: An auto-on/off timer is active                                                       |
| meter | currentPower      | Number   | yes       | Current power consumption in Watts                                                                 |
|       | totalEnergy       | Number   | yes       | Total energy consumption in kWh                                                                    |
|       | lastUpdate        | DateTime | yes       | Timestamp of the last measurement                                                                  |

`Note:`
The Dimmer should be calibrated using the device Web UI or Shelly App.

Using the Thing configuration option `brightnessAutoOn` you could decide if the light is turned on when a brightness > 0 is set.
`true`:  Brightness will be set and device output is powered = light turns on with the new brightness
`false`: Brightness will be set, but output stays unchanged so light will not be switched on when it's currently off.

totalEnergy might reset on restart depending on device type and firmware version

### Shelly Plus i4, i4DC (thing-types: shellyplusi4, shellyplusi4dc)

| Group   | Channel    | Type    | read-only | Description                                                           |
| ------- | ---------- | ------- | --------- | --------------------------------------------------------------------- |
| status1 | input      | Switch  | yes       | State of Input 1                                                      |
|         | button     | Trigger | yes       | Event trigger: Event trigger, see section Button Events               |
|         | lastEvent  | String  | yes       | S/SS/SSS for 1/2/3x Shortpush or L for Longpush                       |
|         | eventCount | Number  | yes       | Counter gets incremented every time the device issues a button event. |
| status2 |            |         |           | Same for Input 2                                                      |
| status3 |            |         |           | Same for Input 3                                                      |
| status4 |            |         |           | Same for Input 4                                                      |

Channels lastEvent and eventCount are only available if input type is set to momentary button

### Shelly Plus HT (thing-type: shellyplusht)

| Group   | Channel      | Type     | read-only | Description                                             |
| ------- | ------------ | -------- | --------- | ------------------------------------------------------- |
| sensors | temperature  | Number   | yes       | Temperature, unit is reported by tempUnit               |
|         | humidity     | Number   | yes       | Relative humidity in %                                  |
|         | lastUpdate   | DateTime | yes       | Timestamp of the last update (any sensor value changed) |
| battery | batteryLevel | Number   | yes       | Battery Level in %                                      |
|         | lowBattery   | Switch   | yes       | Low battery alert (< 20%)                               |

### Shelly Plus Smoke (thing-type: shellyplussmoke)

| Group   | Channel      | Type     | read-only | Description                                             |
| ------- | ------------ | -------- | --------- | ------------------------------------------------------- |
| sensors | smoke        | Switch   | yes       | ON: Smoke detected                                      |
|         | mute         | Switch   | no        | ON: Alarm muted                                         |
|         | lastUpdate   | DateTime | yes       | Timestamp of the last update (any sensor value changed) |
|         | lastError    | String   | yes       | Last device error.                                      |
| battery | batteryLevel | Number   | yes       | Battery Level in %                                      |
|         | lowBattery   | Switch   | yes       | Low battery alert (< 20%)                               |

### Shelly Flood Gen4 (thing-type: shellyplusflood)

The Shelly Flood Gen4 (S4SN-0071A) is a battery-powered water-leak sensor with a configurable alarm mode.
The sensor probe connects via a cable; if the cable is unplugged, the `lastError` channel is updated and a `SENSOR_ERROR` event is posted to `device#alarm`.

`Note:`
The `alarmMode` and `reportHoldoff` channels are writable but only take effect while the sensor is online (awake and connected).
There is no API to mute a flood alarm remotely, only the physical button on the device; the mute state is reported via an `ALARM_MUTED` event on `device#alarm` rather than a dedicated channel.

The `alarmMode` channel reflects the Shelly app's Alarm Mode screen:

- **Rain mode** (`rain`): rain detection only — the flood alarm is inactive.
- **Flood mode, Intense** (`intense`): loud acoustic alarm triggered by flooding (mute via physical button on device).
- **Flood mode, Normal** (`normal`): acoustic alarm triggered by flooding (mute via physical button on device).
- **Flood mode, Silent** (`disabled`): flood detection only, no acoustic alarm.

| Group   | Channel       | Type            | read-only | Description                                                               |
| ------- | ------------- | --------------- | --------- | ------------------------------------------------------------------------- |
| sensors | flood         | Switch          | yes       | ON: Water/flooding detected, OFF: dry                                     |
|         | lastUpdate    | DateTime        | yes       | Timestamp of the last update (any sensor value changed)                   |
|         | lastError     | String          | yes       | Last device error (e.g. `cable_unplugged`)                                |
| control | alarmMode     | String          | no        | Alarm mode: `rain`, `intense`, `normal`, `disabled` (see note above)      |
|         | reportHoldoff | Number:Time     | no        | Minimum time (s) between consecutive flood reports                        |
| battery | batteryLevel  | Number          | yes       | Battery level in %                                                        |
|         | lowBattery    | Switch          | yes       | ON: Low battery alert (< 20%)                                             |
| device  | alarm         | Trigger         | yes       | Trigger: `FLOOD` on flood alarm, `SENSOR_ERROR` on cable fault, `ALARM_MUTED` when muted via the physical button |

### Shelly Plus Wall Dimmer US (thing-type: shellypluswdus)

| Group | Channel     | Type   | read-only | Description                                                                       |
| ----- | ----------- | ------ | --------- | --------------------------------------------------------------------------------- |
| relay | brightness  | Dimmer | r/w       | Currently selected brightness.                                                    |
|       | outputName  | String | yes       | Logical name of this relay output as configured in the Shelly App                 |
|       | autoOn      | Number | r/w       | Relay #1: Sets a  timer to turn the device ON after every OFF command; in seconds |
|       | autoOff     | Number | r/w       | Relay #1: Sets a  timer to turn the device OFF after every ON command; in seconds |
|       | timerActive | Switch | yes       | Relay #1: ON: An auto-on/off timer is active                                      |

## Shelly Plus Mini Series

### Shelly Plus 1 Mini (thing-type: shelly1mini)

| Group | Channel     | Type    | read-only | Description                                                                       |
| ----- | ----------- | ------- | --------- | --------------------------------------------------------------------------------- |
| relay | output      | Switch  | r/w       | Relay #1: Controls the relay's output channel (on/off)                            |
|       | outputName  | String  | yes       | Logical name of this relay output as configured in the Shelly App                 |
|       | input       | Switch  | yes       | ON: Input/Button is powered, see General Notes on Channels                        |
|       | autoOn      | Number  | r/w       | Relay #1: Sets a  timer to turn the device ON after every OFF command; in seconds |
|       | autoOff     | Number  | r/w       | Relay #1: Sets a  timer to turn the device OFF after every ON command; in seconds |
|       | timerActive | Switch  | yes       | Relay #1: ON: An auto-on/off timer is active                                      |
|       | button      | Trigger | yes       | Event trigger, see section Button Events                                          |

### Shelly Plus 1PM Mini (thing-type: shelly1pmmini)

| Group | Channel           | Type     | read-only | Description                                                                                        |
| ----- | ----------------- | -------- | --------- | -------------------------------------------------------------------------------------------------- |
| relay | output            | Switch   | r/w       | Relay #1: Controls the relay's output channel (on/off)                                             |
|       | outputName        | String   | yes       | Logical name of this relay output as configured in the Shelly App                                  |
|       | input             | Switch   | yes       | ON: Input/Button is powered, see General Notes on Channels                                         |
|       | autoOn            | Number   | r/w       | Relay #1: Sets a  timer to turn the device ON after every OFF command; in seconds                  |
|       | autoOff           | Number   | r/w       | Relay #1: Sets a  timer to turn the device OFF after every ON command; in seconds                  |
|       | timerActive       | Switch   | yes       | Relay #1: ON: An auto-on/off timer is active                                                       |
|       | button            | Trigger  | yes       | Event trigger, see section Button Events                                                           |
| meter | currentPower      | Number   | yes       | Current power consumption in Watts                                                                 |
|       | energyHistMin1    | Number   | yes       | Total energy consumed during the previous complete minute, minute -1 (Wh)                          |
|       | energyHistMin2    | Number   | yes       | Total energy consumed during the complete minute 2 minutes ago, minute -2 (Wh)                     |
|       | energyHistMin3    | Number   | yes       | Total energy consumed during the complete minute 3 minutes ago, minute -3 (Wh)                     |
|       | energyAvgLast3Min | Number   | yes       | Average of the total energy per minute over the previous 3 complete minutes, minutes -1 to -3 (Wh) |
|       | totalEnergy       | Number   | yes       | Total energy consumption in kWh                                                                    |
|       | resetTotals       | Switch   | r/w       | Send ON to reset the accumulated energy counters for this meter                                    |
|       | lastUpdate        | DateTime | yes       | Timestamp of the last measurement                                                                  |
|       | frequency         | Number   | yes       | Grid frequency in Hertz (Hz)                                                                       |

`Note`:
totalEnergy might reset on restart depending on device type and firmware version

### Shelly Plus PM Mini (thing-type: shellypmmini)

| Group | Channel           | Type     | read-only | Description                                                                                        |
| ----- | ----------------- | -------- | --------- | -------------------------------------------------------------------------------------------------- |
| meter | currentPower      | Number   | yes       | Current power consumption in Watts                                                                 |
|       | energyHistMin1    | Number   | yes       | Total energy consumed during the previous complete minute, minute -1 (Wh)                          |
|       | energyHistMin2    | Number   | yes       | Total energy consumed during the complete minute 2 minutes ago, minute -2 (Wh)                     |
|       | energyHistMin3    | Number   | yes       | Total energy consumed during the complete minute 3 minutes ago, minute -3 (Wh)                     |
|       | energyAvgLast3Min | Number   | yes       | Average of the total energy per minute over the previous 3 complete minutes, minutes -1 to -3 (Wh) |
|       | totalEnergy       | Number   | yes       | Total energy consumption in kWh                                                                    |
|       | resetTotals       | Switch   | r/w       | Send ON to reset the accumulated energy counters for this meter                                    |
|       | lastUpdate        | DateTime | yes       | Timestamp of the last measurement                                                                  |
|       | frequency         | Number   | yes       | Grid frequency in Hertz (Hz)                                                                       |

`Note`:
totalEnergy might reset on restart depending on device type and firmware version

### Shelly EM Mini (thing-type: shellyemmini)

| Group  | Channel           | Type         | read-only | Description                                                                                        |
| ------ | ----------------- | ------------ | --------- | -------------------------------------------------------------------------------------------------- |
| relay  | output            | Switch       | r/w       | Controls the relay's output channel (on/off)                                                       |
|        | outputName        | String       | yes       | Logical name of this relay output as configured in the Shelly App                                  |
|        | input             | Switch       | yes       | ON: Input/Button is powered, see general notes on channels                                         |
|        | button            | Trigger      | yes       | Event trigger, see section Button Events                                                           |
|        | lastEvent         | String       | yes       | Last event type (S/SS/SSS/L)                                                                       |
|        | eventCount        | Number       | yes       | Counter gets incremented every time the device issues a button event.                              |
|        | autoOn            | Number       | r/w       | Relay #1: Sets a  timer to turn the device ON after every OFF command; in seconds                  |
|        | autoOff           | Number       | r/w       | Relay #1: Sets a  timer to turn the device OFF after every ON command; in seconds                  |
|        | timerActive       | Switch       | yes       | Relay #1: ON: An auto-on/off timer is active                                                       |
| meter1 | currentPower      | Number       | yes       | Current power consumption in Watts                                                                 |
|        | totalEnergy       | Number       | yes       | Total energy consumption in kWh since the device powered up (resets on restart)                    |
|        | returnedEnergy    | Number       | yes       | Total returned energy, kWh                                                                         |
|        | reactivePower     | Number:Power | yes       | Instantaneous reactive power (VAR)                                                                 |
|        | apparentPower     | Number:Power | yes       | Instantaneous apparent power (VA)                                                                  |
|        | voltage           | Number       | yes       | RMS voltage, Volts                                                                                 |
|        | powerFactor       | Number       | yes       | Power factor (-1.0 to 1.0)                                                                         |
|        | resetTotals       | Switch       | r/w       | Send ON to reset the accumulated energy counters for this meter                                    |
|        | frequency         | Number       | yes       | Grid frequency (Hz)                                                                                |
|        | lastUpdate        | DateTime     | yes       | Timestamp of the last measurement                                                                  |
| meter2 | currentPower      | Number       | yes       | Current power consumption in Watts                                                                 |
|        | totalEnergy       | Number       | yes       | Total energy consumption in kWh since the device powered up (resets on restart)                    |
|        | returnedEnergy    | Number       | yes       | Total returned energy, kWh                                                                         |
|        | reactivePower     | Number:Power | yes       | Instantaneous reactive power (VAR)                                                                 |
|        | apparentPower     | Number:Power | yes       | Instantaneous apparent power (VA)                                                                  |
|        | voltage           | Number       | yes       | RMS voltage, Volts                                                                                 |
|        | powerFactor       | Number       | yes       | Power factor (-1.0 to 1.0)                                                                         |
|        | resetTotals       | Switch       | r/w       | Send ON to reset the accumulated energy counters for this meter                                    |
|        | frequency         | Number       | yes       | Grid frequency (Hz)                                                                                |
|        | lastUpdate        | DateTime     | yes       | Timestamp of the last measurement                                                                  |

## Shelly Pro Series

### Shelly Pro 1 (thing-type: shellypro1)

| Group | Channel     | Type    | read-only | Description                                                                       |
| ----- | ----------- | ------- | --------- | --------------------------------------------------------------------------------- |
| relay | output      | Switch  | r/w       | Controls the relay's output channel (on/off)                                      |
|       | outputName  | String  | yes       | Logical name of this relay output as configured in the Shelly App                 |
|       | input1      | Switch  | yes       | ON: Input/Button for input 1 is powered, see general notes on channels            |
|       | button1     | Trigger | yes       | Event trigger, see section Button Events                                          |
|       | lastEvent1  | String  | yes       | Last event type (S/SS/SSS/L) for input 1                                          |
|       | eventCount1 | Number  | yes       | Counter gets incremented every time the device issues a button event.             |
|       | input2      | Switch  | yes       | ON: Input/Button for channel 2 is powered, see general notes on channels          |
|       | button2     | Trigger | yes       | Event trigger, see section Button Events                                          |
|       | lastEvent2  | String  | yes       | Last event type (S/SS/SSS/L) for input 2                                          |
|       | eventCount2 | Number  | yes       | Counter gets incremented every time the device issues a button event.             |
|       | autoOn      | Number  | r/w       | Relay #1: Sets a  timer to turn the device ON after every OFF command; in seconds |
|       | autoOff     | Number  | r/w       | Relay #1: Sets a  timer to turn the device OFF after every ON command; in seconds |
|       | timerActive | Switch  | yes       | Relay #1: ON: An auto-on/off timer is active                                      |

### Shelly BLU Gateway, BLU Gateway 3 (thing-type: shellyblugw)

There are no additional channels besides the device group.

### Shelly Pro 1 PM (thing-type: shellypro1pm)

| Group | Channel           | Type     | read-only | Description                                                                                        |
| ----- | ----------------- | -------- | --------- | -------------------------------------------------------------------------------------------------- |
| relay | output            | Switch   | r/w       | Controls the relay's output channel (on/off)                                                       |
|       | outputName        | String   | yes       | Logical name of this relay output as configured in the Shelly App                                  |
|       | input1            | Switch   | yes       | ON: Input/Button for input 1 is powered, see general notes on channels                             |
|       | button1           | Trigger  | yes       | Event trigger, see section Button Events                                                           |
|       | lastEvent1        | String   | yes       | Last event type (S/SS/SSS/L) for input 1                                                           |
|       | eventCount1       | Number   | yes       | Counter gets incremented every time the device issues a button event.                              |
|       | input2            | Switch   | yes       | ON: Input/Button for channel 2 is powered, see general notes on channels                           |
|       | button2           | Trigger  | yes       | Event trigger, see section Button Events                                                           |
|       | lastEvent2        | String   | yes       | Last event type (S/SS/SSS/L) for input 2                                                           |
|       | eventCount2       | Number   | yes       | Counter gets incremented every time the device issues a button event.                              |
|       | autoOn            | Number   | r/w       | Relay #1: Sets a  timer to turn the device ON after every OFF command; in seconds                  |
|       | autoOff           | Number   | r/w       | Relay #1: Sets a  timer to turn the device OFF after every ON command; in seconds                  |
|       | timerActive       | Switch   | yes       | Relay #1: ON: An auto-on/off timer is active                                                       |
| meter | currentPower      | Number   | yes       | Current power consumption in Watts                                                                 |
|       | energyHistMin1    | Number   | yes       | Total energy consumed during the previous complete minute, minute -1 (Wh)                          |
|       | energyHistMin2    | Number   | yes       | Total energy consumed during the complete minute 2 minutes ago, minute -2 (Wh)                     |
|       | energyHistMin3    | Number   | yes       | Total energy consumed during the complete minute 3 minutes ago, minute -3 (Wh)                     |
|       | energyAvgLast3Min | Number   | yes       | Average of the total energy per minute over the previous 3 complete minutes, minutes -1 to -3 (Wh) |
|       | totalEnergy       | Number   | yes       | Total energy consumption in kWh                                                                    |
|       | resetTotals       | Switch   | r/w       | Send ON to reset the accumulated energy counters for this meter                                    |
|       | lastUpdate        | DateTime | yes       | Timestamp of the last measurement                                                                  |

`Note`:
totalEnergy might reset on restart depending on device type and firmware version

### Shelly Pro 1CB (thing-type: shellypro1cb)

| Group | Channel    | Type   | read-only | Description                                                       |
| ----- | ---------- | ------ | --------- | ----------------------------------------------------------------- |
| relay | output     | Switch | r/w       | Controls the relay's output channel (on/off)                      |
|       | outputName | String | yes       | Logical name of this relay output as configured in the Shelly App |
| meter | voltage    | Number | yes       | RMS voltage, Volts                                                |

### Shelly Pro 2 (thing-type: shellypro2-relay)

| Group  | Channel     | Type    | read-only | Description                                                                       |
| ------ | ----------- | ------- | --------- | --------------------------------------------------------------------------------- |
| relay1 | output      | Switch  | r/w       | Relay #1: Controls the relay's output channel (on/off)                            |
|        | outputName  | String  | yes       | Logical name of this relay output as configured in the Shelly App                 |
|        | input       | Switch  | yes       | ON: Input/Button is powered, see General Notes on Channels                        |
|        | autoOn      | Number  | r/w       | Relay #1: Sets a  timer to turn the device ON after every OFF command; in seconds |
|        | autoOff     | Number  | r/w       | Relay #1: Sets a  timer to turn the device OFF after every ON command; in seconds |
|        | timerActive | Switch  | yes       | Relay #1: ON: An auto-on/off timer is active                                      |
|        | button      | Trigger | yes       | Event trigger, see section Button Events                                          |
| relay2 | output      | Switch  | r/w       | Relay #2: Controls the relay's output channel (on/off)                            |
|        | outputName  | String  | yes       | Logical name of this relay output as configured in the Shelly App                 |
|        | input       | Switch  | yes       | ON: Input/Button is powered, see General Notes on Channels                        |
|        | autoOn      | Number  | r/w       | Relay #2: Sets a  timer to turn the device ON after every OFF command; in seconds |
|        | autoOff     | Number  | r/w       | Relay #2: Sets a  timer to turn the device OFF after every ON command; in seconds |
|        | timerActive | Switch  | yes       | Relay #2: ON: An auto-on/off timer is active                                      |
|        | button      | Trigger | yes       | Event trigger, see section Button Events                                          |

### Shelly Pro 2 PM - relay mode (thing-type: shellypro2pm-relay)

| Group  | Channel           | Type     | read-only | Description                                                                                        |
| ------ | ----------------- | -------- | --------- | -------------------------------------------------------------------------------------------------- |
| relay1 | output            | Switch   | r/w       | Relay #1: Controls the relay's output channel (on/off)                                             |
|        | outputName        | String   | yes       | Logical name of this relay output as configured in the Shelly App                                  |
|        | input             | Switch   | yes       | ON: Input/Button is powered, see General Notes on Channels                                         |
|        | autoOn            | Number   | r/w       | Relay #1: Sets a  timer to turn the device ON after every OFF command; in seconds                  |
|        | autoOff           | Number   | r/w       | Relay #1: Sets a  timer to turn the device OFF after every ON command; in seconds                  |
|        | timerActive       | Switch   | yes       | Relay #1: ON: An auto-on/off timer is active                                                       |
|        | button            | Trigger  | yes       | Event trigger, see section Button Events                                                           |
| relay2 | output            | Switch   | r/w       | Relay #2: Controls the relay's output channel (on/off)                                             |
|        | outputName        | String   | yes       | Logical name of this relay output as configured in the Shelly App                                  |
|        | input             | Switch   | yes       | ON: Input/Button is powered, see General Notes on Channels                                         |
|        | autoOn            | Number   | r/w       | Relay #2: Sets a  timer to turn the device ON after every OFF command; in seconds                  |
|        | autoOff           | Number   | r/w       | Relay #2: Sets a  timer to turn the device OFF after every ON command; in seconds                  |
|        | timerActive       | Switch   | yes       | Relay #2: ON: An auto-on/off timer is active                                                       |
|        | button            | Trigger  | yes       | Event trigger, see section Button Events                                                           |
| meter  | currentPower      | Number   | yes       | Current power consumption in Watts                                                                 |
|        | energyHistMin1    | Number   | yes       | Total energy consumed during the previous complete minute, minute -1 (Wh)                          |
|        | energyHistMin2    | Number   | yes       | Total energy consumed during the complete minute 2 minutes ago, minute -2 (Wh)                     |
|        | energyHistMin3    | Number   | yes       | Total energy consumed during the complete minute 3 minutes ago, minute -3 (Wh)                     |
|        | energyAvgLast3Min | Number   | yes       | Average of the total energy per minute over the previous 3 complete minutes, minutes -1 to -3 (Wh) |
|        | totalEnergy       | Number   | yes       | Total energy consumption in kWh                                                                    |
|        | resetTotals       | Switch   | r/w       | Send ON to reset the accumulated energy counters for this meter                                    |
|        | lastUpdate        | DateTime | yes       | Timestamp of the last measurement                                                                  |

`Note`:
totalEnergy might reset on restart depending on device type and firmware version

### Shelly Pro 2 PM - roller mode (thing-type: shellypro2pm-roller)

| Group  | Channel           | Type          | read-only | Description                                                                                        |
| ------ | ----------------- | ------------- | --------- | -------------------------------------------------------------------------------------------------- |
| roller | control           | Rollershutter | r/w       | can be open (0%), stop, or close (100%); could also handle ON (open) and OFF (close)               |
|        | rollerPos         | Dimmer        | r/w       | Roller position: 100%=open...0%=closed; gets updated when the roller stopped                       |
|        | input             | Switch        | yes       | ON: Input/Button is powered, see General Notes on Channels                                         |
|        | state             | String        | yes       | Roller state: open/close/stop                                                                      |
|        | stopReason        | String        | yes       | Last stop reasons: normal, safety_switch or obstacle                                               |
|        | safety            | Switch        | yes       | Indicates status of the Safety Switch, ON=problem detected, powered off                            |
|        | event             | Trigger       | yes       | Roller event/trigger with payload ROLLER_OPEN / ROLLER_CLOSE / ROLLER_STOP                         |
| meter  | currentPower      | Number        | yes       | Current power consumption in Watts                                                                 |
|        | energyHistMin1    | Number        | yes       | Total energy consumed during the previous complete minute, minute -1 (Wh)                          |
|        | energyHistMin2    | Number        | yes       | Total energy consumed during the complete minute 2 minutes ago, minute -2 (Wh)                     |
|        | energyHistMin3    | Number        | yes       | Total energy consumed during the complete minute 3 minutes ago, minute -3 (Wh)                     |
|        | energyAvgLast3Min | Number        | yes       | Average of the total energy per minute over the previous 3 complete minutes, minutes -1 to -3 (Wh) |
|        | totalEnergy       | Number        | yes       | Total energy consumption in kWh                                                                    |
|        | resetTotals       | Switch        | r/w       | Send ON to reset the accumulated energy counters for this meter                                    |
|        | lastUpdate        | DateTime      | yes       | Timestamp of the last measurement                                                                  |

`Note`:
totalEnergy might reset on restart depending on device type and firmware version

### Shelly Pro 3 (thing-type: shellypro3)

| Group  | Channel     | Type    | read-only | Description                                                                       |
| ------ | ----------- | ------- | --------- | --------------------------------------------------------------------------------- |
| relay1 | output      | Switch  | r/w       | Relay #1: Controls the relay's output channel (on/off)                            |
|        | outputName  | String  | yes       | Logical name of this relay output as configured in the Shelly App                 |
|        | input       | Switch  | yes       | ON: Input/Button is powered, see General Notes on Channels                        |
|        | autoOn      | Number  | r/w       | Relay #1: Sets a  timer to turn the device ON after every OFF command; in seconds |
|        | autoOff     | Number  | r/w       | Relay #1: Sets a  timer to turn the device OFF after every ON command; in seconds |
|        | timerActive | Switch  | yes       | Relay #1: ON: An auto-on/off timer is active                                      |
|        | button      | Trigger | yes       | Event trigger, see section Button Events                                          |
| relay2 | output      | Switch  | r/w       | Relay #2: Controls the relay's output channel (on/off)                            |
|        | outputName  | String  | yes       | Logical name of this relay output as configured in the Shelly App                 |
|        | input       | Switch  | yes       | ON: Input/Button is powered, see General Notes on Channels                        |
|        | autoOn      | Number  | r/w       | Relay #2: Sets a  timer to turn the device ON after every OFF command; in seconds |
|        | autoOff     | Number  | r/w       | Relay #2: Sets a  timer to turn the device OFF after every ON command; in seconds |
|        | timerActive | Switch  | yes       | Relay #2: ON: An auto-on/off timer is active                                      |
|        | button      | Trigger | yes       | Event trigger, see section Button Events                                          |
| relay3 | output      | Switch  | r/w       | Relay #3: Controls the relay's output channel (on/off)                            |
|        | outputName  | String  | yes       | Logical name of this relay output as configured in the Shelly App                 |
|        | input       | Switch  | yes       | ON: Input/Button is powered, see General Notes on Channels                        |
|        | autoOn      | Number  | r/w       | Relay #3: Sets a  timer to turn the device ON after every OFF command; in seconds |
|        | autoOff     | Number  | r/w       | Relay #3: Sets a  timer to turn the device OFF after every ON command; in seconds |
|        | timerActive | Switch  | yes       | Relay #3: ON: An auto-on/off timer is active                                      |
|        | button      | Trigger | yes       | Relay #3:  Event trigger, see section Button Events                               |

### Shelly Pro 3EM (thing-type: shellypro3em)

| Group  | Channel           | Type         | read-only | Description                                                                                        |
| ------ | ----------------- | ------------ | --------- | -------------------------------------------------------------------------------------------------- |
| meter1 | currentPower      | Number       | yes       | Current power consumption in Watts                                                                 |
|        | totalEnergy       | Number       | yes       | Total energy consumption in kWh                                                                    |
|        | returnedEnergy    | Number       | yes       | Total returned energy, kWh                                                                         |
|        | reactivePower     | Number:Power | yes       | Instantaneous reactive power (VAR)                                                                 |
|        | apparentPower     | Number:Power | yes       | Instantaneous apparent power (VA)                                                                  |
|        | voltage           | Number       | yes       | RMS voltage, Volts                                                                                 |
|        | current           | Number       | yes       | Current in A                                                                                       |
|        | powerFactor       | Number       | yes       | Power factor (-1.0 to 1.0)                                                                         |
|        | lastUpdate        | DateTime     | yes       | Timestamp of the last measurement                                                                  |
| meter2 | currentPower      | Number       | yes       | Current power consumption in Watts                                                                 |
|        | totalEnergy       | Number       | yes       | Total energy consumption in kWh                                                                    |
|        | returnedEnergy    | Number       | yes       | Total returned energy, kWh                                                                         |
|        | reactivePower     | Number:Power | yes       | Instantaneous reactive power (VAR)                                                                 |
|        | apparentPower     | Number:Power | yes       | Instantaneous apparent power (VA)                                                                  |
|        | voltage           | Number       | yes       | RMS voltage, Volts                                                                                 |
|        | current           | Number       | yes       | Current in A                                                                                       |
|        | powerFactor       | Number       | yes       | Power factor (-1.0 to 1.0)                                                                         |
|        | lastUpdate        | DateTime     | yes       | Timestamp of the last measurement                                                                  |
| meter3 | currentPower      | Number       | yes       | Current power consumption in Watts                                                                 |
|        | totalEnergy       | Number       | yes       | Total energy consumption in kWh                                                                    |
|        | returnedEnergy    | Number       | yes       | Total returned energy, kWh                                                                         |
|        | reactivePower     | Number:Power | yes       | Instantaneous reactive power (VAR)                                                                 |
|        | apparentPower     | Number:Power | yes       | Instantaneous apparent power (VA)                                                                  |
|        | voltage           | Number       | yes       | RMS voltage, Volts                                                                                 |
|        | current           | Number       | yes       | Current in A                                                                                       |
|        | powerFactor       | Number       | yes       | Power factor (-1.0 to 1.0)                                                                         |
|        | lastUpdate        | DateTime     | yes       | Timestamp of the last measurement                                                                  |

### Shelly Pro EM-50 (thing-type: shellyproem50)

| Group  | Channel           | Type         | read-only | Description                                                                                        |
| ------ | ----------------- | ------------ | --------- | -------------------------------------------------------------------------------------------------- |
| meter1 | currentPower      | Number       | yes       | Current power consumption in Watts                                                                 |
|        | totalEnergy       | Number       | yes       | Total energy consumption in kWh                                                                    |
|        | returnedEnergy    | Number       | yes       | Total returned energy, kWh                                                                         |
|        | reactivePower     | Number:Power | yes       | Instantaneous reactive power (VAR)                                                                 |
|        | apparentPower     | Number:Power | yes       | Instantaneous apparent power (VA)                                                                  |
|        | voltage           | Number       | yes       | RMS voltage, Volts                                                                                 |
|        | current           | Number       | yes       | Current in A                                                                                       |
|        | powerFactor       | Number       | yes       | Power factor (-1.0 to 1.0)                                                                         |
|        | resetTotals       | Switch       | r/w       | Send ON to reset the accumulated energy counters for this meter                                    |
|        | lastUpdate        | DateTime     | yes       | Timestamp of the last measurement                                                                  |
| meter2 | currentPower      | Number       | yes       | Current power consumption in Watts                                                                 |
|        | totalEnergy       | Number       | yes       | Total energy consumption in kWh                                                                    |
|        | returnedEnergy    | Number       | yes       | Total returned energy, kWh                                                                         |
|        | reactivePower     | Number:Power | yes       | Instantaneous reactive power (VAR)                                                                 |
|        | apparentPower     | Number:Power | yes       | Instantaneous apparent power (VA)                                                                  |
|        | voltage           | Number       | yes       | RMS voltage, Volts                                                                                 |
|        | current           | Number       | yes       | Current in A                                                                                       |
|        | powerFactor       | Number       | yes       | Power factor (-1.0 to 1.0)                                                                         |
|        | resetTotals       | Switch       | r/w       | Send ON to reset the accumulated energy counters for this meter                                    |
|        | lastUpdate        | DateTime     | yes       | Timestamp of the last measurement                                                                  |
| relay  | output            | Switch       | r/w       | Relay #1: Controls the relay's output channel (on/off)                                             |
|        | outputName        | String       | yes       | Logical name of this relay output as configured in the Shelly App                                  |
|        | input             | Switch       | yes       | ON: Input/Button is powered, see General Notes on Channels                                         |
|        | autoOn            | Number       | r/w       | Relay #1: Sets a  timer to turn the device ON after every OFF command; in seconds                  |
|        | autoOff           | Number       | r/w       | Relay #1: Sets a  timer to turn the device OFF after every ON command; in seconds                  |
|        | timerActive       | Switch       | yes       | Relay #1: ON: An auto-on/off timer is active                                                       |
|        | button            | Trigger      | yes       | Event trigger, see section Button Events                                                           |

`Note`:
totalEnergy might reset on restart depending on device type and firmware version

### Shelly Pro 4PM (thing-type: shellypro4pm)

| Group  | Channel | Type | read-only | Description                                     |
| ------ | ------- | ---- | --------- | ----------------------------------------------- |
| relay1 |         |      | r/w       | Relay #1 with control options and status values |
| relay2 |         |      | r/w       | Relay #2 with control options and status values |
| relay3 |         |      | r/w       | Relay #3 with control options and status values |
| relay4 |         |      | r/w       | Relay #4 with control options and status values |
| meter1 |         |      | r/w       | Power Meter #1 with measurement values          |
| meter2 |         |      | r/w       | Power Meter #2 with measurement values          |
| meter3 |         |      | r/w       | Power Meter #3 with measurement values          |
| meter4 |         |      | r/w       | Power Meter #4 with measurement values          |

## Shelly BLU Devices

### Shelly BLU Button 1 (thing-type: shellyblubutton)

See notes on discovery of Shelly BLU devices above.

| Group   | Channel       | Type     | read-only | Description                                                                         |
| ------- | ------------- | -------- | --------- | ----------------------------------------------------------------------------------- |
| status  | lastEvent     | String   | yes       | Last event type (S/SS/SSS/L)                                                        |
|         | eventCount    | Number   | yes       | Counter gets incremented every time the device issues a button event.               |
|         | button        | Trigger  | yes       | Event trigger with payload, see SHORT_PRESSED or LONG_PRESSED                       |
|         | lastUpdate    | DateTime | yes       | Timestamp of the last measurement                                                   |
| battery | batteryLevel  | Number   | yes       | Battery Level in %                                                                  |
|         | lowBattery    | Switch   | yes       | Low battery alert (< 20%)                                                           |
| device  | gatewayDevice | String   | yes       | Shelly forwarded last status update (BLU gateway), could vary from packet to packet |

### Shelly BLU Wall Switch 4 (thing-type: shellybluwallswitch4)

See notes on discovery of Shelly BLU devices above.

| Group   | Channel       | Type     | read-only | Description                                                                         |
| ------- | ------------- | -------- | --------- | ----------------------------------------------------------------------------------- |
| status1 | lastEvent     | String   | yes       | Last event type (S/SS/SSS/L/H) for button 1                                         |
|         | eventCount    | Number   | yes       | Counter gets incremented every time the device issues a button event.               |
|         | button        | Trigger  | yes       | Event trigger with payload, see SHORT_PRESSED or LONG_PRESSED                       |
|         | lastUpdate    | DateTime | yes       | Timestamp of the last measurement                                                   |
| status2 | lastEvent     | String   | yes       | Last event type (S/SS/SSS/L/H) for button 2                                         |
|         | eventCount    | Number   | yes       | Counter gets incremented every time the device issues a button event.               |
|         | button        | Trigger  | yes       | Event trigger with payload, see SHORT_PRESSED or LONG_PRESSED                       |
|         | lastUpdate    | DateTime | yes       | Timestamp of the last measurement                                                   |
| status3 | lastEvent     | String   | yes       | Last event type (S/SS/SSS/L/H) for button 3                                         |
|         | eventCount    | Number   | yes       | Counter gets incremented every time the device issues a button event.               |
|         | button        | Trigger  | yes       | Event trigger with payload, see SHORT_PRESSED or LONG_PRESSED                       |
|         | lastUpdate    | DateTime | yes       | Timestamp of the last measurement                                                   |
| status4 | lastEvent     | String   | yes       | Last event type (S/SS/SSS/L/H) for button 4                                         |
|         | eventCount    | Number   | yes       | Counter gets incremented every time the device issues a button event.               |
|         | button        | Trigger  | yes       | Event trigger with payload, see SHORT_PRESSED or LONG_PRESSED                       |
|         | lastUpdate    | DateTime | yes       | Timestamp of the last measurement                                                   |
| battery | batteryLevel  | Number   | yes       | Battery Level in %                                                                  |
|         | lowBattery    | Switch   | yes       | Low battery alert (< 20%)                                                           |
| device  | gatewayDevice | String   | yes       | Shelly forwarded last status update (BLU gateway), could vary from packet to packet |

### Shelly BLU RC Button 4 (thing-type: shellyblurcbutton4)

See notes on discovery of Shelly BLU devices above.

| Group   | Channel       | Type     | read-only | Description                                                                         |
| ------- | ------------- | -------- | --------- | ----------------------------------------------------------------------------------- |
| status1 | lastEvent     | String   | yes       | Last event type (S/SS/SSS/L/H) for button 1                                         |
|         | eventCount    | Number   | yes       | Counter gets incremented every time the device issues a button event.               |
|         | button        | Trigger  | yes       | Event trigger with payload, see SHORT_PRESSED or LONG_PRESSED                       |
|         | lastUpdate    | DateTime | yes       | Timestamp of the last measurement                                                   |
| status2 | lastEvent     | String   | yes       | Last event type (S/SS/SSS/L/H) for button 2                                         |
|         | eventCount    | Number   | yes       | Counter gets incremented every time the device issues a button event.               |
|         | button        | Trigger  | yes       | Event trigger with payload, see SHORT_PRESSED or LONG_PRESSED                       |
|         | lastUpdate    | DateTime | yes       | Timestamp of the last measurement                                                   |
| status3 | lastEvent     | String   | yes       | Last event type (S/SS/SSS/L/H) for button 3                                         |
|         | eventCount    | Number   | yes       | Counter gets incremented every time the device issues a button event.               |
|         | button        | Trigger  | yes       | Event trigger with payload, see SHORT_PRESSED or LONG_PRESSED                       |
|         | lastUpdate    | DateTime | yes       | Timestamp of the last measurement                                                   |
| status4 | lastEvent     | String   | yes       | Last event type (S/SS/SSS/L/H) for button 4                                         |
|         | eventCount    | Number   | yes       | Counter gets incremented every time the device issues a button event.               |
|         | button        | Trigger  | yes       | Event trigger with payload, see SHORT_PRESSED or LONG_PRESSED                       |
|         | lastUpdate    | DateTime | yes       | Timestamp of the last measurement                                                   |
| battery | batteryLevel  | Number   | yes       | Battery Level in %                                                                  |
|         | lowBattery    | Switch   | yes       | Low battery alert (< 20%)                                                           |
| device  | gatewayDevice | String   | yes       | Shelly forwarded last status update (BLU gateway), could vary from packet to packet |

### Shelly BLU Door/Window Sensor (thing-type: shellybludw)

See notes on discovery of Shelly BLU devices above.

| Group   | Channel       | Type     | read-only | Description                                                                         |
| ------- | ------------- | -------- | --------- | ----------------------------------------------------------------------------------- |
| sensors | state         | Contact  | yes       | OPEN: Contact is open, CLOSED: Contact is closed                                    |
|         | lux           | Number   | yes       | Brightness in Lux                                                                   |
|         | tilt          | Number   | yes       | Tilt in ° (angle), -1 indicates that the sensor is not calibrated                   |
|         | eventCount    | Number   | yes       | Counter gets incremented every time the device issues a button event.               |
|         | button        | Trigger  | yes       | Event trigger with payload, see SHORT_PRESSED or LONG_PRESSED                       |
|         | lastUpdate    | DateTime | yes       | Timestamp of the last update (any sensor value changed)                             |
| battery | batteryLevel  | Number   | yes       | Battery Level in %                                                                  |
|         | lowBattery    | Switch   | yes       | Low battery alert (< 20%)                                                           |
| device  | gatewayDevice | String   | yes       | Shelly forwarded last status update (BLU gateway), could vary from packet to packet |

### Shelly BLU Motion Sensor (thing-type: shellyblumotion)

See notes on discovery of Shelly BLU devices above.

| Group   | Channel       | Type   | read-only | Description                                                                         |
| ------- | ------------- | ------ | --------- | ----------------------------------------------------------------------------------- |
| sensors | motion        | Switch | yes       | ON: Motion detected                                                                 |
| battery | batteryLevel  | Number | yes       | Battery Level in %                                                                  |
|         | lowBattery    | Switch | yes       | Low battery alert (< 20%)                                                           |
| device  | gatewayDevice | String | yes       | Shelly forwarded last status update (BLU gateway), could vary from packet to packet |

### Shelly BLU H&T (thing-type: shellybluht)

See notes on discovery of Shelly BLU devices above.

| Group   | Channel      | Type     | read-only | Description                                                           |
| ------- | ------------ | -------- | --------- | --------------------------------------------------------------------- |
| sensors | temperature  | Number   | yes       | Temperature, unit is reported by tempUnit                             |
|         | humidity     | Number   | yes       | Relative humidity in %                                                |
|         | eventCount   | Number   | yes       | Counter gets incremented every time the device issues a button event. |
|         | button       | Trigger  | yes       | Event trigger with payload, see SHORT_PRESSED or LONG_PRESSED         |
|         | lastUpdate   | DateTime | yes       | Timestamp of the last update (any sensor value changed)               |
| battery | batteryLevel | Number   | yes       | Battery Level in %                                                    |
|         | lowBattery   | Switch   | yes       | Low battery alert (< 20%)                                             |

### Shelly BLU Distance (thing-type: shellybludistance)

See notes on discovery of Shelly BLU devices above.

| Group   | Channel       | Type   | read-only | Description                                                                         |
| ------- | ------------- | ------ | --------- | ----------------------------------------------------------------------------------- |
| sensors | distance      | Number | yes       | Distance in mm                                                                      |
|         | vibration     | Switch | yes       | ON: Vibration detected                                                              |
| battery | batteryLevel  | Number | yes       | Battery Level in %                                                                  |
|         | lowBattery    | Switch | yes       | Low battery alert (< 20%)                                                           |
| device  | gatewayDevice | String | yes       | Shelly forwarded last status update (BLU gateway), could vary from packet to packet |

### Shelly BLU Remote (thing-type: shellybluremote)

See notes on discovery of Shelly BLU devices above.

| Group   | Channel       | Type     | read-only | Description                                                                         |
| ------- | ------------- | -------- | --------- | ----------------------------------------------------------------------------------- |
| sensors | channel       | Number   | yes       | Selected channel                                                                    |
|         | steps         | Number   | yes       | Number of steps the wheel was moved                                                 |
|         | rotationX     | Number   | yes       | Rotation X axis                                                                     |
|         | rotationY     | Number   | yes       | Rotation Y axis                                                                     |
|         | rotationZ     | Number   | yes       | Rotation Z axis                                                                     |
|         | direction     | Number   | yes       | up / down                                                                           |
|         | lastUpdate    | DateTime | yes       | Timestamp of the last update (any sensor value changed)                             |
| status1 | button        | Trigger  | yes       | Event trigger with payload, see SHORT_PRESSED or LONG_PRESSED                       |
|         | lastEvent     | String   | yes       | Last event type (S/SS/SSS/L/H) for button 1                                         |
|         | eventCount    | Number   | yes       | Counter gets incremented every time the device issues a button event.               |
| status2 | button        | Trigger  | yes       | Event trigger with payload, see SHORT_PRESSED or LONG_PRESSED                       |
|         | lastEvent     | String   | yes       | Last event type (S/SS/SSS/L/H) for button 1                                         |
|         | eventCount    | Number   | yes       | Counter gets incremented every time the device issues a button event.               |
| battery | batteryLevel  | Number   | yes       | Battery Level in %                                                                  |
|         | lowBattery    | Switch   | yes       | Low battery alert (< 20%)                                                           |
| device  | gatewayDevice | String   | yes       | Shelly forwarded last status update (BLU gateway), could vary from packet to packet |

### Ecowitt WS90 Weather Station (Shelly BLU) (thing-type: shellybluws90)

See notes on discovery of Shelly BLU devices above.

| Group   | Channel       | Type                 | read-only | Description                                                                         |
| ------- | ------------- | -------------------- | --------- | ----------------------------------------------------------------------------------- |
| sensors | temperature   | Number:Temperature   | yes       | Temperature in degrees Celsius                                                      |
|         | humidity      | Number:Dimensionless | yes       | Relative humidity in %                                                              |
|         | uvIndex       | Number               | yes       | UV Index (dimensionless, 0-11+)                                                     |
|         | lux           | Number:Illuminance   | yes       | Brightness in Lux (created once the device reports a value)                         |
|         | windSpeed     | Number:Speed         | yes       | Wind speed in m/s                                                                   |
|         | windDirection | Number:Angle         | yes       | Wind direction in degrees (0-360)                                                   |
|         | gustSpeed     | Number:Speed         | yes       | Wind gust speed in m/s                                                              |
|         | gustDirection | Number:Angle         | yes       | Wind gust direction in degrees (0-360)                                              |
|         | pressure      | Number:Pressure      | yes       | Atmospheric pressure in hPa                                                         |
|         | dewPoint      | Number:Temperature   | yes       | Dew point in degrees Celsius                                                        |
|         | rainStatus    | Switch               | yes       | ON: It's raining, OFF: It's not raining                                             |
|         | precipitation | Number:Length        | yes       | Accumulated rainfall in mm (monotonic total since sensor reset)                     |
|         | lastUpdate    | DateTime             | yes       | Timestamp of the last update (any sensor value changed)                             |
| battery | batteryLevel  | Number               | yes       | Battery Level in %                                                                  |
|         | lowBattery    | Switch               | yes       | Low battery alert (< 20%)                                                           |
| device  | gatewayDevice | String               | yes       | Shelly forwarded last status update (BLU gateway), could vary from packet to packet |
|         | firmware      | String               | yes       | Firmware version (may be empty — not all firmware versions report it)               |

The `rainStatus` channel latches ON for a while after it has actually stopped raining, a hardware behavior of the WS90's piezo rain sensor rather than a binding issue.

## Shelly Wall Displays

| Group   | Channel     | Type     | read-only | Description                                                                       |
| ------- | ----------- | -------- | --------- | --------------------------------------------------------------------------------- |
| relay   | output      | Switch   | r/w       | Controls the relay's output channel (on/off)                                      |
|         | outputName  | String   | yes       | Logical name of this relay output as configured in the Shelly App                 |
|         | input       | Switch   | yes       | ON: Input/Button is powered, see General Notes on Channels                        |
|         | autoOn      | Number   | r/w       | Relay #1: Sets a  timer to turn the device ON after every OFF command; in seconds |
|         | autoOff     | Number   | r/w       | Relay #1: Sets a  timer to turn the device OFF after every ON command; in seconds |
|         | timerActive | Switch   | yes       | Relay #1: ON: An auto-on/off timer is active                                      |
|         | button      | Trigger  | yes       | Event trigger, see section Button Events                                          |
| sensors | temperature | Number   | yes       | Temperature reported by the integrated sensor                                     |
|         | humidity    | Number   | yes       | Relative Humidity in percent reported by the integrated sensor                    |
|         | lux         | Number   | yes       | Brightness in Lux reported by the integrated sensor                               |
|         | lastUpdate  | DateTime | yes       | Timestamp of the last update (any sensor value changed)                           |

## Full Example

### shelly.things

```java
/* Shelly 2.5 Roller */
Thing shelly:shelly25-roller:XXXXX1 "Shelly 25 Roller XXXXX1" @ "Home Theater" [deviceIp="x.x.x.x", userId="", password=""]
Thing shelly:shelly25-roller:XXXXX2 "Shelly 25 Roller XXXXX2" @ "Living Room"  [deviceIp="x.x.x.x", userId="admin", password="secret"]

/* Shelly 2.5 Relays */
Thing shelly:shelly25-relay:XXXXX3 "Shelly 25 Relay XXXXX3" @ "Hall Way" [deviceIp="x.x.x.x", userId="", password=""]
Thing shelly:shelly25-relay:XXXXX4 "Shelly 25 Relay XXXXX4" @ "Dining Room" [deviceIp="x.x.x.x", userId="", password=""]
Thing shelly:shelly25-relay:XXXXX5 "Shelly 25 Relay XXXXX5" @ "Bed Room" [deviceIp="x.x.x.x", userId="", password=""]

/* Other *
Thing shelly:shellyht:e01691 "ShellyChimenea" @ "lowerground" [ deviceIp="10.0.55.101", userId="", password="", lowBattery=15 , eventsCoIoT=true ]
Thing shelly:shellyht:e01681 "ShellyDormitorio" @ "upperground" [ deviceIp="10.0.55.102", userId="", password="", lowBattery=15 , eventsCoIoT=true ]
Thing shelly:shellyflood:XXXXXX "ShellyFlood" @ "cellar" [ deviceIp="10.0.0.103", userId="", password="", lowBattery=15, eventsSwitch=true, eventsButton=true, eventsCoIoT=true ]
```

### shelly.items

```java
/* Relays */
Switch Shelly_XXXXX3_Relay        "Garage Light"                  {channel="shelly:shelly1:XXXXX3:relay#output"}
Number Shelly_XXXXX3_AutoOnTimer  "Garage Light Auto On Timer"    {channel="shelly:shelly1:XXXXX3:relay#autoOn"}
Number Shelly_XXXXX3_AutoOffTimer "Garage Light Auto Off Timer"   {channel="shelly:shelly1:BA2F18:relay#autoOff"}
Switch Shelly_XXXXX3_Relay        "Garage Light"                  {channel="shelly:shelly1:XXXXX3:relay#output"}
Switch Shelly_XXXXX3_Input        "Garage Switch (Input)"         {channel="shelly:shelly1:XXXXX3:relay#input"}

/* Sensors */
Number ShellyHT_Dormitorio_Temp  "Dormitorio Temperature" <temperature> {channel="shelly:shellyht:e01681:sensors#temperature"}
Number ShellyHT_Dormitorio_Humid "Dormitorio Humidity"    <humidity>    {channel="shelly:shellyht:e01681:sensors#humidity"}
Number ShellyHT_Dormitorio_Batt  "Dormitorio Battery"     <battery>     {channel="shelly:shellyht:e01681:battery#batteryLevel"}
Number ShellyHT_Chimenea_Temp    "Chimenea Temperature"   <temperature> {channel="shelly:shellyht:e01691:sensors#temperature"}
Number ShellyHT_Chimenea_Humid   "Chimenea Humidity"      <humidity>    {channel="shelly:shellyht:e01691:sensors#humidity"}
Number ShellyHT_Chimenea_Batt    "Chimenea Battery"       <battery>     {channel="shelly:shellyht:e01691:battery#batteryLevel"}
Number ShellyF_Sotano_Temp       "Sotano Temperature"     <temperature> {channel="shelly:shellyflood:764fe0:sensors#temperature"}
Number ShellyF_Sotano_Batt       "Sotano Battery"         <battery>     {channel="shelly:shellyflood:764fe0:battery#batteryLevel"}
Switch ShellyF_Sotano_Flood      "Sotano Flood Alarm"     <alarm>       {channel="shelly:shellyflood:764fe0:sensors#flood"}

/* Dimmer */
Switch DimmerSwitch     "Light on/off"                       {channel="shelly:shellydimmer:XXX:relay#brightness"}
Dimmer DimmerBrightness "Garage Light Brightness"            {channel="shelly:shellydimmer:XXX:relay#brightness"}
Dimmer DimmerIncDec     "Garage Light +/-"                   {channel="shelly:shellydimmer:XXX:relay#brightness"}

Number Shelly_Power     "Bath Room Light Power"                {channel="shelly:shelly1:XXXXXX:meter#currentPower"} /* Power Meter */

```

### shelly.rules

#### Catch alarms

```java
rule "Monitor Shelly Restart"
when
    Channel "shelly:shelly2-relay:XXXXXX:device#alarm" triggered OVERTEMP
then
        logInfo("Shelly1", "Device is getting to hot!!")
end
```

#### Trigger scene with Button-1

```java
rule "Button-1 SHORT_PRESSED"
when
    Channel "shelly:shellybutton1:d8f15bXXXXXX:status#button" triggered SHORT_PRESSED
then
    logInfo("Button", "Shelly Button reported SHORT_PRESSED")
    if (MyTV.state != OFF) {
        logInfo("Button", "   switch TV OFF")
        sendCommand(MyTV, "OFF")
    } else {
        logInfo("Button", "   switch TV to ON")
        sendCommand(MyTV, ON)
    }
end

rule "Button-1 TRIPLE_PRESSED"
when
    Channel "shelly:shellybutton1:d8f15bXXXXXX:status#button" triggered TRIPLE_PRESSED
then
    logInfo("Button", "Shelly Button reported TRIPLE_PRESSED")
end
```

#### Observe battery status

pre-requisites:

- Install Send Mail Action
- Define a group called gBatteries
'Group   gBattery        "Batterien"         <battery>       (All)'
- Link battery channel for all your Shelly battery powered devices
- Add battery items to group gBattery

```java
val String mailTo     = "alarm@openhab.me"

/* ------------- Battery Monitor ----------- */

rule "Battery Monitor"
when
    System started or
    Time cron "0 0 10 * * ?"
then
    logInfo("BatteryMon", "Check Battery state")

    if (! gBattery.allMembers.filter([state < lowBatteryThreshold]).empty) {
        message = "Battery levels:\n"

        var report = gBattery.allMembers.filter([ state instanceof DecimalType ]).sortBy([ state instanceof DecimalType ]).map[
        name + ": " + state.format("%d%%\n") ]
        message = message + report

        message = message + "\nBattery Level:\n"
        gBattery?.allMembers.forEach([sw|
            message = message + sw.name + ": " + state.format("%d%%\n")
        ])

        sendMail(mailTo, "Home: LOW Battery Alert!", message)
    }
    logInfo("BatteryMon", "Batteries checked.")
end
```

#### Control CCT LED stripes

Usage & Requirements:

- 4 Items per Thing required. Example:

```java
Group     gCCT_LED        "All CCT LEDs"
Dimmer    LED1_brightness     "Brightness"    (gCCT_LED)
Dimmer    LED1_temperature    "Temperature"   (gCCT_LED)
Dimmer    LED1_cw         "cold white Channel"
Dimmer    LED1_ww         "warm white Channel"
```

- Items "LED1" and "LED1_temperature" are proxy items and to be used in sitemaps. Both have to be a member of group "gCCT_LED"
- Items "LED1_cw" and "LED_ww" are items linked to Thing channel. Not required in sitemaps. Do NOT include in this group
- Prefix: needs to be constant per Thing.

```java
val String strSuffixSeparator = "_"             //Separator: 1 unique separator
val String strSuffixBrightness = "brightness"           //Suffix: at your choice
val String strSuffixTemperature = "temperature"         //Suffix: at your choice

rule "CCT_LED"
when
    Member of gCCT_LED changed
then
    logInfo("CCT_LED", "Item '{}' received command {}",triggeringItem.name,triggeringItem.state)
    var Number iNewCwState     //New value for cold white channel
    var Number iNewWwState     //New value for warm white channel
    val String strThing = triggeringItem.name.toString.split(strSuffixSeparator).get(0)     //Get Name of "Thing", i.e. LED1 or LED2 or...
    val String strType = triggeringItem.name.toString.split(strSuffixSeparator).get(1)      //Get Type (brightness oder temperature)

    if ((strType == strSuffixBrightness) && (triggeringItem.state as Number) == 0) {        //no math required. just switch off
        iNewCwState = 0
        iNewWwState = 0
    }
    else {
        var iBrightness = gCCT_LED.members.findFirst[ t | t.name == strThing+strSuffixSeparator+strSuffixBrightness ].state as Number
        var iColor = gCCT_LED.members.findFirst[ t | t.name == strThing+strSuffixSeparator+strSuffixTemperature ].state as Number
        logInfo("CCT_LED", "Setting 'Brightness' to {} and 'White Color' to {}",iBrightness,iColor)
        iNewWwState = Math::round ((iColor / 100 * iBrightness).intValue)
        iNewCwState = iBrightness - iNewWwState
    }
    logInfo("CCT_LED", "Changing channel 'Cold White' to {} and 'Warm White' to {}",iNewCwState,iNewWwState)
    sendCommand(strThing + "_cw", iNewCwState.toString)
    sendCommand(strThing + "_ww", iNewWwState.toString)
end
```

#### Reading Colors from Color Picker

```java
import org.openhab.core.library.types.*

rule "Get input change from garage light"
when
    Item Shelly_XXXXX3_Input changed to ON
then
    logInfo("Garage", "Light input is ON")
    BackDoorLight.sendCommand(ON)
end

rule "Momentary Switch events"
when
    Channel "shelly:shellydevice:XXXXXX:relay1#button" triggered SHORT_PRESSED
then
    logInfo("Relay", "A short push was detected")
end


rule "Shelly alarms"
when
    Channel "shelly:shellydevice:XXXXXX:device#alarm"       triggered or
    Channel "shelly:shelly25-roller:XXXXXX:device#alarm"    triggered
then
    if (receivedEvent !== null) { // A (channel) event triggered the rule
        eventSource = triggeredChannel
        eventType = receivedEvent
        ...
    }
end

rule "Color changed"
when
    Item ShellyColor changed
then
    var HSBType hsbValue = ShellyColor.state as HSBType
    var int redValue = hsbValue.red.intValue
    var int greenValue = hsbValue.green.intValue
    var int blueValue = hsbValue.blue.intValue
end

```

### shelly.sitemap

```perl
sitemap demo label="Home"
{
        Frame label="Dimmer" {
            Switch   item=DimmerSwitch
            Slider   item=DimmerBrightness
            SetPoint item=DimmerIncDec

            Number   item=ShellyHT_Dormitorio_Temp
            Number   item=ShellyHT_Chimenea_Humid
            Number   item=ShellyF_Sotano_Batt
            Number   item=Shelly_Power
        }
}
