I have no luck with flowers and plant.
My balcony has poor sunlight and more I use to forgot to water them!
So I had the idea to use a standard irrigation computer, but I have no water on my balcony and more... I wish to have small vases with small plants
So I decided to start a project with Raspberry and implement it in Domoticz.
Unfortunately my domoticz server is quite too far from the balcony so I had to use a new raspberry and find a way to communicate with the Domoticz main server.
As first my intention is to use a second domoticz installation and configure it on the main one as a remote server.... but all these stuff a a second step
At the moment my hardware is:
Raspberry PI3
8Switch Relay
Custard PI3 (a ADC 8 port)
5x YL-38 soil moist sensors
12v Power suppy
6mm pipes, valves, connectors and stuff
The intention is to run the script once a day and update via API/Json the domoticz main server
Actually I have a 30lt water tank (that I should remember to fill sometimes!!!), few valves, a pump and this (uncomplete) pyhton script:
Code: Select all
import RPi.GPIO as GPIO
import urllib
from time import sleep
GPIO.setmode(GPIO.BCM)
# SETUP DOMOTICZ Parameters
DOMOIP = "192.168.0.40"
DOMOPORT = "8080"
DOMOVALVEIDX=[0,0,0,0,0,0,0,0] #IDX for domoticz Switch for valves
DOMOSOILIDX=[0,0,0,0,0,0,0,0] #IDX for Soil Moisture sensors in Domoticz
DOMOPUMPIDX = 0 #IDX for domoticz Switch for pump
# Setup loacl variables and PIN
WATER = 17 #PIN, value DIGITAL 0 (water ok) /1 (Add Water)
PUMP = 21 #PIN BCM to be set on OUTPUT
VALVES =[0,0,0,0,0,0,0,0] #PINs used for 8 channel raly switch
IRRTIME= [10,10,10,10,10,10,10,10] #irrigation time (in seconds) every zone has its own setup
SOILVALUE = [0,100, 250,190,10,175,90,255] #values gathered from the soil moist sensors and CustardPI3 interface
#Actual values are for testing purpuse only
SOILACTIVE = 2 #Solo zone 1 e 2 attive # how many zones are active
#Setup GPIO
GPIO.setmode(GPIO.BCM)
GPIO.setup(WATER,GPIO.IN)
GPIO.setup(PUMP,GPIO.OUT)
GPIO.output(PUMP,GPIO.LOW)
#GPIO.setup(VALVES,GPIO.OUT)
#GPIO.output(VALVES.GPIO.LOW)
# MISSING PART
# GET SOIL MOIST SENSORS VALUES FROM CUSTARDPI3
if GPIO.input(WATER) == 0:
for idx in range(0,SOILACTIVE):
if SOILVALUE[idx] < 129:
print("Vaso: ",idx, " Umidità critica (",SOILVALUE[idx],") --> apertura valvola e pompa per ", IRRTIME[idx], "sec")
GPIO.output(PUMP,GPIO.HIGH)
#UPDATE DOMOTICZ SWITCH
sleep(0.5)
GPIO.output(VALVES[IDX],GPIO.HIGH)
#UPDATE DOMOTICZ SWITCH
sleep(IRRTIME[idx])
GPIO.output(PUMP,GPIO.LOW)
#UPDATE DOMOTICZ SWITCH
GPIO.output(VALVES[IDX],GPIO.LOW)
#UPDATE DOMOTICZ SWITCH
print("OK!")
else:
print("Vaso: ",idx, " OK!(",SOILVALUE[idx],")")
else:
#SEND NOTIFICATION FOR MISSING WATER
GPIO.cleanup()
I'm not a coder, nor a programmer.... as soon as my implementation is completed I will fill the missing parts and add some pics...
but... I wish to get your opinion about
ciao
M