[PROJECT] Driver for Ambient API/Local and Ecowitt

Good point. I will build that into 0.92... doubt many people had a chance to copy it yet... and done. :slight_smile:

Great, thanks again.

I was wondering why loading the device page for the ecowitt was taking so long (>10sec) now compared to this morning... I just noticed there are 18719 events logged on the device 's events page...

You said you had it set for 16 seconds? That means 225 data pushes from the weather station every hour. If yours has sensors like mine and reports back 25 items, you would get ~5,625 events an hour... Ouch.

Yea, not great, I will probably remove the device and put it back to clear it...and increase the 16 seconds value... I wonder if it would be worth my time looking into sending events only when values change by a certain amount.

That could help with the events, although the Hubitat will still be receiving an awful lot of data. Made me think about mine a bit... since I would be over ~7K events a day with a 5 minute polling interval. I have generally found that to be plenty for monitoring most cases.

What would be best is if there was a way to set those limits at the weather station, so it would only notify you if something changed enough but it would notify you right away. Otherwise it would need to send a status FAR less frequently.

Yes, that would be ideal. I could always setup an intermediate node to do that work at 16sec and update the HE only when needed but that defeats the simplicity of sending it directly to HE and I don;t want that, oh well...

I will try to give it some thought, but I do not expect an easy fix for this one without custom code. It would have to give people the ability to set a range to notify them, up or down, for almost any attribute... but at the same time I have no way of knowing which attribute their station actually makes use of.
I used to get around that on my Neptune Apex driver by allowing people to set a warning range for a few fields EVERYBODY would have (like temperature and pH), but it was a bunch of added preferences and not one person complained when I removed that ability.

Trying to help someone with moisture meters connected to the GW1000 and they were showing with names different/new from your driver ("soilmoisture" and "soilbatt"). Not sure if it is Ecowitt specific or not? Here is the log:

dev:2202020-01-30 12:55:08.560 pm debug[mac:B4E62D75A987, ip:c0a8011e, port:369b, headers:[POST /aaa HTTP/1.1:null, Connection:close, Host:192.168.1.29, Content-Length:333, Content-Type:application/x-www-form-urlencoded], body:PASSKEY=9EE87E64EF742F7FF9BCB78997394207&stationtype=GW1000B_V1.5.6&dateutc=2020-01-30+17:55:06&tempinf=77.7&humidityin=16&baromrelin=29.811&baromabsin=29.811&soilmoisture1=23&soilmoisture2=0&soilmoisture3=0&soilmoisture4=42&soilmoisture5=0&soilbatt1=1.6&soilbatt2=1.5&soilbatt3=1.6&soilbatt4=1.6&soilbatt5=1.6&freq=915M&model=GW1000, header:POST /aaa HTTP/1.1 Connection: close Host: 192.168.1.29 Content-Length: 333 Content-Type: application/x-www-form-urlencoded

Yes, the Ambient API does not have those. It references SoilHum (Soil Humidity) and just Batt1-10 (each addon sensor, 1 to 10, has a battery value listed).

Ok. Try version 0.93 out for them. It will still list soilhum1... and batt1... but it will put the values from soilmoisture1 and soilbatt1 in those instead. So this should only be a problem for people having both types being reported from the same thing. Hopefully not going to happen. If it does, I will have to create that additional 20 attributes and so on...

1 Like

Super, I will forward it, Thanks.

Soo the one I imported and then pasted that you just made did not work, didn't list the extra soil sensors. Unless I still need to add code to make them work. But the one christi999 made works fine. I'm happy without battery sensors on account of the fact that, well I've never changed them and they still report on time consistently. So I'm not Uber worried. But I have no moisture sensor data at all in the version Snell is currently hosting. Anything I can do let me know, but i already propagated the moisture sensor into global variables and made them into thermostat's so they can be used with a Google home. (Ask it what the "temperature" is to get the soil moisture)

OK... That is a bummer since I just copied the section of code for the normal soilhum and batt responses but made them also check for the soilmoisture and soilbatt variables that @christi999 listed in the sample. No new names would show up.

If you could send me a shot of the variables it reports when set for debug mode (it will provide an array with the whole lot) I can make sure I got the naming correct.

The main thing is that the driver has to be version 0.93 (or newer if I make more changes). Older versions cannot detect the soilmoisture field that Ecowitt reports instead of the soilhum that Ambient uses. Plus, the soilmoisture data will show up in the soilhum fields.

Try copy/pasting the new version in and see if that helps.

How so I set it to log debug stuff to show u?

And it actually didn't show any variables at all for the soil moisture.

First, open a separate tab in your favorite browser with the "Logs" page for your Hubitat. Then in the first tab go to the device. In the preferences section there is a dropdown for "Enable Logging?". Select "Debug" then Save Preferences.

If you flip back to the Logs page it should have a listing for the device (Saving Preferences causes it to refresh the values).

Also, please make sure your driver is at the latest 0.93 version. The version number is listed in the State Variables as "Version".

It was copying from my cache it works lol. Couldn't figure why it still said v9.1

Glad to hear it is working.

Complete Noob here. I added the driver code and created a new driver. I then added the hubitat ip and port info in the Ecowitt WS app, added a device with the Mac address in caps and no colons for the device ID and assigned the device type as ambient weather. Despite this, I never can see any of the additional preferences and my device doesn't seem to get polled. This is with a brand new hub that was installed and updated today. I feel like I have to be missing something very stupid, but cant seem to figure out what it is. I have copied the code and imported using. direct URL with the same results (v 0.9.4)