# Hysteresis

Verarbeitung
Hysteresis
V
O

# Eingänge

IDKürzelNameTypStandardBeschreibung
valueVvalueNUMBER0

# Ausgänge

IDKürzelNameTypStandardBeschreibung
outputOoutputBOOLEANfalse

# Konfiguration

IDNameTypStandardEinheitBeschreibung
modemodeENUM0

Details:

Werte: Midpoint + Hysteresis, Threshold (On/Off)
midpointmidpointNUMBER50.0

Details:

Sichtbar wennmode = Midpoint + Hysteresis
hysteresishysteresisNUMBER5.0

Details:

Sichtbar wennmode = Midpoint + Hysteresis
> 0
value_onvalue_onNUMBER55.0

Details:

Sichtbar wennmode = Threshold (On/Off)
neq value_off
value_offvalue_offNUMBER45.0

Details:

Sichtbar wennmode = Threshold (On/Off)
neq value_on

# Quellcode

Volang-Quellcode anzeigen
value = input::get("value")
output = output::get("output")
mode = config::get("mode") // 0=midpoint+hysteresis, 1=threshold

new_output = false

if (mode == 0) { // Midpoint + Hysteresis
    midpoint = config::get("midpoint")
    hysteresis = config::get("hysteresis")
    
    threshold_on = midpoint + hysteresis
    threshold_off = midpoint - hysteresis
    
    if (value >= threshold_on) {
        new_output = true
    } else if (value <= threshold_off) {
        new_output = false
    } else {
        // In hysteresis range, maintain current state
        new_output = output
    }
} else if (mode == 1) { // Threshold (On/Off)
    value_on = config::get("value_on")
    value_off = config::get("value_off")
    
    if (value_on > value_off) {
        // Standard hysteresis: on when high, off when low
        if (value >= value_on) {
            new_output = true
        } else if (value <= value_off) {
            new_output = false
        } else {
            // In hysteresis range, maintain current state
            new_output = output
        }
    } else {
        // Inverted hysteresis: on when low, off when high (value_off > value_on)
        if (value <= value_on) {
            new_output = true
        } else if (value >= value_off) {
            new_output = false
        } else {
            // In hysteresis range, maintain current state
            new_output = output
        }
    }
}

output::set("output", new_output)

Erfahren Sie, wie der Logikbaustein Hysteresis funktioniert, wann Sie ihn einsetzen und wie Sie ihn in Ihrer Voldeno Smart-Home-Automatisierung konfigurieren.