Integrate with OpenSprinkler

This is interesting. The raspberry pie on which is open sprinkler is behind a brick wall outside. For WIFI signal, it may not be the best.

However, and this is the interesting part, I have absolutely no problem getting access to the UI of open sprinkler from any browser on the network. On the raspberry, I have also a Bluetooth to mqtt bridge. It push data from my Xiaomi sensor to my home assistant MQTT broker every hour. It work every time.

What do you think ? The other application seem to work fineā€¦but maybe they handle connection differentlyā€¦

Hi @vinteo,
Great work by the way!
Iā€™ve setup your custom integration and I see a strange behavior. My first station and first program are not created (index 0).
For example Iā€™ve set

stations:
    - 0
    - 1
    - 2

and I see only my second and third station (index 1 and index 2).
Same with my programs. Iā€™ve set the programs indexes 0, 2 and 4 in the config and see only my third and fifth program.

I tried to change the station order in the config and still, I canā€™t see my indexes 0 station and program

No errors in the log. Iā€™m at HA 0.99.3, OS 2.1.8 and hass-opensprinkler 0.1.3
Iā€™ve double and triple check everything, Iā€™m running out of idea on how to debug the issue.

Any idea?

Did you try it without filtering the stations or programs? Does the first station work in that scenario?

It works now! Not specifying any stations or programs in the config did the trick! Thanks!

Maybe an issue with the filteringā€¦ My OpenSprinkler is set as Disabled right now (already few inches of snow on the ground here in Montreal, Canada). Maybe this setting change a bit the REST response and the filter mode cannot handle it.

Any plans to add the integration as an official integration of HA?

Thanks again.

Hi all

Iā€™m trying to get this working using open sprinkler pi (latest) and the latest version of HassIO, but get the following error and a notification saying the component did not load:

2019-11-17 21:45:24 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for hass_opensprinkler which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you do experience issues with Home Assistant.
2019-11-17 21:45:24 ERROR (MainThread) [homeassistant.setup] Error during setup of component hass_opensprinkler
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/setup.py", line 176, in _async_setup_component
    component.setup, hass, processed_config  # type: ignore
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/hass_opensprinkler/__init__.py", line 55, in setup
    for station in opensprinkler.stations():
  File "/config/custom_components/hass_opensprinkler/__init__.py", line 118, in stations
    for i, name in enumerate(response.json()['snames']):
KeyError: 'snames'

Anyone have any idea how to get around this? Is this an issue with open sprinkler pi v open sprinkler?

I have the same situation as @Marc-Antoine_Seyer.
Worked without timeouts for a lot of time
now i get same error.
I can acess via browser

Hi,

Without seeing this I have done the same, it looks nice, but I have a problem, Opensprinkler donā€™t have SSL, to get this working I have to turn off SSL in HA. Iā€™m not that technical and havenā€™t found a way around it. Either no SSL in HA or no Iframe for opensprinkler.

Any tips or hint would be helpful here.

The thing Iā€™m disatisfied with in opensprinkler is the weather report, not that accurate for Sweden, this I will solve in an ugly way, I bought a Sonoff 5V that I will stop the opensprinkler via the rainsensor with if it rains according to the Swedish forecast from HA.

I use reverse proxy in synology to give ssl to opensprinklerā€¦ it would however be best if the opensprinkler plugin was part of HACS or official hassio plugin with ingressā€¦

1 Like

Hi vinteo,

Been loving your Open Sprinkler integration but mine has also broken recently (same errors as simo26246). I installed HACS to get the latest version as your github repo suggested it was available via HACS.

I canā€™t see any reference to it in HACS and was wondering if you have any idea why?

Cheers.

Hi @philbyj5,

Please add https://github.com/vinteo/hass-opensprinkler as a custom repo in the HACS settings.

Edit: I have submitted a PR to get it into the default HACS repo so it will be there in the future

2 Likes

Thanks vinteo,
I added the custom repro and was able to add your integration through HACS. Appreciate the tip.
Today I also updated to HA 0.104. I have some OpenSprinkler entities back now but I am still missing some.


I am still missing my Schedule, Station and Scene entities.

If it helps, Iā€™m running the following OpenSprinkler version:
image

Any thoughts?

Are you using any station filters in the config? Maybe try it without any filters

Not that I know of. This is all I have configured in my Configuration.yaml for hass_opensprinkler:

hass_opensprinkler:
  host: 192.168.1.4
  password: !secret opensprinkler_password

The following info is from my HA log (appears several times):

2020-01-17 12:15:44 ERROR (MainThread) [homeassistant.helpers.entity] Update for binary_sensor.rain_delay fails
Traceback (most recent call last):
  File "C:\Utils\Python\Python37-32\lib\site-packages\homeassistant\helpers\entity.py", line 279, in async_update_ha_state
    await self.async_device_update()
  File "C:\Utils\Python\Python37-32\lib\site-packages\homeassistant\helpers\entity.py", line 461, in async_device_update
    await self.hass.async_add_executor_job(self.update)
  File "C:\Utils\Python\Python37-32\lib\concurrent\futures\thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "C:\Utils\Python\Python37-32\lib\site-packages\homeassistant\util\__init__.py", line 240, in wrapper
    result = method(*args, **kwargs)
  File "C:\Utils\HomeAssistant\custom_components\hass_opensprinkler\binary_sensor.py", line 80, in update
    self._is_on = bool(self._sensor())
  File "C:\Utils\HomeAssistant\custom_components\hass_opensprinkler\__init__.py", line 175, in rain_delay
    return self._get_controller_variable(CONF_RAIN_DELAY, 'rd')
  File "C:\Utils\HomeAssistant\custom_components\hass_opensprinkler\__init__.py", line 109, in _get_controller_variable
    self.data[key] = response.json()[variable]
  File "C:\Utils\Python\Python37-32\lib\site-packages\requests\models.py", line 897, in json
    return complexjson.loads(self.text, **kwargs)
  File "C:\Utils\Python\Python37-32\lib\json\__init__.py", line 348, in loads
    return _default_decoder.decode(s)
  File "C:\Utils\Python\Python37-32\lib\json\decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "C:\Utils\Python\Python37-32\lib\json\decoder.py", line 353, in raw_decode
    obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Invalid control character at: line 1 column 349 (char 348)

It worked before? The password is MD5ā€™ed? I am concerned that you are using Windows as well, I have never tested it on Windows before.

Did you get this fixed?

Appears it is now on the HACS repo. Good work. I too was having issues with it working so just removed it as I couldnā€™t find the update, will set it back up again now.

Cheers

Having an issue, get the following error when I try and trigger one of the switches "Failed to call service switch/turn_on. ā€˜NoneTypeā€™ object has no attribute ā€˜stateā€™ "

Any ideas?

Have reinstalled, removed and reinstalled.

Iā€™m on Hassio 104.3

All stations show in Hassio but all get the same error when switched. Also if I activate a station via the opensprinkler app it updates the state of the station that is running. I am able to turn off a running station just can not turn them on

FIXED

added

input_number:
  <station_name>_timer:
    min: 1
    max: 30
    step: 1
    mode: slider

and they now work.

2 Likes

Did you ever manage to resolve this, I have exactly the same issue with the same messaging

1 Like

Hi,

Did you try the fix in the post before yours?