[PROJECT] Driver for WeatherFlow API

That is the same as mine with one exception. I am using the < comparator, not <=. Though it seems improbable that it would work in one case and not the other, perhaps that will work. Stranger things have happened in RM. I will give it a try. We might get rain this afternoon, so I hope I will be able to test it.

Thanks,

LJ

@ljp-hubitat:
I have no idea why it would be treating LightningStrikeLastDistance as a String EVER. It is specifically defined in the attributes as a Number, both for the WeatherFlow parent AND for the WeatherSensorChild drivers. I checked the code and it is pulling in either the it.value (which should be a number only) OR (if you are not using metric) converting it to miles in which case the value returned is defined as a double. Would yours be Metric or Imperial for measurement?
I just created a rule to test it and am not getting an error. Using my C8Pro with the latest beta firmware.
LightningStrikeRule

@halfrican.ak:
Yes. It provides a couple of attributes that are forms of rain intensity (reported by WeatherFlow):
PrecipAccumLast1hr
PrecipAccumLocalDay

1 Like

Hadn't seen that attribute populate yet, will observe. Thanks

Hmm... I see them on mine but let me know if they do not show up if you get some rain. Is your Tempest new? Not sure what the API would provide or not if it is "null" values in such cases... but if the API returns the data it should get posted right away.

It's only a week old, minimal rain since installation

I am imperial. The error I posted above does mention something about double conversion. Just an observation.

LJ

If you delete the rule and recreate it does it still happen?

Still waiting for a lighting strike. We are in a bit of drought here in Central Florida.

LJ

Ah. Well, let me know. I am watching over mine as well. But my last lightning strike was over a month ago so no logging that far back to see if I had an error.

HE C8 with Weatherflow v0.4.11
Just noticed an aberration within the unit for accuracy. The Station (child) shows PrecipitationType=0 and PrecipitationTypeString:none. However, the parent weatherflow (my case = Tempest) shows the type=1 and the string as rain.
I don't understand why, and don't know how to sync them, if it is possible, and which one should be trusted.
@snell - do you have an explanation?


Unfortunately I do NOT have a good explanation. The child device is sent the exact same values the line right after the parent is set.

Do their State Variables match their Current States? I have found cases where things can get out of sync... Because there are so many data points in these, my drivers check the current value of the State before writing an Event, just to make sure it has actually changed or not. I can set it to "force" the value to be written but I usually do not unless it is something that changes a lot or is really crucial.

In my case the child was correct and the parent was wrong i.e. it was not raining at that time.
However, about 3 hours later, it did start raining and that seems to have synchronized things, for now. Maybe, I'll have to start using the child (station) for my rules....

If they get out of sync like that, it really could be either one. I am not sure HOW that happens, considering the code... but I am glad they got back in order.

Do you think rebooting the weatherflow hub at that point would synchronize them?

No. It is purely on the hubitat side because the API only returns the value once. My driver is what puts the value in the two locations.

This does not apply to the problem you saw, but now that I think about it... the code is all structured around having one station. So the parent gets the same values as the station being queried. But if you have more than one station... The parent device's values would get overwritten with each station's data (the individual stations would have their values) so likely only the last station's data would be left on the parent. Something for me to work on in the future.

I bet I now know what happened. I replaced my router to update my mesh to WiFi 6. My C8 is on the LAN, but I inadvertently also put it on the WiFi portion as well with a static ip setup in the router. The C8 was getting confused and started locking up hard until I figure out that I screwed up. However, I also have a old Air unit and a newer Tempest unit on the same Weatherflow hub. So one or the other fouled things up.

If you have an Air and a Tempest going on the same account, that could explain it. When the parent did not match the Tempest, did it match the Air?

As I mentioned before, this is something I only just started considering... So I will probably have to come up with a Preference so someone can enter the ID of the station they want copied to the parent device. I use the attributes on whichever child device for the particular station I need (I have two Tempest stations)... so it totally did not occur to me before.

1 Like

What is an "Air"?

The Air, Sky, and Breathe were older models pre-Tempest. Here is a link to a page they published back at that time when it was related to their Indiegogo campaign:

3 Likes