My Garden Irrigation

I have mine normally open.

Yes sorry, that is what I meant. I should have been clearer, my question was probably misleading. I was meaning to ask if @mviamin had them wired the ‘wrong’ way rather than checking if he had them the right way…
:upside_down_face:

Did you manage to do anything on this?

Not yet unfortunately. I’ll see how I go for time this weekend… Part of the problem is that I accidentally fried the ESP running it so am waiting on the replacement to arrive, but I can still create a post about it I guess, it just doesn’t work right now :grimacing:

1 Like

Hi. During holidays I finally installed my sonoff 4ch in place of the classic irrigation timer. Everything is working perfectly! Thank you klogg!
PS: I’m not using weather adjustments.

1 Like

Hi klogg,
Are your transformers 24V AC? If so, can you tell me where you got them?
Cheers,
Sean

You can use this https://www.amazon.it/dp/B00K1CWEUG/ref=cm_sw_r_em_apa_i_esrzDb5RQ4YZ2

Yes they are 24V AC.
Are you in the UK? I think I got them from ScrewFix but I will try and find out for sure later.

I am in the Netherlands, but am in the UK often and can have items shipped to an address there.

And just saw ita’s link: I hadn’t realized doorbell transformers are 24V AC. That does simplify things.

thanks both

Did you ever fix this? I have just seen a thread that might be connected Relays change state on boot and restart - how to fix?

or then again it might not. I am by no means an expert.

In thread You linked I’m connecting relays directly to Raspberry PI, but @mviamin is using ESP to control relays - that’s different hardware :slight_smile:

Yeah I know but I just thought there might be a connection :upside_down_face:

I did say I wasn’t an expert!

I did say I wasn’t an expert!

Same here :smiley:

1 Like

Hi mviamin,
Perhaps the problem is the type of relay you have. On the “output” side, relays can be set as normally open or normally closed. On the “input” side they can be set as trigger high or trigger low.

Some relays are trigger low.
While others let you choose

The trigger defines whether the NO switch will be closed when your ESP32 GPIO has 1. current is flowing through (high) or 2. when no current is flowing through (low).

I think the best way to have a relay for a water valve is normally open with trigger high.

Cheers,
Sean

Yes, it was fixed. The issue was the 24v power supply supply and/or maybe the way I wired it inverting the + and the -, not sure. When I changed the power supply that behavior disappeared and now all is good. I posted on the other thread as well but i want to mention here that I found this video very informative for newbies wanting to understand the specific function of GPIOs. @Misiu It does not cover RPI, only ESP8266 and ESP32 but there may be a similar one around.

Ha ha, yes I have seen that video and that is what made me wonder if there was a connection. Most of it went over my head though when I watched it but I filed it under, “Things to remember I need to understand better”!

Incidentally, I have updated my fork of @klogg ’ s code on github. While I used most of his code (thanks !! :), i have adapted to my own situation :

  • I needed 13 different zones grouped in 2 areas, East and West so I have 2 separate ESPs/Relays for that
  • I do not use the Weather Adjustments part. Where I live we have no rain at all for part of the year and quite a bit in the winter, therefore the master on/off switch is good enough. Hope this helps someone as much as the original work helped me…
1 Like

I have to say I never expected any interest from anyone else when I wrote this. It was my first real HA project and at the time I was just glad to get it working. I am very happy that others are using it and especially happy to see that you have managed to adapt it to your different needs without too much trouble.

Hello everyone, it would be possible to match the time of the sunset with the input_number.set_value service so that the time of the last irrigation is automatically updated with the time of the sunset
Greetings and thank you

Hello, everyone. I have already bought my Hw based on Sonoff 4CH Pro R2 and have been adjusting the code to my seven zones and peterburga Sonoff implementation (had to add some delay to avoid the Web Service of eWelink to crash). But, unfortunately I am stuck and not able to make it work after 3 days looking to the code. I’ve been suffering a lot on each step as I am not an expert on HA and my coding skills are a bit rusty. Can someone please tell me where in the code each of the switches are turned “ON” ?, I am trying to make lot of reverse engenieering to understand where my problems are. A “high level” idea on how the code works would also be useful. Apologies, up front.