Coder Social home page Coder Social logo

Comments (8)

dmascord avatar dmascord commented on August 15, 2024

I second this request!

For OpenWeatherMap, looking at https://github.com/rgc99/irrigation_unlimited/blob/master/packages/irrigation_unlimited_adjustment.yaml example, we should probably be able to replace sensor.wupws_preciptotal with sensor.openweathermap_rain, sensor.wupws_temp with sensor.openweathermap_temperature, but I am not sure how to get sensor.wupws_preciprate equivalent.

from irrigation_unlimited.

rgc99 avatar rgc99 commented on August 15, 2024

I am not a big fan of WU but it was one of the services that my PWS would feed and could get it back. However, my PWS died a few of weeks ago and it's replacement has a 'custom' weather service it can feed. I have pointed this to my syno NAS and with a little php magic is it now feeding a mysql/mariadb database. From there you can use the built-in HA mysql integration to do all sorts of data mining and best of all, no cloud involved. I am in the process of unwinding the WU integration.

I have installed OWM but waiting for some rain to check the data - due late next week. Temperature should be easy but rainfall could be a challenge.

from irrigation_unlimited.

tbaumann avatar tbaumann commented on August 15, 2024

I have exactly the same challenge in Marrakech. 😂

from irrigation_unlimited.

dmascord avatar dmascord commented on August 15, 2024

Hi guys,

Any update on this?

Cheers,

Damien

from irrigation_unlimited.

rgc99 avatar rgc99 commented on August 15, 2024

I setup OWM in the onecall_hourly mode. Temperature should be a straight swap out for the OWM sensors. It looks like you get the rain for the last hour whereas WU gives you a daily cumulative total. Rather than taking a max value for the day it might work as an average, i.e. hourly average value * 24. Could probably also use the last hour rain sensor as the preciprate to check if it is currently raining. Just need to check if it is greater than zero.

from irrigation_unlimited.

rgc99 avatar rgc99 commented on August 15, 2024

Struggling to get the daily rainfall from OWM. It gives rainfall for the last hour but very difficult to translate this to the daily accumulated total. For the record OWM has the daily rainfall as a premium paid product so maybe this is by design. Anyone have any luck with rainfall?

from irrigation_unlimited.

dmascord avatar dmascord commented on August 15, 2024

What I have done at the moment is to use the forecast over the next 4 days, to determine whether or not I should water

sensor:
  - platform: template
    sensors:
        rainy_day:
            friendly_name: "Rain in next 4 Days"
            value_template: >-
                {% set p0 = state_attr('weather.openweathermap', 'forecast')[0].precipitation_probability > 50 %}
                {% set p1 = state_attr('weather.openweathermap', 'forecast')[1].precipitation_probability > 50 %}
                {% set p2 = state_attr('weather.openweathermap', 'forecast')[2].precipitation_probability > 50 %}
                {% set p3 = state_attr('weather.openweathermap', 'forecast')[3].precipitation_probability > 50 %}
                {{ 'Yes' if p0 or p1 or p2 or p3 else 'No' }}

automation:
    - alias: Rainy days in future
      trigger:
        platform: state
        entity_id: sensor.rainy_day
        to: 'Yes'
      action:
        service: irrigation_unlimited.disable
        data: { entity_id: binary_sensor.irrigation_unlimited_c1_m }
    - alias: No rainy days in future
      trigger:
        platform: state
        entity_id: sensor.rainy_day
        to: 'No'
      action:
        service: irrigation_unlimited.enable
        data: { entity_id: binary_sensor.irrigation_unlimited_c1_m }

This isn't the most elegant way of doing it, but it seems to function for me :)

Looking into the cumulative historical rain with OWM, it is probably something that can be achieved using SQL (untested, just an idea):

sensor rainsensor_yesterday:
  platform: sql
  scan_interval: 86400
  queries:
    - name: rainsensor yesterday
      query: "SELECT SUM(state) AS value FROM states WHERE entity_id='sensor.openweathermap_rain' AND state!='unknown' AND datetime(last_changed) BETWEEN datetime(date('now', '-1 days')) AND datetime(date('now'));"
      column: 'value'
      unit_of_measurement: 'mm'

from irrigation_unlimited.

SeLLeRoNe avatar SeLLeRoNe commented on August 15, 2024

Hi, I am in the same situation apparently :)
I am wondering, what does the "sensor.wupws_preciprate" provide as output?
My idea is to try to create a template sensor that return the same result based on available info (if there are any).

Thanks :)

from irrigation_unlimited.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.