Closed robchandhok closed 2 years ago
You are welcome👍🏻 I will look in to this. The goal is to show the same values as the Tempest App, and I have not been observant on these numbers.
The SmartWeather Integration is being deprecated and is being replaced by a new Integration I wrote, that conforms much better to the current Home Assistant standards and is much easier to maintain going forward. The only reason I have not made an announcement yet, is that I wait for it to be merged in to HACS as a Default Integration.
But the changes I will make to fix the above (If they are also present in the new Integration) will be done here. So can I convince you to install the new Integration? You can find it here: WeatherFlow Weather. Just follow the instructions on how to add it to HACS, and install from there. Both versions can co-exist.
I will then run some tests on the numbers you show above, and make the necessary adjustments tomorrow.
Ah. I am already using hass-weatherflow (switch a couple days ago). The behavior exists there. I just updated to v0.1.14. Sorry for filing the issue in the wrong place...let me know if I can help test. I'm @theotherrobc in Discord.
Ok, now it gets strange. I don't see the _final
data points when I use the Swagger with my station id. Below are the data points I see. And I also not recall ever having seen these data points. Not sure what the difference is between your setup and mine? What is the FW version of your HUB and Tempest device?
"outdoor_keys": [
"timestamp",
"air_temperature",
"barometric_pressure",
"station_pressure",
"pressure_trend",
"sea_level_pressure",
"relative_humidity",
"precip",
"precip_accum_last_1hr",
"precip_accum_local_day",
"precip_accum_local_yesterday",
"precip_minutes_local_day",
"precip_minutes_local_yesterday",
"wind_avg",
"wind_direction",
"wind_gust",
"wind_lull",
"solar_radiation",
"uv",
"brightness",
"lightning_strike_last_epoch",
"lightning_strike_last_distance",
"lightning_strike_count",
"lightning_strike_count_last_1hr",
"lightning_strike_count_last_3hr",
"feels_like",
"heat_index",
"wind_chill",
"dew_point",
"wet_bulb_temperature",
"delta_t",
"air_density"
],
"obs": [
{
"timestamp": 1639553390,
"air_temperature": 7.6,
"barometric_pressure": 1015.2,
"station_pressure": 1015.2,
"sea_level_pressure": 1021.6,
"relative_humidity": 95,
"precip": 0.0,
"precip_accum_last_1hr": 0.0,
"precip_accum_local_day": 0.0,
"precip_accum_local_yesterday": 0.817704,
"precip_minutes_local_day": 0,
"precip_minutes_local_yesterday": 99,
"wind_avg": 2.4,
"wind_direction": 261,
"wind_gust": 3.6,
"wind_lull": 1.7,
"solar_radiation": 1,
"uv": 0.0,
"brightness": 130,
"lightning_strike_last_epoch": 1635258810,
"lightning_strike_last_distance": 33,
"lightning_strike_count": 0,
"lightning_strike_count_last_1hr": 0,
"lightning_strike_count_last_3hr": 0,
"feels_like": 6.1,
"heat_index": 7.6,
"wind_chill": 6.1,
"dew_point": 6.9,
"wet_bulb_temperature": 7.2,
"delta_t": 0.4,
"air_density": 1.25969,
"pressure_trend": "steady"
}
]
}
My hub firmware is 171 My Tempest firmware is 156
I dug around a bit. I think there is a user setting called "Rain Check" which I have enabled. If you look here: https://weatherflow.github.io/Tempest/api/swagger/#!/observations/getObservationsByDeviceId
You will note 21 - Precipitation Aanalysis Type (0 = none, 1 = Rain Check with user display on, 2 = Rain Check with user display off)
I wonder if that setting is OFF for your device, and ON for mine, hence the difference. This feature is discussed here: https://community.weatherflow.com/t/rain-check-and-tempest-question/15744
My suggestion for your integration is to include both values, and if you don't see _final values, leave it zero. Not sure how easy that would be to code?
Rain check is actually on, in the App, but still shows 0 in the Swagger Data. Tried to switch it off and on, but it stays zero. I can still do the change, just not test it then. I will work on something the next few days.
I found the reason I am not seeing these values. You are right that it has something to do with Rain Check, but I found that Rain Check only works for stations located in the US. Read more here: https://community.weatherflow.com/t/what-exactly-are-the-rain-accumulated-final-fields/6809
So I will add them as datapoints, and sensors will then only be created if these data points contain a value.
Released V0.1.15, which should now give you these 3 sensors. Could you test and report back?
Tested V0.1.15, works as designed! Nice.
Using https://github.com/thomasloven/lovelace-template-entity-row, I displayed using this template, if you want to include something like that in your documentation.
{% if states('sensor.weatherflow_precipitation_today_rain_checked') !=
"unknown" %}
{{'{:.2f}'.format(states('sensor.weatherflow_precipitation_today')
|float) +
' ({:.2f} ✓)'.format(states('sensor.weatherflow_precipitation_today_rain_checked')
|float) +
' inches'
}}
{% else %}
{{'{:.2f} inches'.format(states('sensor.weatherflow_precipitation_today')
|float)
}}
{% endif %}
Could I ask you to create the example as an Item in the Discussion area. That makes it easy to point to how to use this.
Thank you for all the work building this @briis !
Since it actually rained in California this week, I was able to observe for the first time a difference between the precipitation numbers in Home Assistant and in the Tempest app. They were different, but really only got more different as the day went on (or perhaps the accumulation increased).
I poked at the raw weatherflow API, and saw this (as an example value returned from https://swd.weatherflow.com/swd/rest/observations/station/{{WeatherflowStationID}}?token={{WeatherflowAPIToken}})
The sensor for
sensor.weatherflow_precipitation_yesterday
reflects the valueprecip_accum_local_yesterday
from the API, while the Tempest app usesprecip_accum_local_yesterday_final
. Same for the values for the current day (Tempest ios app shows the _final value).I expect this was a concious choice, but perhaps the integration should expose both values and let the caller decide? If not, I would make it match the Tempest app. I can't find any documentation that describe the difference between the value and _valuefinal on the API doc website (https://weatherflow.github.io/Tempest/api/swagger/)