Integrate with OpenSprinkler

I add this into my configuration.yaml file (just after “scene: !include scenes.yaml”):

!include switches.yaml:

This the content of the switches.yaml file

- platform: template
  switches:
     sprinkler_front_s1:
        value_template: "{{ is_state('binary_sensor.sprinkler_front_s1_station_running', 'on') }}"
        turn_on:
          service: opensprinkler.run
          data_template:
            entity_id: binary_sensor.sprinkler_front_s1_station_running
            # Run seconds uses the input_number below.
            run_seconds: "{{ ((states('input_number.sprinkler_front_s1_station_minutes') | float) * 60) | int }}"
        turn_off:
          service: opensprinkler.stop
          data:
            entity_id: binary_sensor.sprinkler_front_s1_station_running 
     sprinkler_front_s2:
        value_template: "{{ is_state('binary_sensor.sprinkler_front_s2_station_running', 'on') }}"
        turn_on:
          service: opensprinkler.run
          data_template:
            entity_id: binary_sensor.sprinkler_front_s2_station_running
            # Run seconds uses the input_number below.
            run_seconds: "{{ ((states('input_number.sprinkler_front_s2_station_minutes') | float) * 60) | int }}"
        turn_off:
          service: opensprinkler.stop
          data:
            entity_id: binary_sensor.sprinkler_front_s2_station_running

And I put this into my configuration.yaml:

input_number:
  sprinkler_front_s1_station_minutes:
    initial: 10
    min: 10
    max: 60
    step: 10  
  sprinkler_front_s2_station_minutes:
    initial: 10
    min: 10
    max: 60
    step: 10

And then I created an entities card with the following entries in the code editor (on entities):

entities:
  - entity: switch.sprinkler_front_s1
    name: On/Off
    secondary_info: last-changed
  - entity: input_number.sprinkler_front_s1_station_minutes
    name: Duration
  - entity: sensor.sprinkler_front_s1_station_status
type: entities
show_header_toggle: false
title: Front Sprinkler 1

Im also having issues with the stop all stations and run once program. My opensprinkler only has switch.opensprinkler_enabled entity…

script:
  os_stop_all:
    alias: 'opensprinkler stop all stations'
    sequence:   
    - service: opensprinkler.stop
      data:
        entity_id: switch.opensprinklerback_enabled # Switches or sensors for controller

does not work and

  os_back_run1:
    alias: 'opensprinkler back run one'
    sequence:   
    - service: opensprinkler.run
      data:
        entity_id: switch.opensprinklerback_enabled # Switches or sensors for controller
        run_seconds: # Seconds to run for each station (required)
          0: "10"
          1: "5"

also does not work.

Yep, stop all stations doesn’t work, I don’t have an opensprinkler switch either (switch.opensprinkler).
And “switch.opensprinkler_enabled” does nothing :frowning:

Update: Solved… I tried the Home Assistant App on my iPad and it was available there. Still nothing in Safari on my MBP.

Hi vinteo, I followed the HACS option in the guide but do not see the integration in Configurations -> Integrations after restarting Home Assistant.

I can see the downloaded open sprinkler files in custom_components/opensprinkler and can also see it in HACS -> Integrations.

I’m running Hassio (Home Assistant OS?) version 2020.12.2.

Am I missing something?

Thank you
Paul

::holding breath waiting on updates… almost dead::

is this integration not working anymore? i also only have the switch “enable” and not the switch to control any of my sprinklers.

I created a script to stop all the stations and then can call that script from the start scripts.

Script to stop all zones

stop_all_zones:
  alias: Stop All Zones
  sequence:
    - service: opensprinkler.stop
      data:
        entity_id: 
          - binary_sensor.s01_station_running
          - binary_sensor.s02_station_running
  mode: restart

and then the scripts to start each zone

run_garden_zone:
  alias: Run Garden Zone
  sequence:
    - service: script.stop_all_zones
    - delay:
        seconds: 2
    - data_template:
        run_seconds: '{{ ((states(''input_number.s01_station_minutes'') | float) * 60)
          | int }}'
      entity_id: binary_sensor.s01_station_running
      service: opensprinkler.run
  mode: single
  icon: mdi:sprinkler

but you have to manually list all zones you want to stop, defeating the ‘all zones’ part of goal function, whereas the original integration would do as such without listing exactly which zones. and kept the text lines minimal and able to work with variations that are outside of the text lines scripting.

I had the same issue. But after setting the service opensprinkler.stop to a sensor (eg. entity_id: binary_sensor.opensprinkler_sensor_1_active) instead to the station-switch it worked. The integration works nearly perfectly for my usecase. I can start and stop predefined programs. But also I‘m able to run individual stations with runtimes out of homeassinstant.

having multiple opensprinklers, I have over 40 zones on one and over 50 zones on another.

scrolling to find which zones are on and turn them off manually isnt even a cool option to me. disable all doesnt stop them when they are running.

if i create a script to send a close zone and have to send it 50 times going through each zone in the list of zones, i feel like a mad amount of send requests and the opensprinkler may not handle it. is there not a better way? anyone?

The restful API is pretty straight forward, you can use a rest comand like so

rest_command:
  opensprinkler_stop_all:
    url: "http://os-ip/cv?pw=opendoor&rsn=1"

Just insert your ip and password.

Actually, you need to MD5 your password which you can do online → http://www.md5.cz/

Then just add a button

type: button
icon: 'mdi:water-off'
tap_action:
  action: call-service
  service: rest_command.opensprinkler_stop_all
  service_data: {}
  target: {}
name: Stop All Stations

The services seem to only work consistently on binary_sensor so for stop all run opensprinkler.stop on a controller level binary_sensor like binary_sensor.opensprinkler_rain_delay_active

Hi!
I am struggling to get the integration back to work.
No matter if I use the binary_sensor or the switch of a station, it does not get triggered.
Log says:

Logger: homeassistant.helpers.service
Source: helpers/service.py:128
First occurred: 19:56:28 (4 occurrences)
Last logged: 20:01:26

  • Unable to find referenced entities binary_sensor.sprinkler_rasen_station_running
  • Unable to find referenced entities switch.sprinkler_rasen_station_enabled

I am using latest OpenSprinkler Firmware…
Any ideas how I can get things back to work?

Thanks a lot & best regards,
Michael :slight_smile:

For those with issues with using the run/stop services, please install v1.1.5-beta.2 and see if it fixes it for you

@MichaelE @docsparks @funclass

Now released on v1.1.5

i cant believe no one followed this up. Ill give it a shot tonight thank you for your efforts

I would like to have a widget on my Home Assistant dashboard that tells me the next time that OpenSprinkler will run. Anyone know if/how we can set that up?

Has anyone succesfully got the opensprinkler 1.1.6 to run with the latest home assistant? I add the integration via HACS, but it does not show up when i goto add integration?

Im running
core-2021.11.5
supervisor-2021.10.8
Home Assistant OS 6.6

I havent added mine to the network yet, but I installed the addon via HACS and I can then go into integrations and select OpenSprinkler from there.

Do many people use flow sensors with their OpenSprinkler system?

I see one mention above, but I’m interested in adding one inline with my irrigation system, and then pulling that data into HA to do leak/burst protection; e.g. hose bursts off my dripper systems, rate would go up a lot.

Is getting the data into HA from Opensprinkler possible, and is the data frequent/smooth enough to be able to do this? The graph above with flow rate seems to go high, low, nothing, rather than a smooth flow rate.