[PROJECT] Driver for Ambient API/Local and Ecowitt

Mind sharing what the sensor is and the battery reading? The potential values for those (especially the Ecowitt ones) are a big question mark for me. So I at least want to note it in the comments for my reference.

Sure, right now it's detecting a low batter on "Sensor 3" one of my Ecowitt WH31 sensors. In the Ecowitt app it shows the low battery indicator. The child sensor shows "battery : 1" The parent device is showing "batt3 : 1.4". What's interesting is "Sensor 4" also shows "batt4 : 1.4" on the parent, but "battery : 0" on the child and the Ecowitt app also shows the battery as good on sensor 4. So, your code is doing the right thing, even though the value of "1.4" is show on both. Other devices in the parent are showing like "batt1 : 0" and correctly show the battery as good.

Right now the battery on both my soil moisture sensors are good, so nothing to report there.

Is this what you are looking for?

Parent:


Sensor 3 (Ecowitt app shows low battery):
Sensor3
Sensor 4 (Ecowitt app shows good battery):
Screen Shot 2020-04-30 at 10.00.14 AM

One other thing to note is the funny character showing up just before the "degree" symbol in the dashboard. It may not be related to anything you did, but I thought I would mention it.

Screen Shot 2020-04-30 at 10.10.14 AM

Yes, that weird symbol cropped up because my web server was not opening the file with the correct formatting... But it could not even SHOW the characters it was inserting into the file! It took me forever to realize I now have to edit all these files in a different format.

Version 0.03 is now posted for the AmbientEcowittWeather.groovy (no changes to the child). This corrected misreporting by soil sensor batteries (they were overlapping with normal sensor battery values) as well as cleaned out the weird character.

Strange character is now gone. Soil moisture monitors are now reporting battery state. :+1:

Thank goodness for simple (if annoying) fixes.

Got a soil sensor today... but have not gotten my GW1000 set. Not sure how the soil sensor arrived, it was scheduled to be 2 weeks out. :slight_smile:

A few days back, I updated to Version 99 of the AmbientWeather driver. I've been getting messages that that a newer version of the driver is available since the update. Several times I've repeated the process of importing, saving and refreshing the driver, but I get the same results indicating I'm on an older driver. Is it possible that the Version number wasn't updated when you made your last set of updates?

Thanks! Yes, 0.99 is the latest and it is that way in the version.xml the drivers check. The one you imported was 0.99, but I forgot to increment it in the refresh function (that still said 0.98) which was triggering the notice. Sorry about that. It is fixed now. If you want, importing it will solve that or you can change it in your copy of the driver code (probably only slightly faster than importing and refreshing).

@snell I have all the values coming in now from the WS-2902 and the GW1000. I noticed the batt1 sometimes reads the voltage correctly at 1.5 but it also goes to 0 and then back to 1.5. Is that normal?
Also batt2 is always at 0. Has not changed since I got this working. Batt1 and Batt2 are WH31B's.

Anything I am missing or not doing correctly? I am using your latest version. Also we had a rain level on the pws of .16 today. The value for dailyrainin shows 0. thanks

To be honest, I have no idea what is "normal" with the batteries for these devices. My GW1000 and other parts should arrive in the next couple days so I might be better suited to know after that... but for now, not sure. So I would say you are not doing anything wrong on your end at all.

Are you using the Ambient driver, or the AmbientEcowitt driver? I probably should have separated the thread, but I am sure I am going to have the AmbientEcowitt replace the Ambient in the long run.

As for the rain... I will have to take a look. Maybe it was treating it as an int and dropped the decimal... Not sure about that either, but I will try to have something tonight.

@razorwing if you have the ability to run netcat on another computer, you can point the GW1000 to that machine and dump out the parameters which are being sent. Then you can coordinate those with what the driver is doing. Additionally you can cross check with the Ecowitt app. I've found that the batteries report 0 or 1.4 and the driver does the right thing. If you would have caught me a day earlier I could have checked the rain while it was raining. Anyway, debugging what GW1000 actually sends will add a lot I think.

@snell Ok, thanks. I am using Ecowitt Local as the selection. I will watch for your reply on the battery issue once you get a chance to look at it. I wonder if the WH31B's being on different channels has anything to do with it. Just a thought.

I appreciate the reply but I have no clue what netcat is or how to use it. thanks anyway. :smiley:

It actually could. If they report back as the same field to the system (they both think of themselves 1) they would be overwriting each other. Do their other values show as correct?

Are you using the Child Devices option and are the values matching in their respective children?

@snell Yes it shows humidity1 and humidity2, temp1 and temp2 for the WH31B's. Not sure what you mean by child devices option? Are you talking about creating a virtual device for each?

No. If you use the new AmbientEcowittWeather driver, there is now an option for child devices to be generated.

So the main device would still show everything exactly as it is today, but you would also get child devices automatically added to it that show the values specifically reported for each of them. So, based on yours (at least from above) you would see at least 4 child devices:
"Indoor Station" (basically the base station)
"Outdoor Station" (your WS-2902)
"Sensor1" (should be the 1st WH31B)
"Sensor2" (should be the 2nd WH31B)

The benefit is things like temperature and humidity (and any other reported value) are set on each child device. So if you want them in the dashboard or Rules, it makes it easier because you can just select the child device to provide that specifically (instead of making a workaround because of the normal temp1 or humidity1 reporting).

I see version .99 of AmbientWeather as a driver. Wrong one?

Sorry, it was mentioned above, but the AmbientEcowittWeather.groovy is a whole new driver attempt (I wanted to make it clear it supported Ecowitt now).

For the child devices to work properly you also need to load the child device driver:
WeatherSensorChild.groovy

If you do not want the child devices, you do not need the second driver and with the option disabled in the Preferences it should act just like the 0.99 AmbientWeather.

@snell Sorry I must have missed it somewhere, a lot of posts to read. I have the driver loaded but my senior moments are getting the best of me. I see no child devices.

Huh... Ok, things to check (the thorough list in case anyone sees this in the future):

  1. The AmbientEcowittWeather.groovy driver has been added to your Drivers Code list.
  2. The WeatherSensorChild.groovy driver has been added to your Drivers Code list.
  3. The virtual device you use has AmbientEcowittWeather selected in the Type dropdown for the device.
  4. The "Enable Child Devices?" Preference is enabled and you have saved preferences.
  5. A refresh has occurred (or you manually select the Refresh command).
  6. You have refreshed the webpage for the virtual device (usually F5 in your browser, or the reload/refresh button provided). Child devices (and state variables, or new preferences if the driver is updated) are not automatically added to an already-open device display.

You should see the child devices added in the Device Details section as Component Devices.

If they do not show up... Please turn on the Debug Logging level, perform a refresh, and shoot me a capture of what the Logs show.

As a note for this feature (again, for general understanding), disabling the Child devices preference will automatically delete any child devices once the Preferences are saved. Plus they can be removed individually without problem, the driver will automatically re-add them on the next refresh. However, removing the child devices will obviously cause issues with any Rules made to use them.

1 Like