home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
71.15k stars 29.82k forks source link

Missing precipitation_template in Template Weather Provider #100122

Open jvcsw opened 1 year ago

jvcsw commented 1 year ago

The problem

Hi,

in Template Weather Provider there are data pairs such as:

temperature_template - temperature_unit pressure_template - pressure_unit visibility_template - visibility_unit etc

but, I find precipitation_unit but I don't find precipitation_template.

precipitation_template is missing,

I think it is a sufficiently important field,

Thanks

What version of Home Assistant Core has the issue?

2023.9

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Container

Integration causing the issue

Template Weather Provider

Link to integration documentation on our website

https://www.home-assistant.io/integrations/weather.template

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

[547175529024] Cannot quick reload all YAML configurations because the configuration is not valid: Invalid config for [weather.template]: [precipitation_template] is an invalid option for [weather.template]. Check: weather.template->precipitation_template. (See ?, line ?).

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 227, in handle_call_service
    await hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 1969, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2006, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 980, in admin_handler
    await result
  File "/usr/src/homeassistant/homeassistant/components/homeassistant/__init__.py", line 316, in async_handle_reload_all
    raise HomeAssistantError(
homeassistant.exceptions.HomeAssistantError: Cannot quick reload all YAML configurations because the configuration is not valid: Invalid config for [weather.template]: [precipitation_template] is an invalid option for [weather.template]. Check: weather.template->precipitation_template. (See ?, line ?).

Additional information

No response

home-assistant[bot] commented 1 year ago

Hey there @phracturedblue, @tetienne, @home-assistant/core, mind taking a look at this issue as it has been labeled with an integration (template) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `template` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign template` Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


template documentation template source (message by IssueLinks)

mad-scientist commented 10 months ago

Agree. It is weird that precipitation_template should be missing

badewanne1234 commented 9 months ago

This is really strange, just came across the same thing - apart of the temperature, this is the second most important attribute in my opinion. it would be great if this can be added

jvcsw commented 9 months ago

I think exactly the same.

issue-triage-workflows[bot] commented 6 months ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment šŸ‘ This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

jvcsw commented 6 months ago

With this problem it is evident that no one is going to die, but it would be nice to give it a little attention. There are small details that can be important to someone.

mad-scientist commented 6 months ago

I feel this is clearly a bug in the code, maybe just a missing declaration.

I probably not even difficult to fix, just on nobody's agenda šŸ˜Ÿ

HenryLoenwind commented 4 months ago

Marking reports as "stale" that are waiting for a dev to look at is the pinnacle of laziness. "stale" is for reports that are waiting for users to provide information that's needed to find and fix the issue.

^ That should keep the stale-bot away for a while.


Edit: I had a look at the source code. HA doesn't support current precipitation on weather objects at all. It is only supported in weather forecasts. That's also why precipitation_unit is in length---not "length per time", as would be needed for the current precipitation.

That's a bit annoying, honestly, as the rate of rain is the only locally measured data point for "it's raining at the moment" there is.

jvcsw commented 4 months ago

Precipitation should be daily accumulation, not current precipitation, I think.

mad-scientist commented 4 months ago

I have never seen the current rate of rain being reported by a device. It is always a cumulative reporting, usually per day (at the least per hour)

The point is that you cannot measure rain as a state like temperature. It can just stop at any moment.

HenryLoenwind commented 4 months ago

I have never seen the current rate of rain being reported by a device.

image

That's Ecowitt, btw. Also, I just noticed that several sensors are named wrongly in HA. Only the mm/h one should have "rate" in its name. The Ecowitt's own GUI gets it right:

image

mad-scientist commented 4 months ago

Interesting. Does it really tell the current rate extrapolated to one hour, or the amount of rain during the last hour?

HenryLoenwind commented 4 months ago

Interesting. Does it really tell the current rate extrapolated to one hour, or the amount of rain during the last hour?

I have no idea, which time span it uses. It gets a binary signal from the sensor and needs to count impulses. It could either use the time between the last two impulses, the accumulation since the last update, or an arbitrary amount of time, like 5 minutes. But my best guess is that the outside station accumulates internally and then sends only the impulse count via RF regularly, and the inside station takes that as the current rate. Maybe I could guestimate that once it actually rains (at the moment, it's windy with some thunder; any moment now... ;) )

I think those newer, horribly expensive, no-moving-parts sensors might give a rate measurement directly. Although they still need to accumulate raindrops.

Edit: It just started raining. The first data update that came in stated it had rained 0.2 mm and that the rain rate was 1.2 mm/h. The second update was 0.5 and 3. So, it seems it's using a 10-minute period for the rate.

issue-triage-workflows[bot] commented 1 month ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment šŸ‘ This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

enzo2 commented 1 month ago

bump

martin3000 commented 4 days ago

Also a bug are the possible units: "Valid options are km, mi, ft, m, cm, mm, in, yd" Kilometers and miles??

HenryLoenwind commented 4 days ago

Also a bug are the possible units: "Valid options are km, mi, ft, m, cm, mm, in, yd" Kilometers and miles??

That's not a bug. The weather system specifies that the value can be in "any unit of length", just like any other system in HA it specifies the type of unit, not one specific one. That's how all units are handled in HA---the systems specify the type of unit; which specific unit is used depends on what the data source reports one one side and the UI is set to display on the other.