I still can’t get this to work for me to detect UNDEF. I see these lines, shouldn’t UNDEF == UnDefType? I’m missing something obvious, but I don’t know what it is. Should the Operator be ‘===’?
Version is 1.3, OH is on 4.2.2.
2024-11-10 08:28:01.244 [DEBUG] [tReporting.OutsideTemperatureBattery] - Checking if we are in the alerting state: UNDEF == UnDefType
2024-11-10 08:28:01.244 [DEBUG] [tReporting.OutsideTemperatureBattery] - Result is false
Set up is here:
2024-11-08 15:11:48.990 [INFO ] [.Threshold Alert.BatteryNotReporting] - Rule triggered without an Item event, ExecutionEvent checking the rule config
2024-11-08 15:11:49.043 [INFO ] [.Threshold Alert.BatteryNotReporting] - Threshold Alert configs check out as OK
2024-11-08 15:12:32.467 [DEBUG] [.Threshold Alert.BatteryNotReporting] - Starting threshold alert
2024-11-08 15:12:32.468 [INFO ] [.Threshold Alert.BatteryNotReporting] - Rule triggered without an Item event, ExecutionEvent checking the rule config
2024-11-08 15:12:32.469 [DEBUG] [.Threshold Alert.BatteryNotReporting] - Rule config defaults:
Group - gBatteryLevel
Threhsold - UnDefType
Operator - ==
Invert Operator - false
Reschedule - false
Default Alert Delay - PT10S
Default Reminder Duration - PT24H
DND Start - 00:00
DND End - 00:00
Alert Rule - NotifySensorBatteryNotReporting
End Alert Rule -
Alert Group - gBatteryLevel
Alert Items - IndoorAqaraTemperatureHumidityPressureSensor_BatteryLevel, Living_Room2_PIR_Battery, OutsideTemperatureBattery, Outdoor_Sensor_Battery, HWHeaterSensorBattery, Kitchen_ZigBee_SNZB03P_Battery_Level, IndoorTemperatureSNZB02PBatteryLevel, ZigbeeTemperature1BatteryLevel, FrontDoorInsideMotionSensorBatteryLevel, SecondBathTubMotionBatteryLevel, Front_Door_Outside_PIR_Battery, MasterBathSensorBatteryLevel, WashingMachineLidBattery, Living_Room_PIR_Battery, HallSensorBatteryLevel, ZigbeeTemp2_Battery_Level, SecondBathTubDoorBattery, Garage_Temperature_Sensor_Battery, MasterBathDoorBattery, Leak_Sensor_Battery_Level, AtticHeatPumpXiaomiAqaraWaterLeakSensor_BatteryLevel, HalfBathBatteryLevel, MBDRMClosetMotionSensorBatteryLevel, Garage_Door_Sensor_Battery, TuyaZigbeeWaterSensorBatteryLevel
Gatekeeper Delay - 0
Rate Limit -
2024-11-08 15:12:32.470 [INFO ] [.Threshold Alert.BatteryNotReporting] - Cancelling any running timers
2024-11-08 15:12:32.470 [INFO ] [.Threshold Alert.BatteryNotReporting] - Threshold is UnDefType, this will cause Item states of NULL and UNDEF to be converted to UnDefType for comparisons.
2024-11-08 15:12:32.478 [INFO ] [.Threshold Alert.BatteryNotReporting] - No end alert rule configured, no rule will be called when alerting ends
2024-11-08 15:12:32.478 [INFO ] [.Threshold Alert.BatteryNotReporting] - No initial alert rule configured, no rule will be called when the alert state is first detected
2024-11-08 15:12:32.496 [INFO ] [.Threshold Alert.BatteryNotReporting] - These Items do not have thresholdAlert metadata and will use the default properties defined in the rule: IndoorAqaraTemperatureHumidityPressureSensor_BatteryLevel, Living_Room2_PIR_Battery, OutsideTemperatureBattery, Outdoor_Sensor_Battery, HWHeaterSensorBattery, Kitchen_ZigBee_SNZB03P_Battery_Level, IndoorTemperatureSNZB02PBatteryLevel, ZigbeeTemperature1BatteryLevel, FrontDoorInsideMotionSensorBatteryLevel, SecondBathTubMotionBatteryLevel, Front_Door_Outside_PIR_Battery, MasterBathSensorBatteryLevel, WashingMachineLidBattery, Living_Room_PIR_Battery, HallSensorBatteryLevel, ZigbeeTemp2_Battery_Level, SecondBathTubDoorBattery, Garage_Temperature_Sensor_Battery, MasterBathDoorBattery, Leak_Sensor_Battery_Level, AtticHeatPumpXiaomiAqaraWaterLeakSensor_BatteryLevel, HalfBathBatteryLevel, MBDRMClosetMotionSensorBatteryLevel, Garage_Door_Sensor_Battery, TuyaZigbeeWaterSensorBatteryLevel
Full debug log is here:
2024-11-10 08:28:01.229 [DEBUG] [.Threshold Alert.BatteryNotReporting] - Starting threshold alert
2024-11-10 08:28:01.231 [DEBUG] [tReporting.OutsideTemperatureBattery] - Processing an Item event
2024-11-10 08:28:01.232 [DEBUG] [tReporting.OutsideTemperatureBattery] - Processing state UNDEF of type object
2024-11-10 08:28:01.233 [DEBUG] [tReporting.OutsideTemperatureBattery] - Not numeric, leaving as a string: UNDEF
2024-11-10 08:28:01.233 [DEBUG] [tReporting.OutsideTemperatureBattery] - Processing state UNDEF from OutsideTemperatureBattery
2024-11-10 08:28:01.234 [DEBUG] [tReporting.OutsideTemperatureBattery] - Populating record from Item metadata or rule defauls
2024-11-10 08:28:01.238 [DEBUG] [tReporting.OutsideTemperatureBattery] - Converting threshold to value
2024-11-10 08:28:01.238 [DEBUG] [tReporting.OutsideTemperatureBattery] - Processing state UnDefType of type string
2024-11-10 08:28:01.239 [DEBUG] [tReporting.OutsideTemperatureBattery] - state is a string: UnDefType
2024-11-10 08:28:01.239 [DEBUG] [tReporting.OutsideTemperatureBattery] - state is an undef type, normalizing to UnDefType
2024-11-10 08:28:01.240 [DEBUG] [tReporting.OutsideTemperatureBattery] - Converting hysteresis to value
2024-11-10 08:28:01.241 [DEBUG] [tReporting.OutsideTemperatureBattery] - Processing state of type string
2024-11-10 08:28:01.241 [DEBUG] [tReporting.OutsideTemperatureBattery] - state is a string:
2024-11-10 08:28:01.242 [DEBUG] [tReporting.OutsideTemperatureBattery] - state is the empty string, no conversion possible
2024-11-10 08:28:01.243 [DEBUG] [tReporting.OutsideTemperatureBattery] - Processing event for Item OutsideTemperatureBattery with properties:
Threshold - UnDefType
Operator - ==
Invert - false
Reschedule - false
Alert Delay - PT10S
Reminder Period - PT24H
Alert Rule ID - NotifySensorBatteryNotReporting
End Alert Rule ID -
Init Alert Rule ID -
Gatekeeper Delay - 0
Hystersis -
Rate Limt -
DnD Start - 00:00
DnD End - 00:00
2024-11-10 08:28:01.244 [DEBUG] [tReporting.OutsideTemperatureBattery] - Checking if we are in the alerting state: UNDEF == UnDefType
2024-11-10 08:28:01.244 [DEBUG] [tReporting.OutsideTemperatureBattery] - Result is false
2024-11-10 08:28:01.245 [DEBUG] [tReporting.OutsideTemperatureBattery] - OutsideTemperatureBattery's new state is UNDEF which is no longer in the alerting state, previously alerted = false
2024-11-10 08:28:01.246 [DEBUG] [tReporting.OutsideTemperatureBattery] - Exiting alerting state but alert was never sent, not sending an end alert for OutsideTemperatureBattery