Ankündigung

Einklappen
Keine Ankündigung bisher.

Logic frage

Einklappen
X
 
  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

    Logic frage

    Hallo, kann mir bitte jemand bei meiner Logic helfen.

    Ich möchte bei Aktivierung des PM unter Tags das Licht auf 255 schalten, im Nachtmodus auf 170 und in der Zeit zw. 23 und 5 auf 80.
    Es wird aber immer nur auf 255 bzw. 170 gedreht.
    Ich habe wahrscheinlich einen Syntaxfehler, bitte um Hilfe.

    Danke

    PHP-Code:
    if sh.OG.pm_vorraum_einaus():
    if 
    sh.TagNacht():
    if 
    23 sh.now().hour 5:
    sh.OG.deckenspot_gang_og.Dimm_gang_og(80)
    else:
    sh.OG.deckenspot_gang_og.Dimm_gang_og(170)

    else:
    sh.OG.deckenspot_gang_og.Dimm_gang_og(255)

    else:
    sh.OG.deckenspot_gang_og.Dimm_gang_og(0

    #2
    das hier ist nie true (welche Zahl ist größer als 23 aber kleiner als 5?:
    PHP-Code:
    if 23 sh.now().hour 5
    deshalb wird wenn sh.TagNacht() true ist immer else verwendet

    versuche mal:
    PHP-Code:
    if sh.now().hour 22 or sh.now().hour 5
    der andere Fehler liegt ggf. an Deinen Einrückungen, die sind hier verloren gegangen (oder hast Du keine gemacht?).






    Kommentar


      #3
      eher vl so?
      Code:
      [COLOR=#000000][COLOR=#007700]if [/COLOR][COLOR=#0000BB]5 [/COLOR][COLOR=#007700]< [/COLOR][COLOR=#0000BB]sh[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000BB]now[/COLOR][COLOR=#007700]().[/COLOR][COLOR=#0000BB]hour [/COLOR][COLOR=#007700]< [/COLOR][COLOR=#0000BB]13[/COLOR][COLOR=#007700]:[/COLOR] # wenn uhrzeit 5-23Uhr
      [COLOR=#0000BB]sh[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000BB]OG[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000BB]deckenspot_gang_og[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000BB]Dimm_gang_og[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000BB]80[/COLOR][COLOR=#007700])#auf 80setzen
      elif(bedingung nachtmodus?):[/COLOR]
      [COLOR=#0000BB]sh[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000BB]OG[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000BB]deckenspot_gang_og[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000BB]Dimm_gang_og[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000BB]170[/COLOR][COLOR=#007700])#auf 170 setzen
      
      elif([/COLOR][COLOR=#0000BB]sh[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000BB]TagNacht[/COLOR][COLOR=#007700]() == true):[/COLOR]
      [COLOR=#0000BB]sh[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000BB]OG[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000BB]deckenspot_gang_og[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000BB]Dimm_gang_og[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000BB]255[/COLOR][COLOR=#007700])#auf 255 setzen
      
      elif([/COLOR][COLOR=#0000BB]sh[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000BB]OG[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000BB]pm_vorraum_einaus[/COLOR][COLOR=#007700]() == true):[/COLOR]
      [COLOR=#0000BB]sh[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000BB]OG[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000BB]deckenspot_gang_og[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000BB]Dimm_gang_og[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000BB]0[/COLOR][COLOR=#007700])  #auf 0 setzen[/COLOR][/COLOR]

      Kommentar


        #4
        Danke funktioniert

        Kommentar

        Lädt...
        X