In this post the instructions on how to connect a rain sensor ON/OFF type to the hydrosys4 system.
This type of sensors are made with a material that expands with water, this expansion trigger the activation of a mechanical switch. Until the material is wet, the switch is OFF (open circuit), so this state can persist for several days until the material dries. The switch is normally closed, when the rain is detected the switch opens. This type of sensor is made to be connected directly in series with the valves, it can controls several valves at same time if it is connected between the valves and the common. This is the easy way to connect it. Anyway in case you want to monitor the activity of the sensor and you want to flexibly associate the valves to be controlled by the rain sensor, it is possible to connect the sensor to the one of the pin of the raspberry set as interrupt. I made a video about the Rain Sensor connection and setting here:
Below a summary of the setting:
First choose a PIN which is not already present in the "hardwareSetting" table "pin" field.
The "hardwaresetting" table indicates the GPIO PIN number.
For the Hardware connection just connect the selected RPI pin to one of the Rain sensor wire and the other wire to the ground.
For the Software Setting, first you need to create an interrupt to be associated to the GPIO PIN;
go to "hardwareSetting" page, click "edit", and in the first row add the following setting:
Click "add" and then "confirm and Save"
At this point you should be able to see this sensor in the "interrupt" page.
Go to "interrupt" page, select the relay you want to be connected to the RainSensor and apply the following setting:
When the sensor activates (the circuit opens) an interrupt is triggered, the system will set the relay to zero and start a blocking period of 20 minutes in which any other command to the relay will not take effect. After 20 minutes, it checks the sensor level, if this is still open then it extend the blocking period of other 20 minutes and so on until the sensor closes the circuit and the blocking period is not renewed anymore.
The graph will provide the visualization of the blocking period, as in the example below:
Is this really working every 15 minutes? When I watch the video text output it seems the software is printing out...
Interrupt Level High, Do not stop blocking period, Extend it ...
and this comes about every 15 seconds ???
Namaste, Kevin
Hello all,
Sorry for my late reply, I was a little busy.
Thank you for your quick reply, I will open a new post as there will probably be more people who might find the "close window in rain/storm" feature useful.
However, I need to reinstall the hardware first. (Rain sensor went on a trip with my wife :))
many greetings
Reini
Hi, I can attache the hardware setting page, but I do not use the rainsensor interruption right now. So I no have interrupt set up. I had issues about the radinsensor interruption.
Another thing, can you open a new post, so it will be easier to search in case other people want to implement similar scenarios.
Hi,
which part do you need?
Please define and I can send.. A
haha, no crystal ball here 😁. can you share a screenshot of your setting so I can have a look at it.
Regards,
Angelo
Hi Angelo, I thought to use the rain sensor to close the windows and bought a cheap rain sensor with relay contact. Installed and according to your instructions set the parameters, closing the windows (hbridge) worked immediately. Wow, I would not have expected so. After drying the sensor, the windows opened again. At a second try it didn't work anymore. Now I changed some values in the interrupt settings, but I can't get it to work again. 🤔 You don't happen to have the crystal ball at hand or settings that make my Hbridge work again? best regards Reini
This shows that the NTP works, so it will work also if you click the button manually. It will work randomly if your WiFi signal is weak or your internet connection is unstable.
Hi
Thank you. It is very interesting 'caz there is nos such a warning message in the log.
But I found this:
00:20:06 hydrosys4.networkmod - INFO External IP address xxx.xx.xxx.62 00:20:06 hydrosys4.selectedplanmod - INFO Heartbeat check , Check IP address change -xxx.xxx.xxx.62- and previously sent -- 00:20:06 hydrosys4.selectedplanmod - INFO System has been reconnected, IPEXTERNALSENT was empty 00:20:06 hydrosys4.selectedplanmod - INFO Check system clock vs NTP (Network Time Protocol) 00:20:07 hydrosys4.selectedplanmod - INFO Network time NTP: 24/08/2020 00:20 00:20:07 hydrosys4.selectedplanmod - INFO System time NTP: 24/08/2020 00:20 00:20:07 hydrosys4.selectedplanmod - INFO Difference between system time and network time, diffsec = 0 00:20:07 hydrosys4.selectedplanmod - INFO Clock OK 00:20:07 hydrosys4.selectedplanmod - INFO Target IP address= 192.168.2.118. Current access point IP addresses= 192.168.2.118
But when I try to sync manually it does not work. On the other hand the system time is precise...
Another case when this can happen is if the system is connected using the LAN cable and WiFi, the routing table will set the first route for the ethernet gateway. If then the LAN cable is eventually disconnected, the system will not be able to connect anymore to internet as the routing table will not update.
You can check the routing table using the command: route -n
If you go to the hardwaresetting page and download the "current log file" you may notice that in the file there is a warning message as follow:
hydrosys4.selectedplanmod - WARNING not able to establish an internet connection
Hy
The system is connected to the internet. Thats the problem.
I know the ntp services, so thats why I did not understand the error message.
Hi There,
In case, better to open another post relevant to clock.
Normally you get this message "Error not able to get the Network time using NTP protocol" when you are not connected to internet. There are several NTP servers on internet which distribute the time.
If you are connected to internet, the system will automatically update the time. If you are not, then you have to take some steps as described in the "External Hardware Clock" section of the following page:
Please consider that the NTP protocol uses a specific default port (123) for communication, if this port is blocked by the service provider or by a firewall, then you will get the same error message.
One more q please.
When I click "ReadNetworkTime" button I get the following message: "Error not able to get the Network time using NTP protocol" And the other side I realize the system clock is not precise. I had to reset the time.
How can I fix this network update time issue?
Is it possible the system auto update the time from net?
Hi, sorry it was holiday:) So Yes the pin is ok, it works properly.
OK, I try to do the test you described.
ok, so back to the issue, first of all, please confirm that when you use a jumper cable the reading in the setting page changes according to the connected/disconnected with 0/1 values. So we are sure the pin works properly.
Then set only one watering line with the interrupt active on "pre-emptive blocking" with setting according in the beginning of the post.
Start with jumper closing the pin to ground then open the circuit for more than 40 minutes, then close the circuit again. During this period you can go to setting and test if the actuator is blocked.
Take a screenshot of the graph.
Thx
I try to understand but I'm not sure.
I followed the guide you made to set the rainsensor up. My problem started with the situation when I saw my system watering during a full rainy day when the sensor already activated (disconnected the pin)...
So I tried to figure out what is wrong in the logic? Then I saw the graph with wierd datas... so I did not understand whats wrong. So my issue is in a config mistake? Sorry I try to understand :)
Regarding the temperature and other sensors value in the home page, they are the average / min / max of last 24 hours. To see the last reading you can go to setting page. When the page loads it will show the last reading for each sensor.
Let me explain a little better the value on the graph relevant to the "interrupt" setting. The value indicates the number of actuators currently in blocking status. In case of rain sensor, when it opens all the different line will enter blocking status for a certain period set for each line. When this period ends, if the pin still "open" then the blocking status is renewed, but when the pins "closes" then the lines will start to end their own blocking period in different time causing the value on the graph to reduce until all the lines are out of the blocking period and the value go to zero. You can check if a line is currently blocked by trying to activate it in the setting page. If blocked you will se the status change to "blocked".
Hi
thank you, ok I see. When I mentioned the values I mean the graphs. And yes I have multiple waterings with different delay times.
So it can cause multiplied value on the graph in the interruption line?
Anyway I see temp data on the home page. It's great. Is this temp data an average value of the day? How can I see the temp data as the actual value on the home? It would be so practic when I load the page I could see the temp data of that moment. (last measured one)
Thx
Adam
Hi, when you speak about the values, what are you referring to? the reading in the setting page or the values on the graph?
The values on the graph are the sum of the (0/1) values of the irrigation lines that you set to work with the rain interrupt. So if you set 5 lines the value on the graph is 5. If you set different time delay for different lines, you will see values in the graph ranging from 2 to 5. The graph in practice will show the actual number of lines subject to the interrupt.
To clarify this concept you can set only one watering line with the rain interrupt and try it.
Please consider that also the calibration will alter the values.