Integrate with OpenSprinkler

Same problem .
tried the input number snippet

Traceback (most recent call last):
  File "/home/reinan/homeassistant/lib/python3.7/site-packages/homeassistant/helpers/entity.py", line 279, in async_update_ha_state
    await self.async_device_update()
  File "/home/reinan/homeassistant/lib/python3.7/site-packages/homeassistant/helpers/entity.py", line 476, in async_device_update
    await self.hass.async_add_executor_job(self.update)
  File "/usr/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/home/reinan/homeassistant/lib/python3.7/site-packages/homeassistant/util/__init__.py", line 240, in wrapper
    result = method(*args, **kwargs)
  File "/home/reinan/.homeassistant/custom_components/hass_opensprinkler/sensor.py", line 55, in update
    self._p_status = self._station.p_status()
  File "/home/reinan/.homeassistant/custom_components/hass_opensprinkler/__init__.py", line 225, in p_status
    response = requests.get(url, timeout=10)
  File "/home/reinan/homeassistant/lib/python3.7/site-packages/requests/api.py", line 76, in get
    return request('get', url, params=params, **kwargs)
  File "/home/reinan/homeassistant/lib/python3.7/site-packages/requests/api.py", line 61, in request
    return session.request(method=method, url=url, **kwargs)
  File "/home/reinan/homeassistant/lib/python3.7/site-packages/requests/sessions.py", line 530, in request
    resp = self.send(prep, **send_kwargs)
  File "/home/reinan/homeassistant/lib/python3.7/site-packages/requests/sessions.py", line 643, in send
    r = adapter.send(request, **kwargs)
  File "/home/reinan/homeassistant/lib/python3.7/site-packages/requests/adapters.py", line 529, in send
    raise ReadTimeout(e, request=request)
requests.exceptions.ReadTimeout: HTTPConnectionPool(host='opensprinkler.fritz.box', port=80): Read timed out. (read timeout=10)

Where did you add it to please?

Into ‘inputnumber.yaml’ located in you main config folder

1 Like

Thanks for the quick response :slight_smile:

Don’t forget to change <station_name> to match the station you want it to relate to

1 Like

Hi, I have the same error, installed the integration via HACS.
I do not seem to have a file called inputnumber.yaml. Where do I put the workaround?
Just create the file?

Thanks a lot & best regards!
Michael

You can just put it into configuration.yaml

Yes, I hadn’t turned the password into md5

I am not getting this right - please could you help me by sharing a sample file or snippet for configuration.yaml or inputnumber.yaml

I am really battling to get this going - would you please share me some snippets or yaml files that I can use?

Anyone willing to help me please. I added my Opensprinkler and can see the stations but I get the "Failed to call service switch/turn_on. ‘NoneType’ object has no attribute ‘state’ " - anyone that can share a snippet of their yaml files and which ones to update please?

Have the same issue intergrating the code into the .yaml tried various indentations with no love i assume is meant to work like so:

hass_opensprinkler:
  host: <ip-address>
  password: <pwd>
  
  input_number:
     s01_timer:
      min: 1
      max: 30
      step: 1
      mode: slider

Don’t put input_number under hass_opensprinkler, put it on the highest level (no identation)

This is what I added into my configuration.yaml file to make it work:

hass_opensprinkler:
   host: 192.168.1.203:803
   password: a6d82bced638de3def1e9bbb4983225c

input_number:
     front_s1_timer:
      min: 1
      max: 30
      step: 1
      mode: slider
     front_s2_timer:
      min: 1
      max: 30
      step: 1
      mode: slider
     front_s3_timer:
      min: 1
      max: 30
      step: 1
      mode: slider
     front_s4_timer:
      min: 1
      max: 30
      step: 1
      mode: slider

This is what I added to my entities card on Lovelace to make it work:
entities:

entities:
  - entity: input_number.front_s1_timer
  - entity: switch.front_s1
  - entity: input_number.front_s2_timer
  - entity: switch.front_s2
  - entity: input_number.front_s3_timer
  - entity: switch.front_s3
  - entity: input_number.front_s4_timer
  - entity: switch.front_s4
title: Open Sprinkler Stations
type: entities

My Sprinklers are called front_s1 to front_s4 - replace that with your station name on Opensprinkler

Thanks for clarifying will try after i update to hassOS. Im still using hassbian

This is an awesome integration, one thing I can’t figure out Is how to display what stations are queued?
Is this possible?

I have two Opensprinklers. Is there a way to have both integrated using your component? I tried adding both IP’s to the configuration file, but that did not work.

No easy way at the moment, someone had some luck by making a copy of the folder and changing part of the code, ie have another folder called hass_opensprinkler2 and using hass_opensprinkler2: in the config for the second device.

Another option is to try the integration I am trying to get into HA, the config is different.

Integration PR: https://github.com/home-assistant/core/pull/34146 (copy the files into custom_components folder
Doc PR: https://github.com/home-assistant/home-assistant.io/pull/12953

Note I haven’t tried it as a custom component yet but I think it should work

Thank you. I took the first option and made that work. That will also be a simple change back when your integration is ready.

Another option is to integrate Remote Home Assistant and integrate the other OpenSprinkler into the second slave HA. See more here: Master HA instance with multiple slaves