Sprinkler System - Melnor RainCloud

Hello guys,

I’ve been looking for some alternatives for an intelligent sprinkler system to integrate within Home Assistant.

Having said this, Rachio Smart Sprinkler system requires a professional system while I was looking something more like to use my current hoses and sprinklers that I have.

With that in mind, I’ve found this device http://www.melnor.com/16043-raincloud-smart-water-timer where I can use my already own regular hoses and control it via my smart phone.

They don’t have an API, however I’m working on a project to create a Python library to integrate this. It is still in progress, but you can have an idea by accessing https://github.com/tchellomello/raincloudy.

So, I would like to know if someone else is interested on this kind of solution and if so, what you think that would be nice to have integrated in HA.

Thanks
mmello

A friend developed this ESP8266-based solution for SmartThings and I’ve been meaning to try and shoehorn that work into Hass. If you do have a traditional in-ground system you’ll have a hard time beating $17 for an 8-zone sprinkler controller. The trick is getting Hass to deal with sprinklers in some consistent and useable manner.

This of course doesn’t apply to your situation as it’s meant to drive an existing installed solution. So, to answer your question as to what I’d like to see Hass do more generally to support a sprinkler system, here’s a quick list off the top of my head

  • Normal irrigation scheduling, meaning the ability to set one or more schedules on set days at set times, with dwell time settings for each zone along with safety measures such as a maximum number of running zones, minimum run time for a zone, and a minimum time to switch between zones.
  • Pump control for well-fed systems
  • Weather forecast integration (if today’s forecast calls for > 1 inch of rain, don’t run the spinklers)
  • Individual zone control to start/stop a zone for automation purposes (if OpenCV detects rabbit activity in garden, turn on the garden zone for 1 minute. If it detects my wife walking out the front door, trigger camera recording and turn that zone on)
  • Individual zone enable/disable for maintenance or other outages
  • Floorplan integration for a full clickable map of the yard and individual zones
  • Pull data from soil moisture sensors and adjust zone run times based on readings

Hello @luma,

Thanks for your suggestions. I’m going to work on some items that you just suggested.

mmello

Hello,

Just to share a screenshot from the Melnor RainCloud Sprinkler system support to Home Assistant.

The configuration basically will be like below:

# configuration.yaml
raincloud:
  username: foo
  password: bar
  watering_minutes: 30

It’s been working great so far. @luma what do you think?

I’m finishing some details and I should post the PR soon.

Thanks

2 Likes

Looks great so far! How does scheduling a sequence of zones work? Like, I want to kick off Zone 1 at 5:00am for 20 minutes, then Zone 2 for 15 minutes, then Zone 3 for 5 minutes, etc.

@luma It’s working great so far.

I just bought one of these a couple of weeks ago and now I see the release notes for .55… Awesome.

Thank you for writing this.

I just quickly added the component, sensors and switch and noticed that the created device names looked a bit odd to me:

❩#─► curl -s -X GET -H "Content-Type: application/json" http://${host:-localhost}:8123/api/states | jq '.[]|select(.entity_id|contains("'._'"))|{entity_id, state}'
{
  "entity_id": "binary_sensor._watering",
  "state": "off"
}
{
  "entity_id": "binary_sensor._watering_2",
  "state": "off"
}
{
  "entity_id": "binary_sensor._watering_3",
  "state": "off"
}
{
  "entity_id": "binary_sensor._watering_4",
  "state": "off"
}
{
  "entity_id": "switch._manual_watering",
  "state": "off"
}
{                                                                                   
 "entity_id": "switch._manual_watering_2",
  "state": "off"
}
{
  "entity_id": "switch._manual_watering_3",
  "state": "off"
}
{
  "entity_id": "switch._manual_watering_4",
  "state": "off"
}
{
  "entity_id": "switch._automatic_watering",
  "state": "off"
}
{
  "entity_id": "switch._automatic_watering_2",
  "state": "off"
}
{
  "entity_id": "switch._automatic_watering_3",
  "state": "off"
}
{
  "entity_id": "switch._automatic_watering_4",
  "state": "off"
}
{
  "entity_id": "sensor._rain_delay",
  "state": "0"
}
{
  "entity_id": "sensor._next_cycle",
  "state": "Off"
}
{
  "entity_id": "sensor._remaining_watering_time",
  "state": "0"
}
{
  "entity_id": "sensor._remaining_watering_time_2",
  "state": "0"
}
{
  "entity_id": "sensor._remaining_watering_time_3",
  "state": "0"
}
{
  "entity_id": "sensor._rain_delay_2",
  "state": "0"
}
{
  "entity_id": "sensor._remaining_watering_time_4",
  "state": "0"
}
{
  "entity_id": "sensor._next_cycle_2",
  "state": "Off"
}
{
  "entity_id": "sensor._next_cycle_3",
  "state": "Off"
}
{
  "entity_id": "sensor._rain_delay_3",
  "state": "0"
}
{
  "entity_id": "sensor._next_cycle_4",
  "state": "Off"
}
{
  "entity_id": "sensor._rain_delay_4",
  "state": "0"
}

I would expect to see raincloud or something in the device name. Did I misconfigure something or is this expected? I wanted to make sure before finding out I did something wrong and have to change all of the device names.

Hello @jceloria,
Interesting… it looks like it did not pick the names as it should.

The way the name is populated as follows:

136 class RainCloudEntity(Entity):
137     """Entity class for RainCloud devices."""
138 
139     def __init__(self, data, sensor_type):
140         """Initialize the RainCloud entity."""
141         self.data = data
142         self._sensor_type = sensor_type
143         self._name = "{0} {1}".format(
144             self.data.name, KEY_MAP.get(self._sensor_type))
145         self._state = None
146 
147     @property
148     def name(self):
149         """Return the name of the sensor."""
150         return self._name

So, if you install or use the raincloud library as showed at https://github.com/tchellomello/raincloudy, are you able to see the device names? For example:

from raincloudy.core import RainCloudy
raincloudy = RainCloudy('username@domain', 'secret')
raincloudy.controller.name
'MelnorC001'

raincloudy.controller.faucet.name
'Backyard'

Please let me know if that worked for you.

Thanks @tchellomello, sorry it took me a bit to respond. I get the expected result when using the library directly:

$─► sed 's/\(USERNAME =\|PASSWORD =\).*/\1 XXXXXX/g' raincloud.py && echo -e '\nRunning script:' && ./raincloud.py
#!/usr/bin/env python

from __future__ import print_function
from raincloudy.core import RainCloudy

USERNAME = XXXXXX
PASSWORD = XXXXXX

raincloudy = RainCloudy(USERNAME, PASSWORD)
print("Controller name: {}".format(raincloudy.controller.name))
print("Faucet name: {}".format(raincloudy.controller.faucet.name))

Running script:
Controller name: d88039ae4e8a
Faucet name: d316

Could you please share the HASS configuration and logs?

Sorry @tchellomello , the whole day job thing gets in the way…

log:
https://gist.github.com/63c2dc55526d84ab371321e422f0abfd

config:
http://dog.re/homeassistant

Just got a raincloud and trying to get it to work with HASS 0.55. Getting an error -

configuration.yaml:

raincloud:
username: secret
password: secret

Log:
2017-10-26 14:25:48 ERROR (MainThread) [homeassistant.setup] Error during setup of component raincloud
Traceback (most recent call last):
File “/srv/homeassistant/lib/python3.4/site-packages/homeassistant/setup.py”, line 194, in _async_setup_component
component.setup, hass, processed_config)
File “/usr/lib/python3.4/asyncio/futures.py”, line 388, in iter
yield self # This tells Task to wait for completion.
File “/usr/lib/python3.4/asyncio/tasks.py”, line 286, in _wakeup
value = future.result()
File “/usr/lib/python3.4/asyncio/futures.py”, line 277, in result
raise self._exception
File “/usr/lib/python3.4/concurrent/futures/thread.py”, line 54, in run
result = self.fn(*self.args, **self.kwargs)
File “/srv/homeassistant/lib/python3.4/site-packages/homeassistant/components/raincloud.py”, line 100, in setup
from raincloudy.core import RainCloudy
File “/srv/homeassistant/lib/python3.4/site-packages/raincloudy/core.py”, line 4, in
import urllib3
ImportError: No module named ‘urllib3’

Thanks for reporting this issue. I’ll fix ASAP.

For now you can do:

pip install urllib3

Created PR on raincloudy library: https://github.com/tchellomello/raincloudy/pull/20
raincloudy library updated: https://github.com/tchellomello/raincloudy/releases/tag/0.0.4
HASS PR# https://github.com/home-assistant/home-assistant/pull/10225

Is it a python version issue? See below:

pi@hassbian:/home/homeassistant/.homeassistant $ sudo pip install urllib3
Requirement already satisfied (use --upgrade to upgrade): urllib3 in /usr/lib/python2.7/dist-packages
Cleaning up…

It seems you are trying to install the urllib3 on the system instead of the virtualenv you are running HASS (because of python.27)

Are you using Hassbian?

Ok, it works now after installing urllib3 in the virtualenv. I’m not seeing the nice zone cards like your screenshot, but I can toggle the switches etc.

Thanks!

Glad it worked!! It should not happen again on future versions!! Thanks for reporting it!

The code worked great for me. I wrote a little code to send me an email if the controller goes offline.
Looking forward to having it support more than one valve unit!

Is there an update on this project?

The way my house is I would need two of these controllers running 5 hoses, wish I could get with one controller.

Is it possible to have two of these working together yet?

Does anyone have the timer working in conjunction with the weather?

I am a noob using hassio

Thanks

@Bschaff I’m glad that you are interested in this project.

Currently, the external library only works with 1 controller but if you are willing to test it, please open a new issue at https://github.com/tchellomello/raincloudy and I will be glad to work with you add support to the library if you can test it.