Made a Water Leak Sensor

@michaelahess
That would definitely add a nice additional functionality to these devices. I tried it once with the existing modified DTH but it was an either or situation. So I have a bunch of extra magnets lying around. :smile:

1 Like

I’m confused about exactly how you are going to use this for a contact and water sensor, however when you want to raise a wet event you need to

result << createEvent(name: “water”, value: “wet”, isStateChange: true, descriptionText: desc)

and for dry…

result << createEvent(name: “water”, value: “dry”, isStateChange: true, descriptionText: desc)

Internal Magnetic Sensor = Open/Close for the valve
External Contacts = Water Sensor

Didn’t get to play around at lunch, hopefully tonight, seems I might need two modifications though, so the two switches are seen as one and the other, not both as one OR the other…

Can you see a difference between the two in the live log?

Put a bunch of logs in the parse method, you will figure it out.

I know you can in the device itself in the IDE, haven’t looked in Live Logging yet but will.

Here’s the logging using my modified DHT before changing anything:

Sensor Contact Closed:
NotificationReport: NotificationReport(event: 2, eventParameter: [], eventParametersLength: 0, notificationStatus: 255, notificationType:7, reserved61: 0, sequence: false, v1AlarmLevel: 0, v1AlarmType: 7, zensorNetSourceNodeId: 0)
SensorValueEvent: 0
[name:water, value:dry, descriptionText:Crawl Space Leak Sensor is dry, isStateChange:false, displayed:false, linkText:Crawl Space Leak Sensor]

Sensor Contact Open:
NotificationReport: NotificationReport(event: 2, eventParameter: [], eventParametersLength: 0, notificationStatus: 255, notificationType: 7, reserved61: 0, sequence: false, v1AlarmLevel: 255, v1AlarmType: 7, zensorNetSourceNodeId: 0)
SensorValueEvent: 255
[name:water, value:wet, descriptionText:Crawl Space Leak Sensor is wet, isStateChange:true, displayed:true, linkText:Crawl Space Leak Sensor]

Sensor External Contact Closed (Wet):
NotificationReport: NotificationReport(event: 254, eventParameter: [], eventParametersLength: 0, notificationStatus: 255, notificationType: 7, reserved61: 0, sequence: false, v1AlarmLevel: 0, v1AlarmType: 7, zensorNetSourceNodeId: 0)
SensorValueEvent: true
[[name:water, value:wet, descriptionText:Crawl Space Leak Sensor is wet, isStateChange:false, displayed:false, linkText:Crawl Space Leak Sensor]]

Sensor External Contact Open (Dry):
NotificationReport: NotificationReport(event: 254, eventParameter: [], eventParametersLength: 0, notificationStatus: 255, notificationType: 7, reserved61: 0, sequence: false, v1AlarmLevel: 255, v1AlarmType: 7, zensorNetSourceNodeId: 0)
SensorValueEvent: false
[[name:water, value:dry, descriptionText:Crawl Space Leak Sensor is dry, isStateChange:true, displayed:true, linkText:Crawl Space Leak Sensor]]

So now I’ll try to parse this into the DHT, expect many failures!

You need to make sure that the events that are caused by the magnetic sensor are…

[name:contact, value:open, ...]
[name:contact, value:close,. ...]

Any traction in creating that custom DH to utilize both internal for a water sensor and magnetic contact for external usage?

I actually gave up on this. I can’t program for sh*t and even though I was making what seemed like logical changes, they by and far, were not! :slight_smile:

Maybe someone else will suddenly feel the need for this, that’s better at DHT’s than me!

Well it seem like a good idea and a good use of a sensor with additional capabilities.

I’ll just stick to the original plan and just use this contact sensor as a water sensor.

Thanks!

Anyone figure out what the maximum length of wire is that you can use with this?

I’ve used a 2 meter long, 14ga wire without any issues. I haven’t tried anything longer though.

It works fine with 10’ of speaker wire.

I just noticed this topic so for future reference, tag the original developer and they’ll most likely be happy to help you out.

I wrote a modified version of this device handler that acts as a motion sensor and another that acts as a water sensor so I can easily modify the water sensor version to work as a contact sensor and water sensor.

Considering that my basement door is right next to my sump pump, the new handler will allow me to use one of my contact sensors for something else.

FYI, this will work with the Linear/GoControl sensor, but it won’t work with the Monoprice Door/Window sensor.

I just released a new device handler for the GoControl Contact Sensor that should provide all the functionality you’ve been looking for.

3 Likes

Has anybody had trouble lately with these reporting false wet? And then in order to reset it you have to bridge the contacts and then separate again.

Sweet.

Thanks! i’ll give it a shot and see if that all works.

Yes, but I’ve assumed it’s because they are sitting on my desk with all my other electronics.

Has anyone made a mat with two wires weave in it so it covers the entire bottom of the sink cabinet? I really want to have this.