Rainfall data from online source (Met.no?)

Hello!

I am trying to find a way to pull precipitation (rainfall specifically but overall precipitation would be fine) data from some online source for my approximate location. I can see in the Met.no weather integration that it has precipitation amounts but I have no idea how to access this information, or if it’s logged anywhere.

The goal is to use the past 24 hours rainfall to determine if a switch will activate the power to a solenoid valve for an automatic irrigation system. It seems like this should be simple to create the condition in the automation, essentially I just need a sensor for rainfall total over the past X hours, but I am lost with where to try to get this data into Home Assistant.

Hmmm…perhaps with AccuWeather integration and precipitation sensor using history somehow?

Anybody have any ideas for this, other than to get a rain meter?

I think this might work but I don’t know because we haven’t gotten any precipitation since setting up the relevant weather integration.

I’m still working on this. For some reason, the history statistics card doesn’t work for the precipitation sensor, but a regular history card will. We got some precipitation yesterday and I can see that it’s working.

image

Now I’m trying to figure out how to make an automation that will only trigger on a schedule if the sum of the precipitation for the past 24 hours is less than 1".

Creating an automation to trigger on a schedule isn’t difficult, I just don’t know how to make the condition. This is what I’ve come up with so far:

condition: not
conditions:
  - condition: numeric_state
    above: '1'
    entity_id: sensor.1125_buttercup_precipitation
    attribute: unit_of_measurement

I haven’t tested it because that switch isn’t set up yet (and I suspect it’s not right).

So the trigger should, I think, only trigger when the numeric state of the precipitation sensor is not above 1, which I am hoping means 1".

Don’t do screenshots of your code. Copy and paste it into your message and mark it as preformatted text . It is much easier to help you this way.
image

Anyway, drop the attribute: unit_of_measurement. That attribute only specifies the units, it has nothing to do with the value of the sensor.

You could also do below: 1 on the numeric state condition and drop the not condition.

1 Like

Edited to remove the picture.

Let me try below 1 and see if it’ll execute.

(probably) stupid question:

how do I specify the time that’s being measured? This is easy enough:

condition: numeric_state
entity_id: sensor.1125_buttercup_precipitation
below: '1'

This is the history of this sensor:

I think it is always going to be below 1 unless we get an entire inch of precipitation at a time. Is there a way to sum the values for this over the past 24 hours?

condition:
  - condition: numeric_state
    entity_id: sensor.1125_buttercup_precipitation
    above: '0'

  - condition: numeric_state
    entity_id: sensor.1125_buttercup_precipitation
    below: '1'