OpenSprinkler Forums Hardware Questions OpenSprinkler Pi (OSPi) OSPi new pressure water sensor

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #22876

    martinpihrt
    Member

    Hello, I need advice.

    I need to finish the good ospi software water pressure sensor, I do not know where place this rutine.

    a) Annex is a flowchart of my problem (circuit)
    c) screen home page and settings

    Vars held in the settings dict (gv.sd)

    ups:0 Use Pressure sensor (0=no, 1=yes, o50)
    tups:0 Type Pressure sensor (0=NC, 1=NO, o52)
    pss:0 Pressure sensed (o53)
    tpss:2 Time delay Master station ON to pressure sensed (0-10sec, o54)

    Thank you for advice on where to insert code…

    I apologize for my English

    http://www.pihrt.com/elektronika/248-moje-rapsberry-pi-zavlazovani-zahrady

    Martin Pihrt

    #26755

    martinpihrt
    Member

    @martinpihrt wrote:

    Hello, I need advice.

    I need to finish the good ospi software water pressure sensor, I do not know where place this rutine.

    a) Annex is a flowchart of my problem (circuit)
    c) screen home page and settings

    Vars held in the settings dict (gv.sd)

    ups:0 Use Pressure sensor (0=no, 1=yes, o50)
    tups:0 Type Pressure sensor (0=NC, 1=NO, o52)
    pss:0 Pressure sensed (o53)
    tpss:2 Time delay Master station ON to pressure sensed (0-10sec, o54)

    Thank you for advice on where to insert code…

    I apologize for my English

    http://www.pihrt.com/elektronika/248-moje-rapsberry-pi-zavlazovani-zahrady

    Martin Pihrt

    Thanks its OK:
    http://pihrt.com/elektronika/248-moje-rapsberry-pi-zavlazovani-zahrady

    #
    
    pokud je povoleno mereni tlaku sepne master, bezi nejaky cas, musi byt tlak potom stanice
    if gv.sd and gv.sd != 0 and not gv.sd: # pokud je povoleno mereni tlaku, je povolena master stanice a neni rucni rezim
    if master_on: # master sepnul dle programu
    if now-last_tlak_cas > gv.sd: # pokud ubehl cas do kdy musel byt tlak
    if gv.sd: # je cidlo tlaku aktivni?
    print "Cidlo tlaku je aktivni"
    else:
    print"Cidlo tlaku nesepnulo do nastavene doby, stop zalevani!"
    master_on = False
    stop_stations()
    text_log = "Chyba zalevani - hlavni stanice sepla, ale do stanovene doby se neaktivoval snimac tlaku"
    SMS_log_run(time.time(),text_log) # zapis do logu
    #----odeslani chybove SMS, pokud je povoleno
    if gv.sd: # je povoleno odesilani chybove SMS
    if gv.sd: # je povoleno odeslat na tel. cislo 1
    gv.sd = 0 # zakazeme v sms loop pouzivat modem
    jsave(gv.sd, 'sd')
    print "Odesilam stavovou SMS na telefon 1:",gv.sd, text_log
    sms = text_log+'| gammu --sendsms TEXT '+gv.sd
    cmd = '/bin/echo %s' % sms
    print 'zpracovavam "%s"' % cmd
    os.system(cmd)
    gv.sd = 1 # povolime v sms loop pouzivat modem
    jsave(gv.sd, 'sd')
    if gv.sd: # je povoleno odesilani stavove SMS
    gv.sd = 0 # zakazeme v sms loop pouzivat modem
    jsave(gv.sd, 'sd')
    print "Odesilam stavovou SMS na telefon 2:",gv.sd, text_log
    sms = SMStext_log+'| gammu --sendsms TEXT '+gv.sd
    cmd = '/bin/echo %s' % sms
    print 'zpracovavam "%s"' % cmd
    os.system(cmd)
    gv.sd = 1 # povolime v sms loop pouzivat modem
    jsave(gv.sd, 'sd')
    if gv.sd: # pokud je povoleno zasilani emailu
    text = text_log
    priloha = ""
    predmet = "Hlaseni o probehlem programu zalevani"
    get_email(gv.sd,predmet,text,priloha) # odeslani emailu
    last_tlak_cas = now
    #
    #26756

    Dan in CA
    Participant

    Hi Martin,

    I was going to suggest that if you are running the newest version of ospi.py you could put your code into a plugin as a separate file in the plugins directory. It looks like you already figured out how to make it work.

    Great job!

    Your English is good. No need to apologize.

    Dan

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.

OpenSprinkler Forums Hardware Questions OpenSprinkler Pi (OSPi) OSPi new pressure water sensor