#### Thing Configuration for PowerView Repeaters
-
| Configuration Parameter | Description |
|-------------------------|-------------|
| id | The ID of the PowerView repeater in the app. Must be an integer. |
| batteryLevel | Number | Battery level (10% = low, 50% = medium, 100% = high)
| batteryVoltage | Number:ElectricPotential | Battery voltage reported by the shade. |
| signalStrength | Number | Signal strength (0 for no or unknown signal, 1 for weak, 2 for average, 3 for good or 4 for excellent) |
+| hubRssi | Number:Power | Received Signal Strength Indicator for Hub |
+| repeaterRssi | Number:Power | Received Signal Strength Indicator for Repeater |
+
+Please note that RSSI values will only be updated upon manual request by a `REFRESH` command (e.g. in a rule).
### Channels for Repeaters (Thing type `repeater`)
| batteryLevel | Battery |
| batteryVoltage | Battery |
| signalStrength | Survey |
+| hubRssi | Survey |
+| repeaterRssi | Survey |
## Full Example
public static final String CHANNEL_SHADE_BATTERY_LEVEL = "batteryLevel";
public static final String CHANNEL_SHADE_BATTERY_VOLTAGE = "batteryVoltage";
public static final String CHANNEL_SHADE_SIGNAL_STRENGTH = "signalStrength";
+ public static final String CHANNEL_SHADE_HUB_RSSI = "hubRssi";
+ public static final String CHANNEL_SHADE_REPEATER_RSSI = "repeaterRssi";
public static final String CHANNEL_REPEATER_COLOR = "color";
public static final String CHANNEL_REPEATER_BRIGHTNESS = "brightness";
requestRefreshShadeBatteryLevel();
break;
case CHANNEL_SHADE_SIGNAL_STRENGTH:
+ case CHANNEL_SHADE_HUB_RSSI:
+ case CHANNEL_SHADE_REPEATER_RSSI:
requestRefreshShadeSurvey();
break;
}
surveyData.forEach(data -> joiner.add(data.toString()));
logger.debug("Survey response for shade {}: {}", shadeId, joiner.toString());
}
+
+ int hubRssi = Integer.MAX_VALUE;
+ int repeaterRssi = Integer.MAX_VALUE;
+ for (SurveyData survey : surveyData) {
+ if (survey.neighborId == 0) {
+ hubRssi = survey.rssi;
+ } else {
+ repeaterRssi = survey.rssi;
+ }
+ }
+ updateState(CHANNEL_SHADE_HUB_RSSI, hubRssi == Integer.MAX_VALUE ? UnDefType.UNDEF
+ : new QuantityType<>(hubRssi, Units.DECIBEL_MILLIWATTS));
+ updateState(CHANNEL_SHADE_REPEATER_RSSI, repeaterRssi == Integer.MAX_VALUE ? UnDefType.UNDEF
+ : new QuantityType<>(repeaterRssi, Units.DECIBEL_MILLIWATTS));
+
shadeData = webTargets.getShade(shadeId);
updateSignalStrengthState(shadeData.signalStrength);
} else {
logger.info("No data from shade {} survey", shadeId);
/*
- * Setting channel to UNDEF here would be reverted on next poll, since
- * signal strength is part of shade response. So leaving current value,
+ * Setting signal strength channel to UNDEF here would be reverted on next poll,
+ * since signal strength is part of shade response. So leaving current value,
* even though refreshing the value failed.
*/
+ updateState(CHANNEL_SHADE_HUB_RSSI, UnDefType.UNDEF);
+ updateState(CHANNEL_SHADE_REPEATER_RSSI, UnDefType.UNDEF);
}
break;
case BATTERY_LEVEL:
} else {
logger.warn("Bridge returned a bad JSON response: {} -> {}", e.getMessage(), cause.getMessage());
}
+ // Survey calls are unreliable and often returns "{}" as payload. For repeater RSSI tracking to be useful,
+ // we need to reset channels also in this case.
+ if (kind == RefreshKind.SURVEY) {
+ updateState(CHANNEL_SHADE_HUB_RSSI, UnDefType.UNDEF);
+ updateState(CHANNEL_SHADE_REPEATER_RSSI, UnDefType.UNDEF);
+ }
} catch (HubMaintenanceException e) {
// exceptions are logged in HDPowerViewWebTargets
} catch (HubShadeTimeoutException e) {
thing-type.hdpowerview.repeater.channel.color.description = Controls the color of the LED ring
thing-type.hdpowerview.shade.label = PowerView Shade
thing-type.hdpowerview.shade.description = Hunter Douglas (Luxaflex) PowerView Shade
+thing-type.hdpowerview.shade.channel.hubRssi.label = Hub RSSI
+thing-type.hdpowerview.shade.channel.hubRssi.description = Received Signal Strength Indicator for Hub
+thing-type.hdpowerview.shade.channel.repeaterRssi.label = Repeater RSSI
+thing-type.hdpowerview.shade.channel.repeaterRssi.description = Received Signal Strength Indicator for Repeater
thing-type.hdpowerview.shade.channel.secondary.label = Secondary Position
thing-type.hdpowerview.shade.channel.secondary.description = The secondary vertical position (on top-down/bottom-up shades)
channel-type.hdpowerview.repeater-identify.label = Identify
channel-type.hdpowerview.repeater-identify.description = Flash repeater to identify
channel-type.hdpowerview.repeater-identify.command.option.IDENTIFY = Identify
+channel-type.hdpowerview.rssi.label = RSSI
+channel-type.hdpowerview.rssi.description = Received Signal Strength Indicator
channel-type.hdpowerview.scene-activate.label = Activate
channel-type.hdpowerview.scene-group-activate.label = Activate
channel-type.hdpowerview.shade-command.label = Command
<state pattern="%.1f %unit%" readOnly="true"/>
</channel-type>
+ <channel-type id="rssi" advanced="true">
+ <item-type>Number:Power</item-type>
+ <label>RSSI</label>
+ <description>Received Signal Strength Indicator</description>
+ <category>QualityOfService</category>
+ <state readOnly="true" pattern="%d %unit%"></state>
+ </channel-type>
+
<channel-type id="repeater-identify">
<item-type>String</item-type>
<label>Identify</label>
<channel id="batteryLevel" typeId="system.battery-level"/>
<channel id="batteryVoltage" typeId="battery-voltage"/>
<channel id="signalStrength" typeId="system.signal-strength"/>
+ <channel id="hubRssi" typeId="rssi">
+ <label>Hub RSSI</label>
+ <description>Received Signal Strength Indicator for Hub</description>
+ </channel>
+ <channel id="repeaterRssi" typeId="rssi">
+ <label>Repeater RSSI</label>
+ <description>Received Signal Strength Indicator for Repeater</description>
+ </channel>
</channels>
<properties>