Garden Irrigation

that I am :grin:. it does seem to be quite an uncommon name… everyone else here seems to use ‘irrigation’. Here (and what I assumed was all of Aus) was to call it ‘retic’, short for reticulation. I figured that NO-ONE on here would know what I meant if I used ‘retic’, so I elaborated!

Hi just make sure you haven’t made any mistakes in the entity names. I have been struggling for some time with incorrect next run times, just to realise that I renamed switches and the last_changed state was reading incorrect entities.

Hi, I need 8 zones as well (my old timer systems has 8 valves). Can you share a link to the hardware you used to handle 8 zones ?
Thanks,
Martin

Hi,
you can use : 5V 8 channel relay board or this one.

To control them use this kind of Wemos as it has enough GPIOs available to control 8 channels.

If you want almost off the shelf you can use 2 pcs of Sonoff 4CH PRO this or this

Anyone been using Mi Flora sensor? Worth it?

anyone can tell me why my log fills with this stuff and what to do against it.

2018-10-18 20:04:30 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
    result = coro.send(None)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity.py", line 310, in async_update_ha_state
    self.entity_id, state, attr, self.force_update, self._context)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/core.py", line 903, in async_set
    context)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/core.py", line 673, in __init__
    "State max length is 255 characters.").format(entity_id))
homeassistant.exceptions.InvalidStateError: Invalid state encountered for entity id: sensor.zone2_time_today. State max length is 255 characters.
2018-10-18 20:04:30 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
    result = coro.send(None)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity.py", line 310, in async_update_ha_state
    self.entity_id, state, attr, self.force_update, self._context)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/core.py", line 903, in async_set
    context)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/core.py", line 673, in __init__
    "State max length is 255 characters.").format(entity_id))
homeassistant.exceptions.InvalidStateError: Invalid state encountered for entity id: sensor.zone3_time_today. State max length is 255 characters.
2018-10-18 20:04:30 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
    result = coro.send(None)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity.py", line 310, in async_update_ha_state
    self.entity_id, state, attr, self.force_update, self._context)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/core.py", line 903, in async_set
    context)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/core.py", line 673, in __init__
    "State max length is 255 characters.").format(entity_id))
homeassistant.exceptions.InvalidStateError: Invalid state encountered for entity id: sensor.zone4_time_today. State max length is 255 characters.

Sorry for the late reply but here is the list of parts and a link to go with each to purchase. I ended up modifying a few things and switched to a 6 zone and added in buttons to manually water individual zones. So what I have is 2 nodemcu, one controls the button configuration and the other nodemcu controls the relays that would power on/off the irrigation valves.
The nodemcu that controls the relays is running tasmota and is fairly straightforward on how that is setup. I just soldered a jumper wire to each of the NO contact on the back of the relay board that way I just had to bring the power in on the first NO and then the rest would have the power. Also by doing it that way it made it for a nicer/cleaner look to just having to plug in the valve wire go in according to zone/relay #'s.
I choose to use terminal blocks to help keep nice and clean as I knew it would get messy with the amount of wires going in.
So I have a 24vac sprinkler transformer power going to NO contact on relays for valve control, then I took that same ac power to a Altronix AL624 Proprietary Power Supply to convert that to DC to power the nodemcu’s.
I also have a sonoff basic to control the main irrigation pump. That is also running tasmota.
The nodemcu that is controlling the buttons is using a sketch I put together and is up on my github.

Altronix AL624 Proprietary Power Supply https://www.amazon.com/dp/B0006TVW5M/ref=cm_sw_r_cp_apa_ZKDYBb76VZ1TV

BUD Industries NBF-32016 Plastic ABS NEMA Economy Box https://www.amazon.com/dp/B005UPANU2/ref=cm_sw_r_cp_apa_bMDYBbR9N3FBH

ESP8266 Development Board NodeMCU Lua V3 WiFi with CH340G USB and Base Shield https://www.amazon.com/dp/B075VMLRKS/ref=cm_sw_r_cp_apa_-MDYBb9853X8F

RGBZONE 120pcs Multicolored Dupont Wire Breadboard Jumper Wires Ribbon Cables Kit https://www.amazon.com/dp/B01M1IEUAF/ref=cm_sw_r_cp_apa_FNDYBbQ9HWRDY

LANDZO 8 Channel 5V DC Relay Module Expansion Board for Arduino Raspberry Pi DSP AVR PIC ARM https://www.amazon.com/dp/B01NBUDHPB/ref=cm_sw_r_cp_apa_BODYBbYNKY7TH

Qishare 15 Pcs Dual Row 5 Position Screw Barrier Terminal Block https://www.amazon.com/dp/B076BZ7W21/ref=cm_sw_r_cp_apa_aPDYBbA3M3K5C

uxcell 10 Pcs PG9 Waterproof IP68 Nylon Cable Gland Joint Adjustable Locknut for 4mm-8mm Dia Cable Wire https://www.amazon.com/dp/B01MQWU2NM/ref=cm_sw_r_cp_apa_7QDYBbT5SWSRP

Orbit Sprinkler System Power Source Transformer https://www.amazon.com/dp/B000VRYVYS/ref=cm_sw_r_cp_apa_BRDYBbPQ2XBE8

Cylewet 12Pcs 12mm SPST No Reset Switch Push Button Switch (Pack of 12) CYT1092 https://www.amazon.com/dp/B075VBWFM6/ref=cm_sw_r_cp_apa_zSDYBbDTJG699

Sonoff WiFi Smart Switch Moudule https://www.amazon.com/dp/B0795F4LXY/ref=cm_sw_r_cp_apa_iTDYBbMEEZ24V

1 Like

Thanks for the info. That led me to this 8ch module with USB and what looks like an AVR on it.
The possible AVR has a header next to it. I’m wondering if I/we can reflash the AVR with Arduino code to then accept serial from NodeMCU or ESP8266 module mounted to the back of it and use this module to expand and drive the 8 relays. If so, it’s a two module watering system solution for under $15US…
USB 8Ch module
Module with more info

Edit: Actually this module might be closer to what I’d like.
8Ch RS232 serial Relay
A project with serial protocol info.

I’m going to drop two other 8 channel relay board suggestions here for comment.
The first is a complete system controlled by Bluetooth for about $20US. Now I know little about bluetooth via HA so any comment welcome about how easy or hard getting HA on Raspberry Pi 3 BT to control this module ?
The second 8 channel module is controlled by Modbus serial. While this would need a serial interface to my HA Pi it might be easier than the above as HA seems to have a Modbus control component. Again any useful comment accepted as this is a third possible option now.
Due to the cheap price and fairly complete nature of these modules it is going to be economic enough to buy two, so to have a spare to swap out (which is important in a hot Australian summer…).
8 Channel BT controlled

8 Channel Modbus controlled

Edit: Found this info about the BT 8 way relay. Looks like it might be just serial strings over BT.
Parameter:
1.Operating voltage: DC 12V
2.External relay is required to play a switching function
3.Bluetooth name is QS-8RELAY password:123456
4.Revise the name fD 02 ef + The total length is 1 bytes + length + Device name byte (The longest is 10 bytes) + length + matching password(PIN the longest is 6 bytes)+ 5d
Modify successfully:df ff 00 00 5d Modify failed, No response:df 00 00 00 5d

8 way control code table:
1 way open: FD 02 20 01 01 5D 1 way Close: FD 02 20 01 00 5D
2 way open: FD 02 20 02 01 5D 2 way Close: FD 02 20 02 00 5D

8 way open: FD 02 20 08 01 5D 8 way Close: FD 02 20 08 00 5D
1-8 way open: FD 02 20 EF FF 5D 1-8 way Close: FD 02 20 EF 00 5D
Esc DF FD XX XX 5D //XXXXThere are 16 persons, 1 for open and 0 for Close

Specifications:
Application range: remote control switch
Model: QS - 64
Contact load: DC, AC
Contact form: switch
Rated current: 10A
Rated voltage: 5V 12V
Size: 7 x10cm/2.76 x 3.93inch
Power supply voltage: DC5V, DC 7-40v, AC90-240V
Input current: 1A
Communication mode: 4.0 Bluetooth (CC2540)
Communication distance: 6-10 m (specific for different actual conditions)
Delay time range: 1-255 seconds.
Control voltage: DC 0-277V 10A, DC0-30V 10A

Anyone using my garden irrigation system (I know there at least a couple of you from messages I have received) might want to look at this thread.

1 Like

A very neat way to do an eight station controller. One board that’s it !


WiFi eight channel relay on Git
info
Instructibles article using the board

i got too errors in log since 0.81.1
after modifying:
{{(float (duration) * 60) | round}}
by
{{duration | float | multiply (60) | round}}

I still have many mistakes

Help!, please

Thanks
**sorry for my bad English

Yes, I was about to post here about this…

Check this thread. A template question after 0.81 upgrade

There was a big change in 0.81 that affected template sensors. The change also highlight that I wasn’t setting them up the best way :roll_eyes:

The changes needed aren’t big, read the thread and hopefully you can work it out. Post here if not and I will try to help you.
.

1 Like

Here’s my (pretty simple and fun) apartment and rental friendly irrigation system. Main hardware is a cheap USB pump off Ebay, a smart switch (xiaomi), some Mi Flora sensors, and a xiaomi water sensor (which is not operational at this point).

1 Like

Hey All,

Got into HASS about a year now and slowly building up my smart home. Spent a bit of time making my own irrigation project. I really appreciate the code petr has provided, wish I had of seen it earlier, but will probably integrate a couple of pieces of code into my setup at some point.

I have done mine slightly differently, possibly made more work for myself in doing it the way I did. E.g. using a microcontroller board with two microcontrollers, multiple flow meters, fet relay board, moisture sensors.

But it works for me at least.

All the code is in my github repository.

https://github.com/rowdy15/HomeAssistant-IrrigationProject

So does the online weather adjustment work now?

I’ve created a component to estimate the time to irrigate. The model is taken from leaky bucket model from networking

component is here:
https://github.com/hhaim/hass/blob/master/custom_components/wb_irrigation/init.py

This is how you use add it

wb_irrigation:
  api_key: !secret openweathermap_key
  rain_factor: 120
  max_ev: 3750 
  min_ev: -1500.0
  name: "wb_irrigation"
  longitude: !secret accurate_longitude
  latitude: !secret accurate_latitude
  taps: 
    - name: p1
    - name: p2

1 Like

@hhaim: I’m not aware how to install extra components. Could you please give a short instruction how to do it? Any how does it work together with the “other” component? Do you add some automation asking your sensor for a special condition?
Sorry for noob question - I’m just a user :wink:

You can read in the following link how to install

This is not a full solution yet, just the complex part to add sensors that will estimate the irrigation time per pipe base on actual weather conditions. I will add the automation block soon (simple)

Hi iz3man

I’ve updated the automation you can look into the code again (in my case two taps)

The ingredients

  1. Sonoff 4ch pro (up to 4 taps) + Tasmota
  2. Appdaemon + hass

hass configuration:


wb_irrigation:
  api_key: !secret openweathermap_key
  rain_factor: 120
  max_ev: 3750 
  min_ev: -1500.0
  name: "wb_irrigation"
  longitude: !secret accurate_longitude
  latitude: !secret accurate_latitude
  taps: 
    - name: p1
    - name: p2

Create sensors wb_irrigation_p1 and wb_irrigation_p2 that will calculate the time to irrigate based on ev/rain
The units are ev (~100 for a cold day and ~300 for a very hot day). Rain will add factor* total_mm (ev) to the queue

The full configuration is here (with switch for tasmota and some sensors)

Appdaemon:

The automation part

# irrigation app
wb_irrigation:
  module: heat_app
  class: CWBIrrigation
  m_temp_celsius: 26 #fill from here https://www.holiday-weather.com/[your location]/averages/
  m_temp_hours: 12 #fill from here https://www.holiday-weather.com/[your location]/averages/
  enabled: input_boolean.wbi_enabled #disable irrigation  # disable the irrigation 
  water_sensor: sensor.water_total_external_norm # read total water  # optional to read water global sensor in litters 
  taps: 
     - name: p1  # the name of the tap
       days: [1,3,5]  # 1-7 1 for sunday, .. 7 for saturday 
       stime: "05:45:00" # time to start irrigating 
       m_week_duration_min: 60 # weakly total time in minutes at the hottest season 
       switch: switch.wbi_p1 # the switch for on/off - on the tap is open, off - close 
       manual_duration: input_number.wbi_p1_duration # the time in minuts for manual on/off 
       queue_sensor: sensor.wb_irrigation_p1   # the calculated queue/bucket sensor from wb_irrigation sensors  
       water_sensor: sensor.wbi_water_p1 # calculated from input water_sensor tht total for this tap 
       
     - name: p2
       days: [2,5]
       stime: "05:00:00"
       m_week_duration_min: 20
       switch: switch.wbi_p2
       manual_duration: input_number.wbi_p2_duration
       queue_sensor: sensor.wb_irrigation_p2
       water_sensor: sensor.wbi_water_p2