[Release] Third Reality Soil Moisture Sensor

Third Reality Soil Moisture Sensor

Link to code

Introduction

The Third Reality Soil Moisture Sensor driver enables seamless integration of the Third Reality Soil Moisture Sensor with your Hubitat smart home system. This driver allows you to monitor soil moisture levels, temperature, and battery status, ensuring optimal conditions for your plants. With easy installation and customizable settings, you can keep your garden thriving all year round.

Description

This driver supports the following capabilities:

  • Battery Status: Monitors the battery level of the sensor.
  • Temperature Measurement: Reports the ambient temperature in Fahrenheit.
  • Soil Moisture Measurement: Provides real-time readings of soil moisture as a percentage.
  • Configuration: Allows you to set reporting intervals and enable debug logging for troubleshooting.

The sensor communicates via Zigbee and is designed for easy installation and configuration, making it a perfect choice for gardeners and plant enthusiasts.

Key Features:

  • Custom attribute for soil moisture measurement
  • Adjustable reporting intervals
  • Debug logging options for enhanced troubleshooting
  • Simple configuration for reliable performance

Installation Instructions

Step 1: Install the Driver

  1. Log into your Hubitat Dashboard.
  2. Navigate to Drivers Code under the Apps section.
  3. Click on New Driver.
  4. Copy the entire driver code provided above and paste it into the code editor.
  5. Click Save to create the driver.

Step 2: Add the Device

  1. Navigate to Devices in the Hubitat Dashboard.
  2. Click on Add Device.
  3. Select Zigbee as the device type.
  4. Choose Third Reality Soil Moisture Sensor from the list of available drivers.
  5. Follow the on-screen instructions to pair your soil moisture sensor with Hubitat.

Step 3: Configure the Device

  1. After pairing, go to the device page for your soil moisture sensor.
  2. Configure the settings as desired:
  • Enable debug logging (optional): This is useful for troubleshooting.
  • Set the Reporting Interval: Choose a reporting interval between 1 to 240 minutes.
  1. Click Save Preferences to apply the settings.

Step 4: Monitor and Enjoy

  • Monitor the temperature and soil moisture levels directly from the Hubitat dashboard.
  • Use the data to optimize your watering schedule and ensure your plants stay healthy!

If you encounter any issues, you can enable debug logging to gather more information about the device's performance. Happy gardening!

1 Like

When I attempt to install the driver, I get an error:

java.sql.SQLException: NULL not allowed for column "NAMESPACE"; SQL statement: INSERT INTO device_type (version, type, author, name, namespace, source_code_id, class_location, create_time, update_time, parent_app_type_id, category, single_threaded, source_url, source_password, bundled, homekit_compatible, firmware_version) VALUES (1, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [23502-224] Query: INSERT INTO device_type (version, type, author, name, namespace, source_code_id, class_location, create_time, update_time, parent_app_type_id, category, single_threaded, source_url, source_password, bundled, homekit_compatible, firmware_version) VALUES (1, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) Parameters: [usr, Echistas, Third Reality Soil Moisture Sensor, null, 503, null, Sat Oct 26 17:56:52 EDT 2024, Sat Oct 26 17:56:52 EDT 2024, null, null, false, null, , false, false, null]

even in beta release …197. I can’t find where the error occurs.

Thats really weird. I have 4 devices on this driver working no problem. did you have any driver installed prior to installing this one? if so, try removing the device from your hub and doing a fresh pair and driver install. remember to hit config after

also, mind posting your debug logs?

There appears to be no log; the error shown was thrown when I attempted to save the driver. Thus, the driver was never saved. I tried this on two C7s. One was running ...196, or whatever the latest released driver is.

I did the usual of pasting in the usual github driver RAW address to the Import function, which has always worked for other third-party drivers. The code loaded just fine, but the error was thrown when "Save" was clicked. Both C7s seemed to throw the same error, although I didn't carefully compare them, as the error is somewhat lengthy, and I was working from an iPad, which is difficult for diagnostics.

I have the same error when trying to save the driver after pasting in the raw code. This is on a C8-Pro.

The problem is on the definition line of the driver. This mod works:

definition(name: "Third Reality Soil Moisture Sensor", namespace: "yourNameSpace", author: "Echistas") {

The word "namespace" was mangled in the posted version.

5 Likes

Maybe not use "yourNameSpace" ... e.g.,

definition(name: "Third Reality Soil Moisture Sensor", namespace: "echistas", author: "Echistas") {

that shouldn't matter but thanks for catching it. I just corrected it

interesting. I had that mangled namespace and it caused no problems for me. I updated it though. thanks for catching it. I'm glad the driver is working for you now

Just received the sensor, paired up w/one of my hubs w/out issue, defaulted to your driver. :slight_smile:

Wondering one thing...how do I read the moisture levels...is it 9.8 out of 10, or 100, or ?

image

Thanks very much for the driver!

I received my sensor yesterday and was able to use the custom driver. From what I read from 3rd Reality, the moisture is on the scale of 0 to 100%. I have my sensor inserted in the soil in my flower bed. It’s currently reporting 12.4% moisture.

Thanks, that confirms what I found as well. :slight_smile:

Now just have to figure out what % our plants want by trial and error, I assume. Did test results after watering and the moisture reading changed as expected.

Hey, FYI to everyone using this plugin:

Hubitat added a driver for this in a recent update so I will be retiring my driver. Their driver is slight better in that they properly mapped the attribute to "humidity" vs. "soil humidity".

Why does this matter? well, it doesn't - unless you are mirroring your devices in HomeKit. my driver only allows you to mirror temperature to HomeKit. but the hubitat driver that came with the last update allows you to mirror both humidity as well as temperature. I could add that to my driver but it's not worth it since Hubitat already took care of this for us.

I'm glad you all found this driver useful! I would recommend moving over to the built-in driver that Hubitat recently provided given that your hub has received the latest updates.

also: chatgpt is a great way to determine what soil moisture requirement your plant requires. usually its around 27-30% for most plants. succulents like to have very dry soil before re-watering. I let succulents go down to about 10% and then add water to around 30% until it drops again. most other plants I maintain 27-30% as the low and 45% as the high. they seem very happy so far

I have a fully automated watering solution that spans my entire home inside and out. all on Hubitat using zigbee devices. if anyone would like to see how I did this, let me know and I can share. I was in the middle of a remodel and so I had water valves installed in key locations throughout my home. from there I bought some solenoids typically used for RO filtration systems. connected those to zigbee plugs, and with the soil sensors was able to combine everything into an automated solution. I also have emergency drainage as well as physical and zigbe leak detection in case of leaks. Finally, I have a zigbee valve connected to my main water lines in case things go sour. took about 2 years to get everything properly set up. working very well now. I plan to do this with a freshwater aquarium as well in the future. The only thing that could make this better would be to get my U-Moen showers on Hubitat. that way if there is a leak. I can trigger the showers to drain the pipes after the main valve is closed. otherwise all the water in the pipes would drain via gravity after the valve is closed. that is the only missing piece to my super amazing plant watering system lol if anyone can get U by Moon shower in Hubitat (not via HomeKit virtual switches) I would be forever grateful and send you a prize :slight_smile:

3 Likes

Thanks for pointing this out...was setting up a notification today on this sensor, and noticed it wasn't showing up in the Notifications app...figured something like this was happening and switched over to the HE app as you suggested and it's showing up now.

Thanks for your original work on your driver and the pointers... :smiley:

1 Like

Has anyone compared the readings from this device to the Ecowit Soil sensor? I have been using the latter for about 1 year and just got 2 of the Third Reality sensors. I put both these new sensors in along side one of the Ecowitt sensors and the numbers arent remotely close. After watering, the Third sensors read 89 and 94% while the Eco reads 43%. This wide/differing range in both types of sensors was similar before the plant was dry. I will be curious to see how the numbers differ as this plant dries out.

Hey,

Not a good idea to put them alongside each other. They will interfere and produce odd results

I did do the comparison

I learned that they produce same readings (more or less; the difference is negligible and who knows which is more accurate)

What is worth noting though is that the thirdreality sensor takes longer to produce an accurate result. But once it is in place, it seems to provide accurate and reliable readings.

It just takes longer for the reading to stabilize and adjust to the accurate number vs Ecowitt which produces the accurate reading much more quickly.

For my use case, this is not an issue.

I imagine it’s only an issue if you are removing and replacing the sensor to pull quick readings from different areas (which is not good for the sensor and we shouldnt be doing anyway)

2 Likes

Just a greenhouse observation to share:

90F 33% afternoon day #1
35F 42% morning day #2

The soil moisture (humidity) reading on these 3rd Reality devices seems to be affected by ambient temperature even tho the probe is well into the soil and I know the soil isn't changing that much to that depth. This cycle is regular every day.

So just to underline what was said elsewhere....these numbers may be best looked at in bands. I'm still observing to work that out...but I would bet you have to see at least 15-20% increments to be meaningful.

Would love to see if we can get some agreement on a general band model. Sure it's going to depend on soil type...but maybe we can't derive some useful breakpoints.

For example:

               Soil Moisture Condition

00-20% Very Dry
20-40% Dry side
40-60% Moderate ( optimal range for most non-tropical plants? )
60-80% Moist side
80-100% Very Moist (just watered)

I have NOT collected enough data to suggest these are right. I don't think I have seen anything over 70% but I haven't been observing long. My initial feeling is that they are too finely defined (hopeful).

In reality we may be dealing with something like:

0-33% Soil needs water for most plants (excluding arid climate plants)
33-66% Plenty of soil water available for uptake for most plants
66-100% Retaining too much soil water for most plants (or just watered)

EDIT ADD to rework the model:
Starting to believe the whole scale needs to shift down from any of the above, absurdly biased to the bottom half of the 0-100% scale.

0-30% "dry-ish" might be a viable low band
30-60% "adequate" might be a viable middle band
60-100% "wet" [putting this here even tho I've yet to see a number over 60%]

Agree...we water until we get well over 50%, and don't water until we're well under 25%, and that has worked well. I see these as a way to get automated "Hey, a plant might need watering" notifications. :wink: