[RE-RELEASE] EcoWitt and Wittboy Weather Stations And Sensors (Local)

I guess there's a risk for this being slightly off-topic, so please just let me know if you think I should start a new thread instead.

I have gotten my ecowitt and hubitat integration up and running with the help of this driver and thread (thanks a million!). However, I'd really prefer to have my hubitat and the ecowitt on separate VLANs, where traffic from the ecowitt would be restricted to established traffic only. Does anyone have any idea how I would go about to do such a thing? Would it be possible to modify this driver so that it polls the ecowitt rather than listening for when the ecowitt sends it's reports?

Thanks for any insights, thoughts or suggestsions!

1 Like

that should work as long as you put in static routing info on both lans router(s) and test via ping to see if they can reach each other.. then use ip address

1 Like

Thanks! :pray: It did work!

2 Likes

Heya! I scanned the thread here and I didn't see this asked here (or elsewhere on these forums): Does this driver work with any of the Ecowitt wifi consoles? I've got a Lacrosse console I wanna replace with an Ecowitt and also have integration into my HE.

What model console were you planning to buy?

I had been looking at the WS2910 as it kinda sorta mentioned their apps are supported but I’m not terribly picky if there’s a more HE compatible choice.

It says that it can upload to a web site in EcoWitt format, which I believe it all that is required for integration with the drivers.

here are some more changes for you to integrate since capablity air quality was added i integrated it..

capability "Illuminance Measurement";
capability "Water Sensor";
capability "CarbonDioxide Measurement";
capability "Air Quality";

....

if (aqi < 51) { danger = "Good"; color = "3ea72d"; }
else if (aqi < 101) { danger = "Moderate"; color = "fff300"; }
else if (aqi < 151) { danger = "Unhealthy for Sensitive Groups"; color = "f18b00"; }
else if (aqi < 201) { danger = "Unhealthy"; color = "e53210"; }
else if (aqi < 301) { danger = "Very Unhealthy"; color = "b567a4"; }
else if (aqi < 401) { danger = "Hazardous"; color = "7e0023"; }
else { danger = "Hazardous"; color = "7e0023"; }

// lgk set airQualityIndex only if actual aqi not avg
if (attribAqi == "aqi") attributeUpdateNumber(aqi, "airQualityIndex", "AQI");

Boolean updated = attributeUpdateNumber(aqi, attribAqi, "AQI");

3 Likes

Might be a couple of weeks before I get to it, but certainly happy to add it in. Thanks for passing it on.

1 Like

@kahn-hubitat,

Can you please send me a copy of the method where you are setting the AQI? I'm not sure about how the changes you made would play out with the earlier setting of aqi prior to the danger value being set.

EDIT - Actually, I think I get it now, you are not trying to change what happens, just set an additional attribute when AQI is sent through, to align with what the Air Quality capability is expecting. The updated result also threw me, the fact that wasn't part of what you changed, but again, it's only about adding the additional attribute... Still would be interested to see your full code for that method, but I'm happy to release it now.

Thanks,
Simon

Version 1.32.0 released with Air Quality added, thanks again @kahn-hubitat

1 Like

i didnt add the original aqi but did help mircoline refine it.. here is the fx. bolded is the new line to add airqualityindex

private Boolean attributeUpdateAQI(String val, Boolean pm25, String attribAqi, String attribAqiDanger, String attribAqiColor) {
//
// Conversions based on Air quality index - Wikipedia
//
BigDecimal pm = val.toBigDecimal();

BigDecimal aqi;

if (pm25) {
// PM2.5
if (pm < 12.1) aqi = convertRange(pm, 0.0, 12.0, 0, 50);
else if (pm < 35.5) aqi = convertRange(pm, 12.1, 35.4, 51, 100);
else if (pm < 55.5) aqi = convertRange(pm, 35.5, 55.4, 101, 150);
else if (pm < 150.5) aqi = convertRange(pm, 55.5, 150.4, 151, 200);
else if (pm < 250.5) aqi = convertRange(pm, 150.5, 250.4, 201, 300);
else if (pm < 350.5) aqi = convertRange(pm, 250.5, 350.4, 301, 400);
else aqi = convertRange(pm, 350.5, 500.4, 401, 500);
}
else {
// PM10
if (pm < 55) aqi = convertRange(pm, 0, 54, 0, 50);
else if (pm < 155) aqi = convertRange(pm, 55, 154, 51, 100);
else if (pm < 255) aqi = convertRange(pm, 155, 254, 101, 150);
else if (pm < 355) aqi = convertRange(pm, 255, 354, 151, 200);
else if (pm < 425) aqi = convertRange(pm, 355, 424, 201, 300);
else if (pm < 505) aqi = convertRange(pm, 425, 504, 301, 400);
else aqi = convertRange(pm, 505, 604, 401, 500);

// Choose the highest AQI between PM2.5 and PM10
BigDecimal aqi25 = (device.currentValue(attribAqi) as BigDecimal);
if (aqi < aqi25) aqi = aqi25;

}

String danger;
String color;

if (aqi < 51) { danger = "Good"; color = "3ea72d"; }
else if (aqi < 101) { danger = "Moderate"; color = "fff300"; }
else if (aqi < 151) { danger = "Unhealthy for Sensitive Groups"; color = "f18b00"; }
else if (aqi < 201) { danger = "Unhealthy"; color = "e53210"; }
else if (aqi < 301) { danger = "Very Unhealthy"; color = "b567a4"; }
else if (aqi < 401) { danger = "Hazardous"; color = "7e0023"; }
else { danger = "Hazardous"; color = "7e0023"; }

// lgk set airQualityIndex only if actual aqi not avg
if (attribAqi == "aqi") attributeUpdateNumber(aqi, "airQualityIndex", "AQI");

Boolean updated = attributeUpdateNumber(aqi, attribAqi, "AQI");

if (attributeUpdateString(danger, attribAqiDanger)) updated = true;
if (attributeUpdateString(color, attribAqiColor)) updated = true;

return (updated);
}

// ------------------------------------------------------------

private Boolean attributeUpdateCarbonDioxide(String val, String attribCo2) {

BigDecimal co2 = val.toBigDecimal();
return (attributeUpdateNumber(co2, attribCo2, "ppm"));
}

// ------------------------------------------------------------

1 Like

Thanks @kahn-hubitat, I had other concerns that I had convinced myself were all ok, but by a happy accident of comparing your code I realised Mirco had introduced an additional condition around a "HTML Enabled" setting, which meant I was only going to have Air Quality updated where users had enabled this HTML setting. I have now fixed this.

I also added a thankyou in the change log to you for your good work :slight_smile:

1 Like

@sburke781

I have a few soil moisture sensors that I had "let go" for a while (removed from use and forgot about during landscaping project.

I recently replaced batteries in them (luckily no issues w/corroding or anything) and the read-out on the Device page for the batteries isn't working well. I have three sensors:

2022-02-12 10_10_54-Chrome Main
2022-02-12 10_11_03-Chrome Main
2022-02-12 10_11_09-Chrome Main

All three have exactly the same Preferences:

Battery reporting in the Ecowitt all show as "Normal:"

Anything I can do about this to fix reporting on HE? All three have fresh rechargeable batteries in them, which IRRC worked OK in the past. I have to admit, it's been so long since I used these that I really don't remember how battery reporting was before...do I need to do anything to "refresh" them in the integration to get them to report better?

I was literally doing the same thing yesterday. I purchased my first one about a month ago and then received another 3 during the week. I'll admit I haven't looked up Mirco's documentation, but I assumed it related to the low and high voltage settings. I looked my batteries up and from what I could tell they ranged from 1.3 down to 0.9, but I could be wrong.... But I can only assume those settings don't make there way back onto the Gateway, so I still have some investigation to do.

1 Like

Thanks - pretty funny about the timing. :slight_smile:

And don't worry, it's not because I hang out outside your house and x-ray all your packages when they arrive. Really, I'm not doing that. (Heh, heh, heh...)

1 Like

It is funny about the timing :slight_smile: And I didn't see the delivery guy that dropped it off, so all that effort you went to in order to purchase the uniform was not needed.... :wink:

1 Like

This question may not be about the drivers per se, but that is where I noticed something odd. I currently only have a GW1000 Gateway and one WH51. soil humidity sensor. I successfully added the gateway and sensor to the WSPlus app. Once that was done, both populated to the other Ecowitt app. I installed these Ecowitt drivers on my devices hub and everything was fine. The next day I stared having additional devices show up both on my phone and in the Hubitat Devices list.

The Gateway and Kitchen Plant are the devices I have. Where did the Air Quality sensor2, Indoor Ambient Sensor and Water / Soil Temperature Sensor 4 Come from? I'm very confused. Can someone help me understand where these came from??

If this isn't the appropriate forum, kindly let me know where would be more appropriate and I will gladly delete and repost there. Thanks!

Happy for you to post here, you're seeing something odd in the HE devices, if it turns out to be unrelated to the drivers that's ok, others may benefit from knowing what the reason was if they see the same thing.

If it was just the Ambient Sensor I could kind of understand. I have one that is hard-wired into the side of the gateway and is there to measure indoor temperature, humidity and air pressure, compared to my outdoor weather stations. But the fact this and the other sensors, showed up days later is really odd, including an Air Quality sensor. I could also have understood with the Soil Moisture sensor if it was somehow paired to a different channel, but again, the other devices makes it seem like something else.

Could they be pairing from a neighbours setup? Would the gateway be close enough do you think to someone else who may have just purchased either a complete setup or some new sensors?

1 Like

That was my first thought, and could be very possible. Not that i know of, but that doesnt mean much. Ill ask in our neighborhood facebook group if anyone else is using ecowitt andnhas these devices. Interestingly, no weather station, just single devices. Do you know if there is a way to get them off my gateway, as they seem to be using a couple channels i'll eventually need? I definitely plan to add more including a full weather station.
Thanks!