[PROJECT] Driver for AmbientWeather API

OK everybody! I have a new driver put together. I ran it through the paces (with what I have at home now), but this is still the first version (0.01). This is a mostly reworked AmbientEcowittWeather.groovy driver! I massively reworked how it checked and posted data which made it a lot shorter and easier to manage.

But the big change... This one supports Child Devices! YES! Based on what @mircolino did, I learned something (yet again) and made it so it creates child devices as various sensor data is reported. This DOES require a child device driver... so if you want to use the feature, it is posted as WeatherSensorChild.groovy.

If you want to use the new driver without the child devices, you CAN! They are disabled by default and you do not even need the driver if you do not enable them. If you DO enable them and forgot to load the driver, you will get an error message in your log but everything else should work AS IS! Hoorah!

At this time I am not replacing the AmbientWeather driver... but this one is such an improvement (I think, and I hope you all do too) that it will likely be replaced eventually.

Anyways, please check the new driver out and let me know how you like it.

@snell I gave it a try, and it looks to be working great with the Ecowit GW1000 + other sensors. I will give it a more through look here in a bit.

Ok, after some further analysis:

  • it looks like we are missing the rain total for day, week, month, and year in the Outdoor Station though they show in the parent device
  • The values for humidity seem to be getting messed up starting at Sensor 3 when looking at the child device. The value for humidity on Sensor 3 seems to be coming from the Outdoor Station's humidity when looking at the child device. The humidity value for Sensor 4 seems to be the soil moisture from one of my soilhum4
  • It looks like it is not picking up the soil moisture sensors, which I think is where things start to go sideways.

I have a WS2902A, 8 temp/humidity sensors (WH31), and 2 soil moisture sensors (WH51) which seem to start at offset 3.

Let me know if you need more help. Happy to provide more info.

Here is the parent value for soilhum:

ParentSoilHum3

Here is the parent value for humidity3:
ParentSensor3

Here are the values on Sensor 3

Parent showing the values for Outdoor Station:
ParentOutdoorStation

Child Outdoor Station values:
OutdoorStation

Sorry, a couple more. The Outdoor Sensor does seem to have the wind direction as a number, but not as letters. Probably a future thing. :slight_smile:

On the Ecowitt WH51, I don't think soil has a soiltemp or soilhum, it only reports soilmoisture. If it helps, see the payload I posted above.

@snell If you throw this up on GitHub, I'd be happy to make PRs.

@OpenDave:
Thanks for the feedback! I did not put ALL the respective sensors onto the outdoor station, which is a lot of what you are seeing. As for the soil sensors... I had those working before so it must be an error I made in the new one. I will get those corrected and have a new version posted soon.

I avoid GitHub myself... which is why I reworked my website to be able to allow people to import drivers finally.

UPDATE:
Version 0.02 is now posted. This version should publish EVERY value to their respective child sensor. You will need to upgrade the WeatherSensorChild also, since that had to have additional attributes added to support all of them.
It should also separate out Soil Sensors properly (oops).

@snell Looks like it's all working great. All the sensors are showing up and have the right values. It's even detecting a low batter on one of my sensors. Cool.

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?

Download the Hubitat app