[PROJECT] Driver for Ambient API/Local and Ecowitt

Glad you got it. Did they provide any sort of link to the "new" place for the API Key or did they just provide one directly? I have had mine for a long time so I was completely unaware that they had changed how you get one.

So I just got the WS-1965B and was thinking that local would work but it's not. I turned on Trace and it looks like it's doing a GET for /endpoint and not a POST for the data. It's annoying how they make everything function so differently.

dev:1265 2023-06-17 10:01:25.516 AMtraceWeatherStation - Event: Last Updated = Sat Jun 17 10:01:25 CDT 2023
dev:1265 2023-06-17 10:01:25.515 AMtraceWeatherStation - All data = [:]
dev:1265 2023-06-17 10:01:25.512 AMtraceWeatherStation - Raw data = mac:<CORRECT_MAC>, ip:0a0a143d, port:fe9b, headers:R0VUIC9lbmRwb2ludCBIVFRQLzEuMQ0KQ29ubmVjdGlvbjogY2xvc2UNClVzZXItQWdlbnQ6IFdTMTk2NUINCkhvc3Q6IDEwLjEwLjIwLjIwDQo=, body:

Looking over the information, it does say that it can publish the data to a custom website, so that is what allow it to do the local data. So a few things to check:

  1. That the Ambient App has been configured to publish data to your Hubitat correctly.
  2. That the Hubitat device has the correct MAC entered properly as the DNI and that the Weather Method is set for "Ambient Local".

When it is set for Ambient Local, the Hubitat device does not poll for data. It receives it when the Hubitat gets the data sent to it by the weather station.

1 Like
  1. It has been configured correctly, I triple checked it. It is "trying" to publish, that is what those events are from above. That is the WS reaching out to my Hubitat.
  2. The mac that it shows in the raw data is the correct MAC that I have in the DNI and what shows on the actual device. It is set to Ambient Local.

My hubitat is not polling the data, those events are from the device reaching out. The base64 decode of the headers show:

GET /endpoint HTTP/1.1
Connection: close
User-Agent: WS1965B
Host: 10.10.20.20

That is from the WS-1965 doing a GET to /endpoint and nothing else after that. This happens every minute (as that is what I configured it for). I'm assuming the other devices it's normally a POST with all the data?. I followed the steps for the setup which were almost identical to the WS-2000, except you do it though a web gui instead of the app.

WS-1965

So that all looks correct. When the Ambient is coming back in local method it does not actually send any "data"... all the data is encoded in the headers. For example, here is what my device receives:

Raw data = mac:<MAC>, ip:<IP>, port:9b88, headers:R0VUIC9kYXRhL3JlcG9ydC9zdGF0aW9udHlwZT1BTUJXZWF0aGVyVjQuMy40JlBBU1NLRVk9REM6NEY6MjI6NTk6NzA6MTkmZGF0ZXV0Yz0yMDIzLTA2LTE4KzE0OjE4OjMzJnRlbXBpbmY9NzIuMSZodW1pZGl0eWluPTU0JmJhcm9tcmVsaW49MjkuOTUwJmJhcm9tYWJzaW49MjkuNjc1JnRlbXBmPTY1LjMmaHVtaWRpdHk9ODAmd2luZGRpcj0xNTMmd2luZHNwZWVkbXBoPTEuOCZ3aW5kZ3VzdG1waD0yLjImbWF4ZGFpbHlndXN0PTUuOCZob3VybHlyYWluaW49MC4wMDAmZXZlbnRyYWluaW49MC4wMDAmZGFpbHlyYWluaW49MC4wMDAmd2Vla2x5cmFpbmluPTAuMDAwJm1vbnRobHlyYWluaW49MS44NTAmdG90YWxyYWluaW49MTM5LjAzMiZzb2xhcnJhZGlhdGlvbj00OTguNDAmdXY9NCZiYXR0X2NvMj0xIEhUVFAvMS4xDQpDb25uZWN0aW9uOiBjbG9zZQ0KVXNlci1BZ2VudDogRVNQODI2Ng0KSG9zdDogMTAuMTAuMTAuNTANCg==, body:

And what it gets converted to:

All data = [stationtype:AMBWeatherV4.3.4, PASSKEY:<MAC>, dateutc:2023-06-18 14:18:33, tempinf:72.1, humidityin:54, baromrelin:29.950, baromabsin:29.675, tempf:65.3, humidity:80, winddir:153, windspeedmph:1.8, windgustmph:2.2, maxdailygust:5.8, hourlyrainin:0.000, eventrainin:0.000, dailyrainin:0.000, weeklyrainin:0.000, monthlyrainin:1.850, totalrainin:139.032, solarradiation:498.40, uv:4, batt_co2:1]

I am going to post a new version right after this. It WILL NOT fix the issue, but I am adding a bit more Trace logging to see if we can figure out what is happening.

EDIT:
After manually decoding all the data... Since the station does not seem to be sending any data at all, I wonder if something is wrong on it's end. Does it have the latest firmware? Still going to post the minor update though...

Updated Version(s):

  • AmbientEcowittWeather.groovy = 0.8.1

Change(s):

  • Additional Trace logging for Ambient Local data parsing steps.

Still just /endpoint with no additional data. It looks like it just got a firmware update. I checked before originally replying and it was the most up-to-date. The below is with the most current firmware as of today (V1.1.3). My initial thought is it's expecting something back, like it's checking the type of endpoint, expecting some returned data on how to send it's data back. However that's just based on my experience on some other things and nothing with these weather stations. I'll try to do some research myself and maybe fuzz it some to see if I can get it to return anything else.

dev:1265 2023-06-19 11:40:21.017 AMtraceWeatherStation - Child Event: WindChill = null
dev:1265 2023-06-19 11:40:21.009 AMtraceWeatherStation - Child Event: HeatIndex = null
dev:1265 2023-06-19 11:40:20.998 AMtraceWeatherStation - Child Event: dewPoint = null
dev:1265 2023-06-19 11:40:20.980 AMtraceWeatherStation - Event: Last Updated = Mon Jun 19 11:40:20 CDT 2023
dev:1265 2023-06-19 11:40:20.978 AMtraceWeatherStation - All data = [:]
dev:1265 2023-06-19 11:40:20.977 AMtraceWeatherStation - Ambient Local rawData Step 2 = endpoint
dev:1265 2023-06-19 11:40:20.976 AMtraceWeatherStation - Ambient Local rawData Step 1 = /endpoint
dev:1265 2023-06-19 11:40:20.974 AMtraceWeatherStation - Ambient Local Headers = R0VUIC9lbmRwb2ludCBIVFRQLzEuMQ0KQ29ubmVjdGlvbjogY2xvc2UNClVzZXItQWdlbnQ6IFdTMTk2NUINCkhvc3Q6IDEwLjEwLjIwLjIwDQo=
dev:1265 2023-06-19 11:40:20.972 AMtraceWeatherStation - Raw data = mac:<MY_MAC>, ip:0a0a143d, port:fc48, headers:R0VUIC9lbmRwb2ludCBIVFRQLzEuMQ0KQ29ubmVjdGlvbjogY2xvc2UNClVzZXItQWdlbnQ6IFdTMTk2NUINCkhvc3Q6IDEwLjEwLjIwLjIwDQo=, body:

Strange, I do not have a new Ambient by any means (WS-2902A) but all it does is send the data to the endpoint (the Hubitat) per the custom destination. It does not have any handshake or such... just send and forget about it.

Their setup page is pretty simple too. I looked at mine and compared it when you sent the screenshot originally and they were basically the same (except the IP, but oddly, I ALSO use 10.10.10... so everything but the last number was the same).

@snell first, thanks for creating this Ambient integration driver. I've been using it for some time, and just a day ago I discovered the child device driver, so that's cool. I have an Ambient WS-2000 with several added sensors (soil moisture, lighting, interior temp/humidity/pressure, extra exterior temp) and they all seem to work fine.

Here's my issue I hope you can help with. I just added an Ambient Weather AQIN Wireless Indoor Air Quality Index PM2.5, PM10 and CO2 Particulate Monitor. In the parent device State Variables I can see readings from this sensor (co2_in_24h_aqin, pm10_in_24h_aqin, pm25_in_aqin, pm25_in_24h_aqin, pm10_in_aqin, and co2_in_aqin), but I do not see them in the Current States variables, nor can I find them to use them in rules.

My driver version is 0.7.19. Can support be added for this air quality sensor? Thank you for any help or suggestions you can make.

Following myself up here. I upgraded to version 0.8.1 of the Ambient driver and a child device for my air quality sensor was immediately created. All the parameters seems to be there, and then some. I retract my request for help, and thank @snell again for creating and maintaining this integration. Thanks again.

1 Like

Glad it worked out! If anything comes up, just reach out.

I have a WS-2902A I setup with your driver back in 2020. I has worked great up until Jan 23. Then it stopped reporting to both my Ambient.net site and of course my C5.
So the rooftop station and the ambient desktop lcd are both working .

Do you have any idea why the little station is not reporting to Hubitat or my Ambient site? I don't know how to verify the station is sending data or not. Ambient support is worthless, just giving a canned response for a different subject?

Nothing changed on my part. In fact I have been away from my house for 3 years. I replaced batteries which were actually still good.

I have a lot of devices that need this station's data. Any ideas?

Cheers, Jack

I do not have an exact idea, but here are some things I would recommend checking:

  1. Is the 2902A reporting to the Hubitat via the Local Method or is the data being polled from the Ambient API? If it was using the API method, then that would stop working if the Ambient site is not receiving the data.
  2. Does the 2902A have the latest firmware?

I know you said no other changes but just wondering:
3) Any changes to the networking? Is there a chance that the router supporting the network is blocking the data via a firewall, or that your ISP determined there was "too much upload" and is blocking it somehow?
4) Have you "rebooted everything" involved? Network router, ISP modem (cable or fiber, whatever you might have), Hubitat, even the weather station (sounds like that might have been done when you replaced the batteries). Maybe there was a "power incident" at some point and things got "confused". I have had devices (not my Ambient) that did not recover quite right after a power failure or power fluctuation, until I completely shut them down and let them come back again. More often this happens with a power fluctuation (power drops momentarily but not long enough for capacitors or power supplies to completely drain out) than a full on power failure (in my experience).

1 Like

I tried all those things. Even put the station into wifi setup mode and used their Awnet app which finds and sets up the station networking to my LAN. Awnet could not find my station which tells me the wifi radio in the station is hosed. It uses a different radio to talk to the weather array sensors and it works fine. I think I need to replace the actual station console.

Yes, the sensor radio is 915mhz or 433mhz depending on region if I recall. Totally different radio than the 2.4Ghz used for the WiFi. Bummer that yours seems to have died but that would certainly explain the problem. Never heard of that happening before (I have the 2902A also).

Doing a quick search for that... If you have not already bought a new display you could try checking if for some reason the WiFi has been disabled or needs to be reset. Here are a couple things from their website, if you have not already tried those:
https://ambientweather.com/faqs/question/view/id/1592/
https://ambientweather.com/faqs/question/view/id/1457/

Hi snell,
I moved to here as you requested.
I just got a different response in my logs..... what do you make of this?

dev:67992023-10-16 11:57:59.141 PMtraceWeather - Event: Driver Version = 0.8.1

dev:67992023-10-16 11:57:59.139 PMtraceWeather - Event: Driver Name = AmbientEcowittWeather

dev:67992023-10-16 11:57:58.627 PMtraceWeather - No data received in Ecowitt response.

dev:67992023-10-16 11:57:58.622 PMtraceWeather - Received Ecowitt = [mac:000EC6302119, ip:c0a87a49, port:f62c, headers:[GET /weatherstation/updateweatherstation.php HTTP/1.0:null, Accept:/, Connection:close, Host:rtupdate.wunderground.com:80], body:null, header:GET /weatherstation/updateweatherstation.php HTTP/1.0
Accept: /
Connection: close
Host: rtupdate.wunderground.com:80

Is it trying to provide data using a weather underground method? This driver will only accept receiving data that is formatted for Ecowitt or Ambient (which are nearly the same data, but not quite) methods.

It also looks like the device might be set to "Ecowitt Local" mode. From digging into the Misol IP Observer (which I had never heard of before this nor seen the similar Ambient IP Observer) it looks like it is specifically an Ambient "esque" device. So you want to set the Weather Method preference on the device page to be "Ambient Local".

On the device page, it is updating every 15 secs, so it is talking to the driver.

It must be a format issue at this point. Is there a way to capture this data stream and see what data is being generated?

In trace mode the log generated is.....

Can you send me the logging lines from the Raw data and Local Headers that you have shown as text in a message directly to me? It does appear to be a decoding issue.

Whatever it is doing... it is NOT providing it in the "normal" Ambient Local method. So it will be necessary to figure out how it is encoding the data, decode it, and then maybe I can add a new method to support it.