kloggy / HA-Irrigation-Version2

230 stars 55 forks source link

Rainfall current multiplier problem #84

Closed michelemattesini closed 2 years ago

michelemattesini commented 2 years ago

Hi everyone, unfortunately I found a problem about the rainfall current multiplier..why does it is set to 0 even when it's not raining instead that 1? If I check the "adjust for rainfall" box, in fact, the integration reduce the irrigation time to 0..is there my fault about the identification of the weather sensor or a little mistake on the code of it which I can solve by myself? I couldn't integrate smartweather because now token works only with our personal weather station and not more with anyone else found on their website :-( image

kloggy commented 2 years ago

I believe this is because you have 'unknown' for yesterday's rainfall.

michelemattesini commented 2 years ago

I believe this is because you have 'unknown' for yesterday's rainfall.

How could I solve this? is it possible to create a sensor starting from rainfall today (maybe creating a 48h rainfall sensor-raifall today) or force it to 0?

genestealer commented 2 years ago

I have tried a few different ways, both with local sensors and internet weather, I will post my settings at some point.

(Updated image 2022 09 25) image

My today and yesterday rain sensors:

sensor:
  # https://github.com/petergridge/openweathermaphistory added via HACS
  - platform: openweathermaphistory
    name: "rainfactor"
    # If latitude and longitude left out, it uses the home assistant configured Latitude and Longitude,
    # latitude: -33.8302547
    # longitude: 151.1516128
    api_key: !secret openweathermap_api_key
    num_days: 5
    day0min: 1
    day0max: 5
    day1min: 6
    day1max: 10
    day2min: 11
    day2max: 15
    day3min: 16
    day3max: 20
    day4min: 21
    day4max: 25
    fine_icon: "mdi:weather-sunny"
    lightrain_icon: "mdi:weather-rainy"
    rain_icon: "mdi:weather-pouring"

  - platform: template
    sensors:
      rain_day_0:
        friendly_name: "Rain Last 24 Hours"
        unit_of_measurement: "mm"
        value_template: "{{ state_attr('sensor.rainfactor', 'day_0_rain') }}"

  - platform: template
    sensors:
      rain_day_1:
        friendly_name: "Rain Last 24-48 hours"
        unit_of_measurement: "mm"
        value_template: "{{ state_attr('sensor.rainfactor', 'day_1_rain') }}"
genestealer commented 2 years ago

I did have any issue, with the rain multiplier not changing even with rain over the last few days, will post a screenshot when it's been raining. In the meantime, here is one with no rain. image

michelemattesini commented 2 years ago

openweathermaphistory

Isn't possible to use free API to receive the openweathermaphistory data, isn't it? For that information is necessary a payment account if I've not misunderstodd what's written in open weather map website.

genestealer commented 2 years ago

Yes you can use it for free, see the line in my code: https://github.com/petergridge/openweathermaphistory

genestealer commented 2 years ago

Seems to be working fine now: image

Suggest Closing Issue