Skip to content

Commit 3034465

Browse files
authored
[shelly] Add support for BLU Wallswitch 4, RC Button 4, Remote, Tough ZB, H&T ZB, BLU Distance (openhab#19097)
Signed-off-by: Markus Michels <markus7017@gmail.com>
1 parent f817cb0 commit 3034465

26 files changed

Lines changed: 662 additions & 136 deletions

bundles/org.openhab.binding.shelly/README.md

Lines changed: 108 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -140,12 +140,18 @@ See section [Discovery](#discovery) for details.
140140

141141
### Shelly BLU
142142

143-
| thing-type | Model | Vendor ID |
144-
| ----------------- | ------------------------------------------------------ | ----------------------- |
145-
| shellyblubutton | Shelly BLU Button 1 | SBBT |
146-
| shellybludw | Shelly BLU Door/Windows | SBDW |
147-
| shellyblumotion | Shelly BLU Motion | SBMO |
148-
| shellybluht | Shelly BLU H&T | SBMO |
143+
| thing-type | Model | Vendor ID |
144+
| -------------------- | ------------------------------------------------------ | ----------------------- |
145+
| shellyblubutton | Shelly BLU Button 1, Shelly BLU Tough | SBBT-002C |
146+
| shellyblubutton | Shelly BLU Tough ZB | SBBT-102C |
147+
| shellybluwallswitch4 | Shelly BLU Wallswitch 4 | SBBT-EU5027 |
148+
| shellyblurcbutton4 | Shelly BLU RC Button 4 | SBBT-004CUS |
149+
| shellybluht | Shelly BLU H&T | SBHT-003C |
150+
| shellybluht | Shelly BLU H&T ZB | SBHT-203C |
151+
| shellybludw | Shelly BLU Door/Windows | SBDW-002C |
152+
| shellyblumotion | Shelly BLU Motion | SBMO-003Z |
153+
| shellybludistance | Shelly BLU Distance | SBDI-003E |
154+
| shellybluremote | Shelly BLU Remote Control | SBRC-005B |
149155

150156
### Special Thing Types
151157

@@ -1541,6 +1547,10 @@ Channels lastEvent and eventCount are only available if input type is set to mom
15411547
| | autoOff | Number | r/w | Relay #1: Sets a timer to turn the device OFF after every ON command; in seconds |
15421548
| | timerActive | Switch | yes | Relay #1: ON: An auto-on/off timer is active |
15431549

1550+
## Shelly BLU Gateway, BLU Gateway 3 (thing-type: shellyblugw)
1551+
1552+
There are no additional channels besides the device group.
1553+
15441554
### Shelly Pro 1 PM (thing-type: shellypro1pm)
15451555

15461556
| Group | Channel | Type | read-only | Description |
@@ -1746,6 +1756,59 @@ See notes on discovery of Shelly BLU devices above.
17461756
| | lowBattery | Switch | yes | Low battery alert (< 20%) |
17471757
| device | gatewayDevice | String | yes | Shelly forwarded last status update (BLU gateway), could vary from packet to packet |
17481758

1759+
# Shelly BLU Wall Switch 4 (thing-type: shellybluwallswitch4)
1760+
1761+
See notes on discovery of Shelly BLU devices above.
1762+
1763+
| Group | Channel | Type | read-only | Description |
1764+
| ------- | ------------- | -------- | --------- | ----------------------------------------------------------------------------------- |
1765+
| status1 | lastEvent | String | yes | Last event type (S/SS/SSS/L/H) for button 1 |
1766+
| | eventCount | Number | yes | Counter gets incremented every time the device issues a button event. |
1767+
| | button | Trigger | yes | Event trigger with payload, see SHORT_PRESSED or LONG_PRESSED |
1768+
| | lastUpdate | DateTime | yes | Timestamp of the last measurement |
1769+
| status2 | lastEvent | String | yes | Last event type (S/SS/SSS/L/H) for button 2 |
1770+
| | eventCount | Number | yes | Counter gets incremented every time the device issues a button event. |
1771+
| | button | Trigger | yes | Event trigger with payload, see SHORT_PRESSED or LONG_PRESSED |
1772+
| | lastUpdate | DateTime | yes | Timestamp of the last measurement |
1773+
| status3 | lastEvent | String | yes | Last event type (S/SS/SSS/L/H) for button 3 |
1774+
| | eventCount | Number | yes | Counter gets incremented every time the device issues a button event. |
1775+
| | button | Trigger | yes | Event trigger with payload, see SHORT_PRESSED or LONG_PRESSED |
1776+
| | lastUpdate | DateTime | yes | Timestamp of the last measurement |
1777+
| status4 | lastEvent | String | yes | Last event type (S/SS/SSS/L/H) for button 4 |
1778+
| | eventCount | Number | yes | Counter gets incremented every time the device issues a button event. |
1779+
| | button | Trigger | yes | Event trigger with payload, see SHORT_PRESSED or LONG_PRESSED |
1780+
| | lastUpdate | DateTime | yes | Timestamp of the last measurement |
1781+
| battery | batteryLevel | Number | yes | Battery Level in % |
1782+
| | lowBattery | Switch | yes | Low battery alert (< 20%) |
1783+
| device | gatewayDevice | String | yes | Shelly forwarded last status update (BLU gateway), could vary from packet to packet |
1784+
1785+
# Shelly BLU RC Button 4 (thing-type: shellyblurcbutton4)
1786+
1787+
See notes on discovery of Shelly BLU devices above.
1788+
1789+
| Group | Channel | Type | read-only | Description |
1790+
| ------- | ------------- | -------- | --------- | ----------------------------------------------------------------------------------- |
1791+
| status1 | lastEvent | String | yes | Last event type (S/SS/SSS/L/H) for button 1 |
1792+
| | eventCount | Number | yes | Counter gets incremented every time the device issues a button event. |
1793+
| | button | Trigger | yes | Event trigger with payload, see SHORT_PRESSED or LONG_PRESSED |
1794+
| | lastUpdate | DateTime | yes | Timestamp of the last measurement |
1795+
| status2 | lastEvent | String | yes | Last event type (S/SS/SSS/L/H) for button 2 |
1796+
| | eventCount | Number | yes | Counter gets incremented every time the device issues a button event. |
1797+
| | button | Trigger | yes | Event trigger with payload, see SHORT_PRESSED or LONG_PRESSED |
1798+
| | lastUpdate | DateTime | yes | Timestamp of the last measurement |
1799+
| status3 | lastEvent | String | yes | Last event type (S/SS/SSS/L/H) for button 3 |
1800+
| | eventCount | Number | yes | Counter gets incremented every time the device issues a button event. |
1801+
| | button | Trigger | yes | Event trigger with payload, see SHORT_PRESSED or LONG_PRESSED |
1802+
| | lastUpdate | DateTime | yes | Timestamp of the last measurement |
1803+
| status4 | lastEvent | String | yes | Last event type (S/SS/SSS/L/H) for button 4 |
1804+
| | eventCount | Number | yes | Counter gets incremented every time the device issues a button event. |
1805+
| | button | Trigger | yes | Event trigger with payload, see SHORT_PRESSED or LONG_PRESSED |
1806+
| | lastUpdate | DateTime | yes | Timestamp of the last measurement |
1807+
| battery | batteryLevel | Number | yes | Battery Level in % |
1808+
| | lowBattery | Switch | yes | Low battery alert (< 20%) |
1809+
| device | gatewayDevice | String | yes | Shelly forwarded last status update (BLU gateway), could vary from packet to packet |
1810+
1811+
17491812
### Shelly BLU Door/Window Sensor (thing-type: shellybludw)
17501813

17511814
See notes on discovery of Shelly BLU devices above.
@@ -1755,6 +1818,8 @@ See notes on discovery of Shelly BLU devices above.
17551818
| sensors | state | Contact | yes | OPEN: Contact is open, CLOSED: Contact is closed |
17561819
| | lux | Number | yes | Brightness in Lux |
17571820
| | tilt | Number | yes | Tilt in ° (angle), -1 indicates that the sensor is not calibrated |
1821+
| | eventCount | Number | yes | Counter gets incremented every time the device issues a button event. |
1822+
| | button | Trigger | yes | Event trigger with payload, see SHORT_PRESSED or LONG_PRESSED |
17581823
| | lastUpdate | DateTime | yes | Timestamp of the last update (any sensor value changed) |
17591824
| battery | batteryLevel | Number | yes | Battery Level in % |
17601825
| | lowBattery | Switch | yes | Low battery alert (< 20%) |
@@ -1779,13 +1844,48 @@ See notes on discovery of Shelly BLU devices above.
17791844
| ------- | ------------- | -------- | --------- | ------------------------------------------------------- |
17801845
| sensors | temperature | Number | yes | Temperature, unit is reported by tempUnit |
17811846
| | humidity | Number | yes | Relative humidity in % |
1847+
| | eventCount | Number | yes | Counter gets incremented every time the device issues a button event. |
1848+
| | button | Trigger | yes | Event trigger with payload, see SHORT_PRESSED or LONG_PRESSED |
17821849
| | lastUpdate | DateTime | yes | Timestamp of the last update (any sensor value changed) |
17831850
| battery | batteryLevel | Number | yes | Battery Level in % |
17841851
| | lowBattery | Switch | yes | Low battery alert (< 20%) |
17851852

1786-
## Shelly BLU Gateway (thing-type: shellyblugw, shellyblugw3)
1853+
### Shelly BLU Distance(thing-type: shellybludistance)
1854+
1855+
See notes on discovery of Shelly BLU devices above.
1856+
1857+
| Group | Channel | Type | read-only | Description |
1858+
| ------- | ------------- | -------- | --------- | ----------------------------------------------------------------------------------- |
1859+
| sensors | distance | Number | yes | Distance in mm |
1860+
| | vibration | Switch | yes | ON: Vibration detected |
1861+
| battery | batteryLevel | Number | yes | Battery Level in % |
1862+
| | lowBattery | Switch | yes | Low battery alert (< 20%) |
1863+
| device | gatewayDevice | String | yes | Shelly forwarded last status update (BLU gateway), could vary from packet to packet |
1864+
1865+
### Shelly BLU Remote (thing-type: shellybluremote)
1866+
1867+
See notes on discovery of Shelly BLU devices above.
1868+
1869+
| Group | Channel | Type | read-only | Description |
1870+
| ------- | ------------- | -------- | --------- | ----------------------------------------------------------------------------------- |
1871+
| sensors | channel | Number | yes | Selected channel |
1872+
| | steps | Number | yes | Number of steps the wheel was moved |
1873+
| | rotationX | Number | yes | Rotation X axis |
1874+
| | rotationY | Number | yes | Rotation Y axis |
1875+
| | rotationZ | Number | yes | Rotation Z axis |
1876+
| | direction | Number | yes | up / down |
1877+
| | lastUpdate | DateTime | yes | Timestamp of the last update (any sensor value changed) |
1878+
| status1 | button | Trigger | yes | Event trigger with payload, see SHORT_PRESSED or LONG_PRESSED |
1879+
| | lastEvent | String | yes | Last event type (S/SS/SSS/L/H) for button 1 |
1880+
| | eventCount | Number | yes | Counter gets incremented every time the device issues a button event. |
1881+
| status2 | button | Trigger | yes | Event trigger with payload, see SHORT_PRESSED or LONG_PRESSED |
1882+
| | lastEvent | String | yes | Last event type (S/SS/SSS/L/H) for button 1 |
1883+
| | eventCount | Number | yes | Counter gets incremented every time the device issues a button event. |
1884+
| battery | batteryLevel | Number | yes | Battery Level in % |
1885+
| | lowBattery | Switch | yes | Low battery alert (< 20%) |
1886+
| device | gatewayDevice | String | yes | Shelly forwarded last status update (BLU gateway), could vary from packet to packet |
1887+
17871888

1788-
There are no additional channels beside the device group.
17891889

17901890
## Shelly Wall Displays
17911891

bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/ShellyBindingConstants.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,13 @@ public class ShellyBindingConstants {
123123
public static final String CHANNEL_SENSOR_SLEEPTIME = "sensorSleepTime";
124124
public static final String CHANNEL_SENSOR_ALARM_STATE = "alarmState";
125125
public static final String CHANNEL_SENSOR_ERROR = "lastError";
126+
public static final String CHANNEL_SENSOR_ROTATIONX = "rotationX"; // BLU Remote
127+
public static final String CHANNEL_SENSOR_ROTATIONY = "rotationY"; // BLU Remote
128+
public static final String CHANNEL_SENSOR_ROTATIONZ = "rotationZ"; // BLU Remote
129+
public static final String CHANNEL_SENSOR_CHANNEL = "channel"; // BLU Remote
130+
public static final String CHANNEL_SENSOR_STEPS = "steps"; // BLU Remote
131+
public static final String CHANNEL_SENSOR_DIRECTION = "direction"; // BLU Remote
132+
public static final String CHANNEL_SENSOR_DISTANCE = "distance"; // BLU DIstance
126133

127134
// TRV
128135
public static final String CHANNEL_CONTROL_SETTEMP = "targetTemp";
@@ -195,6 +202,7 @@ public class ShellyBindingConstants {
195202
public static final String CHANNEL_DEVST_SELFTTEST = "selfTest";
196203
public static final String CHANNEL_DEVST_VOLTAGE = "supplyVoltage";
197204
public static final String CHANNEL_DEVST_CALIBRATED = "calibrated";
205+
public static final String CHANNEL_DEVST_FIRMWARE = "firmware";
198206

199207
public static final String CHANNEL_LED_STATUS_DISABLE = "statusLed";
200208
public static final String CHANNEL_LED_POWER_DISABLE = "powerLed";
@@ -254,6 +262,8 @@ public class ShellyBindingConstants {
254262
public static final int DIGITS_TEMP = 1;
255263
public static final int DIGITS_LUX = 0;
256264
public static final int DIGITS_PERCENT = 1;
265+
public static final int DIGITS_ROTATION = 1;
266+
public static final int DIGITS_DISTANCE = 0;
257267

258268
public static final int SHELLY_API_TIMEOUT_MS = 10000;
259269
public static final int UPDATE_STATUS_INTERVAL_SECONDS = 3; // check for updates every x sec

0 commit comments

Comments
 (0)