Xfinity door sensor as water sensor

Alright so I’ve searched the forums and I can’t find a solution for this. I’ve seen posts of others modifying door sensors to use as water sensors. I have no issues modifying the hardware but I can’t get the sensor to display the proper state. The device handlers I’ve found are for zwave sensors and when I use those the sensor gets stuck on checking status and doesn’t change. Xfinity uses Zigbee so I’m assuming this is the problem. I’ve found two water sensors that I can set it as but it shows wet when dry and dry when wet. Anyone have a solution for this? Any device handlers out the that I missed?

Nevermind I think I figured out a solution. I did a little more digging and found some code for an iris water sensor. Changed a few lines and it seems to do what I’m looking for.