signal = state.rssi
if (signal < -30) {
sendEvent(name: "rssi", value: "Excellent", isStateChange: true);
} else
if (signal > -67) {
sendEvent(name: "rssi", value: "Good", isStateChange: true);
} else
if (signal > -70) {
sendEvent(name: "rssi", value: "Poor", isStateChange: true);
} else {
sendEvent(name: "rssi", value: "Weak", isStateChange: true);
}
NM I got it....
/*
-30 dBm Excellent | -67 dBm Good | -70 dBm Poor | -80 dBm Weak | -90 dBm Dead
*/
signal = state.rssi
if (signal <= 0 && signal >= -70) {
sendEvent(name: "rssi", value: "Excellent", isStateChange: true);
} else
if (signal < -70 && signal >= -80) {
sendEvent(name: "rssi", value: "Good", isStateChange: true);
} else
if (signal < -80 && signal >= -90) {
sendEvent(name: "rssi", value: "Poor", isStateChange: true);
} else
if (signal < -90 && signal >= -100) {
sendEvent(name: "rssi", value: "Weak", isStateChange: true);
}
Hard to say if you don't say exactly what is going wrong, but the only thing I see is that you quite likely meant > -30
and not< -30
.
EDIT: Or nevermind, you got it.
.
1 Like
Ya that was one mistake... I wrote it better which really works good now.