Integrate with OpenSprinkler

In your config put ‘192.168.1.36:8080’ as your host. That may work if it is not port 80.

Yea, can confirm, adding the default port (:8080) to the end of the IP address works. Thanks

Hi,

I have noticed that with your component the sensor names are not the same as the other, meaning that many of the previous groups, sliders etc are not working 100%…

Do you think you could post your supporting groups, sliders, automations .yaml files so that I can change these over to your config?

Thanks very much for your help

Hi,
I am using @vinteo addon and it is working perfectly, however I am seeing 3 component for each zone, a switch, binary sensor and a sensor. is this the normal behavior?

yes, that’s normal

Hey,

I found this tread … i think to late :smiley:

I make a OpenSprinkler integration with Node-RED and the API of OpenSprinkler

Lovelace - OpenSprinkler with HA and Node-RED

@vinteo
Hi,
I just installed the new .88 and there seems to be an issue. although all component shows in the frontend after fully loaded HA.

Feb 21 11:29:12 homeassistant hass[11454]: 2019-02-21 11:29:12 ERROR (MainThread) [homeassistant.loader] Error loading custom_components.hass_opensprinkler.binary_sensor. Make sure all dependencies are installed
Feb 21 11:29:12 homeassistant hass[11454]: Traceback (most recent call last):
Feb 21 11:29:12 homeassistant hass[11454]:   File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/loader.py", line 147, in _load_file
Feb 21 11:29:12 homeassistant hass[11454]:     module = importlib.import_module(path)
Feb 21 11:29:12 homeassistant hass[11454]:   File "/usr/lib/python3.5/importlib/__init__.py", line 126, in import_module
Feb 21 11:29:12 homeassistant hass[11454]:     return _bootstrap._gcd_import(name[level:], package, level)
Feb 21 11:29:12 homeassistant hass[11454]:   File "<frozen importlib._bootstrap>", line 986, in _gcd_import
Feb 21 11:29:12 homeassistant hass[11454]:   File "<frozen importlib._bootstrap>", line 969, in _find_and_load
Feb 21 11:29:12 homeassistant hass[11454]:   File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
Feb 21 11:29:12 homeassistant hass[11454]: ImportError: No module named 'custom_components.hass_opensprinkler.binary_sensor'; 'custom_components.hass_opensprinkler' is not a package
Feb 21 11:29:12 homeassistant hass[11454]: 2019-02-21 11:29:12 ERROR (MainThread) [homeassistant.loader] Error loading custom_components.hass_opensprinkler.sensor. Make sure all dependencies are installed
Feb 21 11:29:12 homeassistant hass[11454]: Traceback (most recent call last):
Feb 21 11:29:12 homeassistant hass[11454]:   File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/loader.py", line 147, in _load_file
Feb 21 11:29:12 homeassistant hass[11454]:     module = importlib.import_module(path)
Feb 21 11:29:12 homeassistant hass[11454]:   File "/usr/lib/python3.5/importlib/__init__.py", line 126, in import_module
Feb 21 11:29:12 homeassistant hass[11454]:     return _bootstrap._gcd_import(name[level:], package, level)
Feb 21 11:29:12 homeassistant hass[11454]:   File "<frozen importlib._bootstrap>", line 986, in _gcd_import
Feb 21 11:29:12 homeassistant hass[11454]:   File "<frozen importlib._bootstrap>", line 969, in _find_and_load
Feb 21 11:29:12 homeassistant hass[11454]:   File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
Feb 21 11:29:12 homeassistant hass[11454]: ImportError: No module named 'custom_components.hass_opensprinkler.sensor'; 'custom_components.hass_opensprinkler' is not a package
Feb 21 11:29:12 homeassistant hass[11454]: 2019-02-21 11:29:12 ERROR (MainThread) [homeassistant.loader] Error loading custom_components.hass_opensprinkler.scene. Make sure all dependencies are installed
Feb 21 11:29:12 homeassistant hass[11454]: Traceback (most recent call last):
Feb 21 11:29:12 homeassistant hass[11454]:   File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/loader.py", line 147, in _load_file
Feb 21 11:29:12 homeassistant hass[11454]:     module = importlib.import_module(path)
Feb 21 11:29:12 homeassistant hass[11454]:   File "/usr/lib/python3.5/importlib/__init__.py", line 126, in import_module
Feb 21 11:29:12 homeassistant hass[11454]:     return _bootstrap._gcd_import(name[level:], package, level)
Feb 21 11:29:12 homeassistant hass[11454]:   File "<frozen importlib._bootstrap>", line 986, in _gcd_import
Feb 21 11:29:12 homeassistant hass[11454]:   File "<frozen importlib._bootstrap>", line 969, in _find_and_load
Feb 21 11:29:12 homeassistant hass[11454]:   File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
Feb 21 11:29:12 homeassistant hass[11454]: ImportError: No module named 'custom_components.hass_opensprinkler.scene'; 'custom_components.hass_opensprinkler' is not a package
Feb 21 11:29:12 homeassistant hass[11454]: 2019-02-21 11:29:12 ERROR (MainThread) [homeassistant.loader] Error loading custom_components.hass_opensprinkler.switch. Make sure all dependencies are installed
Feb 21 11:29:12 homeassistant hass[11454]: Traceback (most recent call last):
Feb 21 11:29:12 homeassistant hass[11454]:   File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/loader.py", line 147, in _load_file
Feb 21 11:29:12 homeassistant hass[11454]:     module = importlib.import_module(path)
Feb 21 11:29:12 homeassistant hass[11454]:   File "/usr/lib/python3.5/importlib/__init__.py", line 126, in import_module
Feb 21 11:29:12 homeassistant hass[11454]:     return _bootstrap._gcd_import(name[level:], package, level)
Feb 21 11:29:12 homeassistant hass[11454]:   File "<frozen importlib._bootstrap>", line 986, in _gcd_import
Feb 21 11:29:12 homeassistant hass[11454]:   File "<frozen importlib._bootstrap>", line 969, in _find_and_load
Feb 21 11:29:12 homeassistant hass[11454]:   File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
Feb 21 11:29:12 homeassistant hass[11454]: ImportError: No module named 'custom_components.hass_opensprinkler.switch'; 'custom_components.hass_opensprinkler' is not a package

I think the plugin will need an update as I get the following error

Log Details (WARNING)

Thu Feb 21 2019 19:34:31 GMT+1100 (Australian Eastern Daylight Time)

Integrations need to be in their own folder. Change binary_sensor/hass_opensprinkler.py to hass_opensprinkler/binary_sensor.py. This will stop working soon.

I have open a issue at https://github.com/vinteo/hass-opensprinkler/issues/16

I have pushed an update, you will need to remove all the previous hass_opensprinkler.py files from the custom_components folder and just add the new hass_opensprinkler folder there.

Let me know if there are any issues. Sorry it took so long but I was on holiday and while I was away the sd card for my raspberrypi died so I had to get a new one and set up home assistant again

2 Likes

Thanks for your work and the updates.

Hi @vinteo,

I’m looking forward to installing your component. Thanks for the work!

Any chance you can integrate with the custom_updater? It would require putting a JSON file at the top level of your repository. Info is at:

Thanks!

Hi @sgruby, thanks for the suggestion, I have added the support for custom updater, please upgrade to the latest versions of both custom_updater and hass_opensprinkler and check the README for the config example.

Awesome, thanks!

Hey. Had the same trouble with inputs.
Had to create them manually.
No docker here however.
Otherwise ok, thanks for the component.
I have to understand now why scenes do not work (the rest yes)

Hello

This is great.

I am in the process of connecting my new opensprinkler in my greenhouse. I already have a few miflora sensors and have used them with miflora daemon on a raspberry pi zero for a year or two. I would also like to start irrigation on a few of the plants based on humidity values from miflora sensors. They are updating every 5 min with mqtt to home assistant.

Do you think something like this may work? Any pitfalls? have only done a dry run, and it seems to work as expected.

From my automation.yaml:

- alias: 'water01'
  initial_state: 'on'
  trigger:
    platform: time_pattern
    minutes: '/5'
    seconds: 00
  condition:
    condition: or
    conditions:
      - condition: numeric_state
        entity_id: sensor.plante1_moisture
        below: 30
  action:
    - service: input_number.set_value
      data_template:
        entity_id: input_number.s01_timer
        value: '1'
    - service: switch.turn_on
      data:
        entity_id: switch.s01

- alias: 'water02'
  initial_state: 'on'
  trigger:
    platform: time_pattern
    minutes: '/5'
    seconds: 00
  condition:
    condition: or
    conditions:
      - condition: numeric_state
        entity_id: sensor.plante2_moisture
        below: 30
  action:
    - service: input_number.set_value
      data_template:
        entity_id: input_number.s02_timer
        value: '1'
        #to spread out solenoid power and water preasure
    - delay: '00:01:30'
    - service: switch.turn_on
      data:
        entity_id: switch.s02

I also tested watering times under one minute with the following action in automation:


  action:
    - service: switch.turn_on
      data:
        entity_id: switch.s04        
    - delay: '00:00:10'
    - service: switch.turn_off
      data:
        entity_id: switch.s04

It also seems to be working fine.

I finally got it working … well kinda…
Sensor Work fine. However, when I try using the which, I have the following error.

Do any you encounter this when setting it up ?

In the frontend
image

In the log

2019-06-27 21:50:23 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection.1852492976] 'NoneType' object has no attribute 'state'
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 121, in handle_call_service
    connection.context(msg))
  File "/usr/src/homeassistant/homeassistant/core.py", line 1150, in async_call
    self._execute_service(handler, service_call))
  File "/usr/src/homeassistant/homeassistant/core.py", line 1172, in _execute_service
    await handler.func(service_call)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 194, in handle_service
    required_features
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 316, in entity_service_call
    future.result()  # pop exception if have
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 337, in _handle_service_platform_call
    await getattr(entity, func)(**data)
  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/switch.py", line 47, in turn_on
    self._station.turn_on(int(float(mins.state)))

I still haven’t figured out how to fix this, but you can manually create the input_numbers to get around this. Add something like this to your config:

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

Replace <station_name> with your station name, match the ones for sensors/swicthes that were created. Create one for each station

Tx Vinteo, This work Nicely.

I suggest adding this to your documentation. It may help other users.

I see that updating the sensor can take some time (longer than the scheduled update interval of 0:00:05. See warning below.

Do you support using a longer schedulers update time ?

2019-06-28 08:28:27 WARNING (MainThread) [homeassistant.components.switch] Updating hass_opensprinkler switch took longer than the scheduled update interval 0:00:05