I reinstalled and reloaded with no change.
So, I then decided to put Copilot to work. There were two sections of code that it wanted me to update.
Here are the updated code sections.
def updateStandardDeviceStatus(child, Map data) {
def blindTypes = getBlindTypes()
def operationTypes = getOperationTypes()
def currentStates = getCurrentStates()
def voltageModes = getVoltageModes()
def wirelessModes = getWirelessModes()
// --- POSITION ---
if (data.currentPosition != null) {
def bridgePos = data.currentPosition as Integer
def hubitatLevel = 100 - bridgePos
def currentLevel = child.currentValue("level")
if (currentLevel != hubitatLevel) {
child.sendEvent(name: "level", value: hubitatLevel)
}
def shadeValue = (hubitatLevel == 100) ? "open" :
(hubitatLevel == 0) ? "closed" :
"partially open"
if (child.currentValue("windowShade") != shadeValue) {
child.sendEvent(name: "windowShade", value: shadeValue)
}
}
// --- ANGLE ---
if (data.currentAngle != null) {
child.sendEvent(name: "angle", value: data.currentAngle as Integer)
}
// --- BLIND TYPE ---
if (data.type != null) {
def blindName = blindTypes[data.type] ?: "Unknown"
child.updateDataValue("blindType", data.type.toString())
child.updateDataValue("blindTypeName", blindName)
}
// --- OPERATION ---
if (data.operation != null) {
child.sendEvent(name: "operation", value: operationTypes[data.operation] ?: data.operation)
}
// --- LIMIT STATE ---
if (data.currentState != null) {
child.sendEvent(name: "limitState", value: currentStates[data.currentState] ?: data.currentState)
}
// --- VOLTAGE MODE ---
if (data.voltageMode != null) {
def voltageModeName = voltageModes[data.voltageMode] ?: "Unknown"
child.updateDataValue("voltageMode", data.voltageMode.toString())
child.updateDataValue("voltageModeName", voltageModeName)
}
// --- BATTERY ---
if (data.batteryLevel != null) {
def batteryLevelVal = data.batteryLevel as Integer
child.sendEvent(name: "batteryLevel", value: batteryLevelVal)
def batteryPercent = Math.min(100, Math.max(0,
(((batteryLevelVal - 700) as double) / 150.0 * 100) as Integer
))
child.sendEvent(name: "battery", value: batteryPercent)
}
// --- CHARGING ---
if (data.chargingState != null) {
def isCharging = (data.chargingState == 1)
child.sendEvent(name: "chargingState", value: isCharging ? "charging" : "not charging")
}
// --- WIRELESS MODE ---
if (data.wirelessMode != null) {
def wirelessModeName = wirelessModes[data.wirelessMode] ?: "Unknown"
child.updateDataValue("wirelessMode", data.wirelessMode.toString())
child.updateDataValue("wirelessModeName", wirelessModeName)
child.updateDataValue("isBiDirectional", (data.wirelessMode == 1) ? "true" : "false")
}
// --- RSSI ---
if (data.RSSI != null) {
child.sendEvent(name: "rssi", value: data.RSSI)
}
}
def updateTDBUDeviceStatus(child, Map data) {
def operationTypes = getOperationTypes()
def currentStates = getCurrentStates()
// --- TOP POSITION ---
if (data.currentPosition_T != null) {
def bridgePosTop = data.currentPosition_T as Integer
def hubitatTop = 100 - bridgePosTop
child.sendEvent(name: "levelTop", value: hubitatTop)
}
// --- BOTTOM POSITION ---
if (data.currentPosition_B != null) {
def bridgePosBottom = data.currentPosition_B as Integer
def hubitatBottom = 100 - bridgePosBottom
child.sendEvent(name: "levelBottom", value: hubitatBottom)
def shadeValue = (hubitatBottom == 100) ? "open" :
(hubitatBottom == 0) ? "closed" :
"partially open"
child.sendEvent(name: "windowShade", value: shadeValue)
}
// --- AVERAGE LEVEL ---
if (data.currentPosition_T != null && data.currentPosition_B != null) {
def hubitatTop = 100 - (data.currentPosition_T as Integer)
def hubitatBottom = 100 - (data.currentPosition_B as Integer)
def avgPos = ((hubitatTop + hubitatBottom) / 2) as Integer
child.sendEvent(name: "level", value: avgPos)
}
// --- OPERATIONS ---
if (data.operation_T != null) {
child.sendEvent(name: "operationTop", value: operationTypes[data.operation_T] ?: data.operation_T)
}
if (data.operation_B != null) {
child.sendEvent(name: "operationBottom", value: operationTypes[data.operation_B] ?: data.operation_B)
}
// --- LIMIT STATES ---
if (data.currentState_T != null) {
child.sendEvent(name: "limitStateTop", value: currentStates[data.currentState_T] ?: data.currentState_T)
}
if (data.currentState_B != null) {
child.sendEvent(name: "limitStateBottom", value: currentStates[data.currentState_B] ?: data.currentState_B)
}
// --- BATTERY ---
if (data.batteryLevel_T != null) {
child.sendEvent(name: "batteryLevelTop", value: data.batteryLevel_T)
}
if (data.batteryLevel_B != null) {
child.sendEvent(name: "batteryLevelBottom", value: data.batteryLevel_B)
}
// --- RSSI ---
if (data.RSSI != null) {
child.sendEvent(name: "rssi", value: data.RSSI)
}
child.updateDataValue("isTDBU", "true")
child.updateDataValue("blindType", "9")
child.updateDataValue("blindTypeName", "TDBU")
}
What this update accomplishes
Prevents all Integer#minus crashes
Because no subtraction happens unless the field exists.
Works with partial ReadDeviceAck packets
Your logs show the bridge often sends:
{"type":1,"operation":1,"wirelessMode":0}
These updated methods handle that gracefully.
No behavior changes
All your existing logic stays intact — just safer.