Garden Irrigation

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

Thanks! That looks great. I’ll try to implement that and will report back.

@hhaim: What’s platform: accumulator ?

It is another custom component to accumulate time (week/month) faster without database query. In this case the total time each tap is open.

It is not mandatory

Thanks. Could you please tell me where to get it? Googled it, but it doesn’t give any results.

At the same place :slight_smile:

Copy this folder to your place and then try to remove what is not needed

Sorry. My fault. The most obvious was not my first thought. :wink:

I guess I’m making progress, but i have no clue what value to enter here:
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/

If i enter VIENNA for example, it give 19C for July and -1C for January. Same goes for sunshing which is 2h in January and 9h on July. Should i sum up all monthes and divide by 12? Or take the hottest only? Or …

Did i mention that i totally LOVE that component and i really appreciate your work and your effort of posting it here!!

Btw: I’m also struggeling with the automation stuff. I saw you’re using appdaemon and apps. I don’t use appdaemon at all. So how can i still use the automation stuff - as far as i understand it that’s the BRAIN behind all of it?!

You should take the August average day temperatures (the hottest for Vienna and Israel) - in your case it is 26 and 11 hours of day light. It is used to calculate the maximum evaporation.
The total week time of irrigation (automation yaml) should match this period of time (August) - in my case for p2 it is 60 min in August.

If you already have a working AppDaemon, it shouldn’t be a problem to copy the automation code and YAML and make it work.

Let me know what does not work you