Skip to content

Commit 8ea703e

Browse files
authored
[wiz] Correct units for RSSI (openhab#17867)
Number:Power of dBm, instead of Number:Dimensionless of dB. Signed-off-by: Cody Cutrer <[email protected]>
1 parent 91d6b62 commit 8ea703e

File tree

3 files changed

+74
-2
lines changed

3 files changed

+74
-2
lines changed

bundles/org.openhab.binding.wiz/src/main/java/org/openhab/binding/wiz/internal/handler/WizHandler.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -592,7 +592,7 @@ private synchronized void updateStatesFromParams(final WizSyncState receivedPara
592592
strength = 4;
593593
}
594594
updateDeviceState(CHANNEL_SIGNAL_STRENGTH, new DecimalType(strength));
595-
updateDeviceState(CHANNEL_RSSI, new QuantityType<>(receivedParam.rssi, Units.DECIBEL));
595+
updateDeviceState(CHANNEL_RSSI, new QuantityType<>(receivedParam.rssi, Units.DECIBEL_MILLIWATTS));
596596
}
597597
}
598598

bundles/org.openhab.binding.wiz/src/main/resources/OH-INF/thing/thing-types.xml

+19-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
<channel id="last-update" typeId="last-update"/>
1818
<channel id="rssi" typeId="rssi"/>
1919
</channels>
20+
<properties>
21+
<property name="thingTypeVersion">1</property>
22+
</properties>
2023
<config-description-ref uri="thing-type:wiz:device"/>
2124
</thing-type>
2225

@@ -34,6 +37,9 @@
3437
<channel id="last-update" typeId="last-update"/>
3538
<channel id="rssi" typeId="rssi"/>
3639
</channels>
40+
<properties>
41+
<property name="thingTypeVersion">1</property>
42+
</properties>
3743
<config-description-ref uri="thing-type:wiz:device"/>
3844
</thing-type>
3945

@@ -49,6 +55,9 @@
4955
<channel id="last-update" typeId="last-update"/>
5056
<channel id="rssi" typeId="rssi"/>
5157
</channels>
58+
<properties>
59+
<property name="thingTypeVersion">1</property>
60+
</properties>
5261
<config-description-ref uri="thing-type:wiz:device"/>
5362
</thing-type>
5463

@@ -62,6 +71,9 @@
6271
<channel id="last-update" typeId="last-update"/>
6372
<channel id="rssi" typeId="rssi"/>
6473
</channels>
74+
<properties>
75+
<property name="thingTypeVersion">1</property>
76+
</properties>
6577
<config-description-ref uri="thing-type:wiz:device"/>
6678
</thing-type>
6779

@@ -78,6 +90,9 @@
7890
<channel id="last-update" typeId="last-update"/>
7991
<channel id="rssi" typeId="rssi"/>
8092
</channels>
93+
<properties>
94+
<property name="thingTypeVersion">1</property>
95+
</properties>
8196
<config-description-ref uri="thing-type:wiz:device"/>
8297
</thing-type>
8398

@@ -90,6 +105,9 @@
90105
<channel-group id="light" typeId="dimmable-light"/>
91106
<channel-group id="fan" typeId="fan-group"/>
92107
</channel-groups>
108+
<properties>
109+
<property name="thingTypeVersion">1</property>
110+
</properties>
93111
<config-description-ref uri="thing-type:wiz:device"/>
94112
</thing-type>
95113

@@ -185,7 +203,7 @@
185203
</channel-type>
186204

187205
<channel-type id="rssi" advanced="true">
188-
<item-type unitHint="dB">Number:Dimensionless</item-type>
206+
<item-type unitHint="dBm">Number:Power</item-type>
189207
<label>RSSI</label>
190208
<description>WiFi Received Signal Strength Indicator</description>
191209
<category>QualityOfService</category>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
2+
<update:update-descriptions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xmlns:update="https://openhab.org/schemas/update-description/v1.0.0"
4+
xsi:schemaLocation="https://openhab.org/schemas/update-description/v1.0.0 https://openhab.org/schemas/update-description-1.0.0.xsd">
5+
6+
<thing-type uid="wiz:color-bulb">
7+
<instruction-set targetVersion="1">
8+
<update-channel id="rssi">
9+
<type>wiz:rssi</type>
10+
</update-channel>
11+
</instruction-set>
12+
</thing-type>
13+
14+
<thing-type uid="wiz:tunable-bulb">
15+
<instruction-set targetVersion="1">
16+
<update-channel id="rssi">
17+
<type>wiz:rssi</type>
18+
</update-channel>
19+
</instruction-set>
20+
</thing-type>
21+
22+
<thing-type uid="wiz:dimmable-bulb">
23+
<instruction-set targetVersion="1">
24+
<update-channel id="rssi">
25+
<type>wiz:rssi</type>
26+
</update-channel>
27+
</instruction-set>
28+
</thing-type>
29+
30+
<thing-type uid="wiz:plug">
31+
<instruction-set targetVersion="1">
32+
<update-channel id="rssi">
33+
<type>wiz:rssi</type>
34+
</update-channel>
35+
</instruction-set>
36+
</thing-type>
37+
38+
<thing-type uid="wiz:fan">
39+
<instruction-set targetVersion="1">
40+
<update-channel id="rssi">
41+
<type>wiz:rssi</type>
42+
</update-channel>
43+
</instruction-set>
44+
</thing-type>
45+
46+
<thing-type uid="wiz:fan-with-dimmable-bulb">
47+
<instruction-set targetVersion="1">
48+
<update-channel id="rssi">
49+
<type>wiz:rssi</type>
50+
</update-channel>
51+
</instruction-set>
52+
</thing-type>
53+
54+
</update:update-descriptions>

0 commit comments

Comments
 (0)